openFPGALoader/guide/advanced.html

262 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Advanced usage of openFPGALoader &mdash; openFPGALoader: universal utility for programming FPGA latest documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="../_static/documentation_options.js?v=c6e86fd7"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="FPGAs" href="../compatibility/fpga.html" />
<link rel="prev" title="Troubleshooting" href="troubleshooting.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> openFPGALoader: universal utility for programming FPGA
</a>
<div class="version">
latest
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="first-steps.html">First steps with openFPGALoader</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installing openFPGALoader</a></li>
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Advanced usage of openFPGALoader</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#resetting-an-fpga">Resetting an FPGA</a></li>
<li class="toctree-l2"><a class="reference internal" href="#using-negative-edge-for-tdo-s-sampling">Using negative edge for TDOs sampling</a></li>
<li class="toctree-l2"><a class="reference internal" href="#reading-the-bitstream-from-stdin">Reading the bitstream from STDIN</a></li>
<li class="toctree-l2"><a class="reference internal" href="#automatic-file-type-detection-bypass">Automatic file type detection bypass</a></li>
<li class="toctree-l2"><a class="reference internal" href="#ft231-ft232-bitbang-mode-and-pins-configuration">FT231/FT232 bitbang mode and pins configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="#writing-to-an-arbitrary-address-in-flash-memory">Writing to an arbitrary address in flash memory</a></li>
<li class="toctree-l2"><a class="reference internal" href="#detect-read-write-on-primary-secondary-flash-memories">Detect/read/write on primary/secondary flash memories</a></li>
<li class="toctree-l2"><a class="reference internal" href="#using-an-alternative-directory-for-spioverjtag">Using an alternative directory for <em>spiOverJtag</em></a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Compatibility</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../compatibility/fpga.html">FPGAs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../compatibility/board.html">Boards</a></li>
<li class="toctree-l1"><a class="reference internal" href="../compatibility/cable.html">Cables</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Vendors</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../vendors/anlogic.html">Anlogic notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vendors/colognechip.html">Cologne Chip notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vendors/efinix.html">Efinix notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vendors/gowin.html">Gowin notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vendors/intel.html">Intel notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vendors/lattice.html">Lattice notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../vendors/xilinx.html">Xilinx notes</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../todo.html">To Do</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">openFPGALoader: universal utility for programming FPGA</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
<li>Advanced usage of openFPGALoader</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/trabucayre/openFPGALoader/blob/master/doc/guide/advanced.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="advanced-usage-of-openfpgaloader">
<span id="advanced-usage"></span><h1>Advanced usage of openFPGALoader<a class="headerlink" href="#advanced-usage-of-openfpgaloader" title="Link to this heading"></a></h1>
<section id="resetting-an-fpga">
<h2>Resetting an FPGA<a class="headerlink" href="#resetting-an-fpga" title="Link to this heading"></a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span><span class="o">[</span>options<span class="o">]</span><span class="w"> </span>-r
</pre></div>
</div>
</section>
<section id="using-negative-edge-for-tdo-s-sampling">
<h2>Using negative edge for TDOs sampling<a class="headerlink" href="#using-negative-edge-for-tdo-s-sampling" title="Link to this heading"></a></h2>
<p>If transaction are unstable you can try to change read edge by using</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span><span class="o">[</span>options<span class="o">]</span><span class="w"> </span>--invert-read-edge
</pre></div>
</div>
</section>
<section id="reading-the-bitstream-from-stdin">
<h2>Reading the bitstream from STDIN<a class="headerlink" href="#reading-the-bitstream-from-stdin" title="Link to this heading"></a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cat<span class="w"> </span>/path/to/bitstream.ext<span class="w"> </span><span class="p">|</span><span class="w"> </span>openFPGALoader<span class="w"> </span>--file-type<span class="w"> </span>ext<span class="w"> </span><span class="o">[</span>options<span class="o">]</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">--file-type</span></code> is required to detect file type.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Its possible to load a bitstream through network:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># FPGA side</span>
nc<span class="w"> </span>-lp<span class="w"> </span>port<span class="w"> </span><span class="p">|</span><span class="w"> </span>openFPGALoader<span class="w"> </span>--file-type<span class="w"> </span>xxx<span class="w"> </span><span class="o">[</span>option<span class="o">]</span>
<span class="c1"># Bitstream side</span>
nc<span class="w"> </span>-q<span class="w"> </span><span class="m">0</span><span class="w"> </span>host<span class="w"> </span>port<span class="w"> </span>&lt;<span class="w"> </span>/path/to/bitstream.ext
</pre></div>
</div>
</div>
</section>
<section id="automatic-file-type-detection-bypass">
<h2>Automatic file type detection bypass<a class="headerlink" href="#automatic-file-type-detection-bypass" title="Link to this heading"></a></h2>
<p>Default behavior is to use file extension to determine file parser.
To avoid this mechanism <code class="docutils literal notranslate"><span class="pre">--file-type</span> <span class="pre">type</span></code> must be used.</p>
</section>
<section id="ft231-ft232-bitbang-mode-and-pins-configuration">
<h2>FT231/FT232 bitbang mode and pins configuration<a class="headerlink" href="#ft231-ft232-bitbang-mode-and-pins-configuration" title="Link to this heading"></a></h2>
<p>FT232R and ft231X may be used as JTAG programmer.
JTAG communications are emulated in bitbang mode.</p>
<p>To use these devices user needs to provides both the cable and the pin mapping:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span><span class="o">[</span>options<span class="o">]</span><span class="w"> </span>-cft23XXX<span class="w"> </span>--pins<span class="o">=</span>TDI:TDO:TCK:TMS<span class="w"> </span>/path/to/bitstream.ext
</pre></div>
</div>
<p>where:</p>
<ul class="simple">
<li><p>ft23XXX may be <code class="docutils literal notranslate"><span class="pre">ft232RL</span></code> or <code class="docutils literal notranslate"><span class="pre">ft231X</span></code>.</p></li>
<li><p>TDI:TDO:TCK:TMS may be the pin ID (0 &lt;= id &lt;= 7) or string value.</p></li>
</ul>
<p>allowed values are:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>value</p></th>
<th class="head"><p>ID</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>TXD</p></td>
<td><p>0</p></td>
</tr>
<tr class="row-odd"><td><p>RXD</p></td>
<td><p>1</p></td>
</tr>
<tr class="row-even"><td><p>RTS</p></td>
<td><p>2</p></td>
</tr>
<tr class="row-odd"><td><p>CTS</p></td>
<td><p>3</p></td>
</tr>
<tr class="row-even"><td><p>DTR</p></td>
<td><p>4</p></td>
</tr>
<tr class="row-odd"><td><p>DSR</p></td>
<td><p>5</p></td>
</tr>
<tr class="row-even"><td><p>DCD</p></td>
<td><p>6</p></td>
</tr>
<tr class="row-odd"><td><p>RI</p></td>
<td><p>7</p></td>
</tr>
</tbody>
</table>
</section>
<section id="writing-to-an-arbitrary-address-in-flash-memory">
<h2>Writing to an arbitrary address in flash memory<a class="headerlink" href="#writing-to-an-arbitrary-address-in-flash-memory" title="Link to this heading"></a></h2>
<p>With FPGA using an external SPI flash (<em>xilinx</em>, <em>lattice ECP5/nexus/ice40</em>, <em>anlogic</em>, <em>efinix</em>) option <code class="docutils literal notranslate"><span class="pre">-o</span></code> allows
one to write raw binary file to an arbitrary adress in FLASH.</p>
</section>
<section id="detect-read-write-on-primary-secondary-flash-memories">
<h2>Detect/read/write on primary/secondary flash memories<a class="headerlink" href="#detect-read-write-on-primary-secondary-flash-memories" title="Link to this heading"></a></h2>
<p>With FPGA using two external SPI flash (some <em>xilinx</em> boards) option <code class="docutils literal notranslate"><span class="pre">--target-flash</span></code> allows to select the QSPI chip.</p>
<p>To detect:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span>-b<span class="w"> </span>kcu105<span class="w"> </span>-f<span class="w"> </span>--target-flash<span class="w"> </span><span class="o">{</span>primary,secondary<span class="o">}</span><span class="w"> </span>--detect
</pre></div>
</div>
<p>To read the primary flash memory:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span>-b<span class="w"> </span>kcu105<span class="w"> </span>-f<span class="w"> </span>--target-flash<span class="w"> </span>primary<span class="w"> </span>--dump-flash<span class="w"> </span>--file-size<span class="w"> </span>N_BYTES<span class="w"> </span>mydump.bin
</pre></div>
</div>
<p>and the second flash memory:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span>-b<span class="w"> </span>kcu105<span class="w"> </span>-f<span class="w"> </span>--target-flash<span class="w"> </span>secondary<span class="w"> </span>--dump-flash<span class="w"> </span>--file-size<span class="w"> </span>N_BYTES<span class="w"> </span>--secondary-bitstream<span class="w"> </span>mydump.bin
</pre></div>
</div>
<p>To write on secondary flash memory:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>openFPGALoader<span class="w"> </span>-b<span class="w"> </span>kcu105<span class="w"> </span>-f<span class="w"> </span>--target-flash<span class="w"> </span>secondary<span class="w"> </span>--secondary-bitstream<span class="w"> </span>mySecondaryBitstream.bin
</pre></div>
</div>
</section>
<section id="using-an-alternative-directory-for-spioverjtag">
<h2>Using an alternative directory for <em>spiOverJtag</em><a class="headerlink" href="#using-an-alternative-directory-for-spioverjtag" title="Link to this heading"></a></h2>
<p>By setting <code class="docutils literal notranslate"><span class="pre">OPENFPGALOADER_SOJ_DIR</span></code> its possible to override default
<em>spiOverJtag</em> bitstreams directory:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">OPENFPGALOADER_SOJ_DIR</span><span class="o">=</span>/somewhere
openFPGALoader<span class="w"> </span>xxxx
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">OPENFPGALOADER_SOJ_DIR</span><span class="o">=</span>/somewhere<span class="w"> </span>openFPGALoader<span class="w"> </span>xxxx
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="troubleshooting.html" class="btn btn-neutral float-left" title="Troubleshooting" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../compatibility/fpga.html" class="btn btn-neutral float-right" title="FPGAs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2019-2022, Gwenhael Goavec-Merou and contributors.</p>
</div>Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/buildthedocs/sphinx.theme">theme</a>
provided by <a href="https://buildthedocs.github.io">Build the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>