add initial python section
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
4f50750b32
commit
9901b83844
BIN
img/fomu-memory-layout.png
Normal file
BIN
img/fomu-memory-layout.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 200 KiB |
BIN
img/ice40-ledd.png
Normal file
BIN
img/ice40-ledd.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
BIN
img/ice40-lut.png
Normal file
BIN
img/ice40-lut.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
img/tomu-fpga-evt-1-small.jpg
Normal file
BIN
img/tomu-fpga-evt-1-small.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 KiB |
203
index.html
203
index.html
@ -89,43 +89,37 @@
|
|||||||
<h2>Fomu: an FPGA in your USB Port</h2>
|
<h2>Fomu: an FPGA in your USB Port</h2>
|
||||||
<img src="img/tomu-fomu-case-superwide.jpg">
|
<img src="img/tomu-fomu-case-superwide.jpg">
|
||||||
<p>
|
<p>
|
||||||
Fomu (with case): an FPGA in your USB port. Crowdfunding now! One week to go. <a href="https://t.xobs.io/fomu">t.xobs.io/fomu</a>
|
Pre-order now on Crowd Supply! <a href="https://t.xobs.io/fomu">t.xobs.io/fomu</a>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section data-background-image="css/theme/lca2019-title-bg-transparent.svg">
|
<section data-background-image="css/theme/lca2019-title-bg-transparent.svg">
|
||||||
<h1>Fomu: An FPGA in your USB Port</h1>
|
<h1>Fomu: An FPGA in your USB Port</h1>
|
||||||
<h4>A whirlwind introduction to Fomu and FPGAs</h4>
|
<h4>A whirlwind introduction to Fomu; a workshop in three levels</h4>
|
||||||
<p align="right">
|
<p align="right">
|
||||||
<small>Sean Cross - <a href="https://xobs.io/">https://xobs.io/</a> - @xobs</small>
|
<small>Sean Cross - <a href="https://xobs.io/">https://xobs.io/</a> - @xobs</small>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h3>Outline</h3>
|
<h2>Levels of Fomu</h2>
|
||||||
|
<p>
|
||||||
|
Fomu aims to be accessable on three levels:
|
||||||
<ol>
|
<ol>
|
||||||
<li>Fomu Firmware Layout</li>
|
<li>Python / Interpreted</li>
|
||||||
<li>
|
<li>RISC-V</li>
|
||||||
<ol>
|
<li>Verilog / FPGA</li>
|
||||||
<li>Bootloader</li>
|
|
||||||
<li>Recovery</li>
|
|
||||||
<li>Magic constants</li>
|
|
||||||
<li>Interpreters</li>
|
|
||||||
<li>Updates</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
<li>Loading firmware onto Fomu</li>
|
|
||||||
<li>Blinkenlights</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Workshop Outline</h2>
|
<h2>Workshop Outline</h2>
|
||||||
<ol>
|
<ol>
|
||||||
<li>What do I need to get started?</li>
|
<li>What do I need to get started?</li>
|
||||||
<li>What is Fomu, and what is an FPGA?</li>
|
<li>What is an FPGA, and what is Fomu?</li>
|
||||||
<li>What can I do with Fomu?</li>
|
|
||||||
<li>What makes Fomu special?</li>
|
<li>What makes Fomu special?</li>
|
||||||
|
<li>What can I do with Fomu?</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@ -133,9 +127,13 @@
|
|||||||
<section>
|
<section>
|
||||||
<h2>What do I need to get started?</h2>
|
<h2>What do I need to get started?</h2>
|
||||||
<ol>
|
<ol>
|
||||||
|
<li>DFU utilities</li>
|
||||||
|
<li>Serial console</li>
|
||||||
|
<li>RISC-V toolchain</li>
|
||||||
<li>Synthesis</li>
|
<li>Synthesis</li>
|
||||||
<li>Place-and-Route</li>
|
<li>Place-and-Route</li>
|
||||||
<li>Packer</li>
|
<li>Packer</li>
|
||||||
|
<li>Python 3</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
@ -143,34 +141,65 @@
|
|||||||
<section>
|
<section>
|
||||||
<section>
|
<section>
|
||||||
<h2>What is an FPGA?</h2>
|
<h2>What is an FPGA?</h2>
|
||||||
|
<img data-src="img/ice40-lut.png" alt="SB_LUT4">
|
||||||
|
<!--
|
||||||
<p>
|
<p>
|
||||||
An FPGA is like a hardware emulator. It can change itself so that it can take on the characteristics of any other digital logic.
|
An FPGA is a chip that executes logic.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
FPGAs are measured in resources called LUTs or LCs.
|
FPGAs are measured in resources called LUTs or LCs.
|
||||||
</p>
|
</p>
|
||||||
|
-->
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>What is an FPGA?</h2>
|
||||||
|
<pre><code class="verilog" data-trim>
|
||||||
|
module DFF (output reg Q, input C, D, R);
|
||||||
|
always @(posedge C)
|
||||||
|
if (~R) begin
|
||||||
|
Q <= 1'b0;
|
||||||
|
end else begin
|
||||||
|
Q <= D;
|
||||||
|
end
|
||||||
|
endmodule
|
||||||
|
</code></pre>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>About the ICE40UP5K</h2>
|
||||||
|
<ol>
|
||||||
|
<li>5280 4-input LUTs (LC)</li>
|
||||||
|
<li>16 kilobytes BRAM</li>
|
||||||
|
<li class="fragment highlight-blue">128 kilobytes "SPRAM"</li>
|
||||||
|
<li>Current-limited 3-channel LED</li>
|
||||||
|
<li>2x I2C and 2x SPI</li>
|
||||||
|
<li>8 16-bit DSP units</li>
|
||||||
|
<li>Warmboot capability</li>
|
||||||
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>What is Fomu?</h2>
|
<h2>What is Fomu?</h2>
|
||||||
<p>
|
<ul>
|
||||||
|
<li>ICE40UP5K in your USB port</li>
|
||||||
|
<li>2MB flash memory</li>
|
||||||
|
<li>Four edge-plated pads</li>
|
||||||
|
<li>ESD protection</li>
|
||||||
|
<li>USB implemented in HDL</li>
|
||||||
|
</ul>
|
||||||
|
<!-- <p>
|
||||||
Fomu is an FPGA that fits in your USB port. It has foru buttons, 2 MB of SPI flash, an RGB LED, and an ICE40UP5K with 5280 LCs. It also has 128 kB of dedicated RAM, not counting the block RAM.
|
Fomu is an FPGA that fits in your USB port. It has foru buttons, 2 MB of SPI flash, an RGB LED, and an ICE40UP5K with 5280 LCs. It also has 128 kB of dedicated RAM, not counting the block RAM.
|
||||||
|
|
||||||
Unlike many other PCBs, Fomu does not have a separate USB controller chip. This means that any projects that want to use the USB port must include a USB softcore.
|
Unlike many other PCBs, Fomu does not have a separate USB controller chip. This means that any projects that want to use the USB port must include a USB softcore.
|
||||||
</p>
|
</p> -->
|
||||||
</section>
|
|
||||||
|
|
||||||
<section>
|
|
||||||
<h2>Fomu Block Design Diagram</h2>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section>
|
|
||||||
<h2>ICE40 Features</h2>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>What is this PCB?</h2>
|
<h2>What is this PCB?</h2>
|
||||||
<p>
|
<img data-src="img/tomu-fpga-evt-1-small.jpg" alt="Fomu EVT1">
|
||||||
|
<h3>Fomu EVT1</h3>
|
||||||
|
<!-- <p>
|
||||||
This is Fomu EVT1. This is the original stretch prototype of Fomu. The schematics are the same, but much has changed:
|
This is Fomu EVT1. This is the original stretch prototype of Fomu. The schematics are the same, but much has changed:
|
||||||
|
|
||||||
* Name changed from Tomu-FPGA to Fomu
|
* Name changed from Tomu-FPGA to Fomu
|
||||||
@ -189,19 +218,35 @@
|
|||||||
* Populate Raspberry Pi header
|
* Populate Raspberry Pi header
|
||||||
* Add PMOD pins to touchpads
|
* Add PMOD pins to touchpads
|
||||||
* Swap PMODa pins for I3C
|
* Swap PMODa pins for I3C
|
||||||
</p>
|
</p> -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>What modifications does it have?</h2>
|
<h2>What modifications does it have?</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Shorting out two zero-ohm resistors</li>
|
<li>Shorting out two zero-ohm resistors (R7, PU)</li>
|
||||||
<li>Programming SPI flash</li>
|
<li>Programming SPI flash</li>
|
||||||
<li>Bending SPI flash pins inward</li>
|
<li>Bending SPI flash pins inward (U4)</li>
|
||||||
<li>Mounting crystal on its side</li>
|
<li>Mounting crystal on its side (U7)</li>
|
||||||
<li>Attaching power to crystal</li>
|
<li>Attaching power to crystal</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Fomu Block Design Diagram</h2>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Fomu SPI Flash Layout</h2>
|
||||||
|
<img data-src="img/fomu-memory-layout.png" alt="Fomu memory layout">
|
||||||
|
<!-- <ol>
|
||||||
|
<li>Bootloader</li>
|
||||||
|
<li>Recovery</li>
|
||||||
|
<li>Magic constants</li>
|
||||||
|
<li>Interpreters</li>
|
||||||
|
<li>Updates</li>
|
||||||
|
</ol> -->
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@ -214,70 +259,17 @@
|
|||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h2>Updating Fomu</h2>
|
<h2>Updating Fomu</h2>
|
||||||
<code>
|
<pre><code>$ dfu-util -l
|
||||||
sean@PAZUZU ~\Code\Fomu\foboot\releases\v1.8.1 master ≢ [10:45]
|
Found DFU: [1209:5bf0] name="Fomu DFU Bootloader v1.7.2"
|
||||||
❯ dfu-util -l
|
$ dfu-util -D evt-installable.dfu
|
||||||
dfu-util 0.9
|
|
||||||
|
|
||||||
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
|
|
||||||
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
|
|
||||||
This program is Free Software and has ABSOLUTELY NO WARRANTY
|
|
||||||
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
|
|
||||||
|
|
||||||
Found DFU: [1209:5bf0] ver=0101, devnum=16, cfg=1, intf=0, path="1-1.1.2", alt=0, name="Fomu DFU Bootloader v1.7.2", serial="UNKNOWN"
|
|
||||||
sean@PAZUZU ~\Code\Fomu\foboot\releases\v1.8.1 master ≢ [10:45]
|
|
||||||
❯ dfu-util -D .\pvt-installable.dfu
|
|
||||||
dfu-util 0.9
|
|
||||||
|
|
||||||
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
|
|
||||||
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
|
|
||||||
This program is Free Software and has ABSOLUTELY NO WARRANTY
|
|
||||||
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
|
|
||||||
|
|
||||||
Match vendor ID from file: 1209
|
|
||||||
Match product ID from file: 5bf0
|
|
||||||
Opening DFU capable USB device...
|
|
||||||
ID 1209:5bf0
|
|
||||||
Run-time device DFU version 0101
|
|
||||||
Claiming USB DFU Interface...
|
|
||||||
Setting Alternate Setting #0 ...
|
|
||||||
Determining device status: state = dfuIDLE, status = 0
|
|
||||||
dfuIDLE, continuing
|
|
||||||
DFU mode device DFU version 0101
|
|
||||||
Device returned transfer size 1024
|
|
||||||
Copying data from PC to DFU device
|
|
||||||
Download [========= ] 36% 38912 bytes
|
Download [========= ] 36% 38912 bytes
|
||||||
Download done.
|
Download done.
|
||||||
state(7) = dfuMANIFEST, status(0) = No error condition is present
|
$ dfu-util -l
|
||||||
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
|
Found DFU: [1209:5bf0] name="Fomu DFU Bootloader v1.8.1"
|
||||||
Done!
|
$</code></pre>
|
||||||
sean@PAZUZU ~\Code\Fomu\foboot\releases\v1.8.1 master ≢ [10:45]
|
|
||||||
❯ dfu-util -l
|
|
||||||
dfu-util 0.9
|
|
||||||
|
|
||||||
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
|
|
||||||
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
|
|
||||||
This program is Free Software and has ABSOLUTELY NO WARRANTY
|
|
||||||
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
|
|
||||||
|
|
||||||
Found DFU: [1209:5bf0] ver=0101, devnum=14, cfg=1, intf=0, path="1-1.1.2", alt=0, name="Fomu DFU Bootloader v1.8.1", serial="UNKNOWN"
|
|
||||||
sean@PAZUZU ~\Code\Fomu\foboot\releases\v1.8.1 master ≢ [10:47]
|
|
||||||
❯
|
|
||||||
</code>
|
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
|
||||||
<h2>Levels of Fomu</h2>
|
|
||||||
<p>
|
|
||||||
Fomu aims to be accessable on three levels:
|
|
||||||
<ol>
|
|
||||||
<li>Python / Interpreted</li>
|
|
||||||
<li>RISC-V</li>
|
|
||||||
<li>Verilog / FPGA</li>
|
|
||||||
</ol>
|
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
<section>
|
<section>
|
||||||
<section>
|
<section>
|
||||||
<h2>Python / Interpreted</h2>
|
<h2>Python / Interpreted</h2>
|
||||||
@ -289,25 +281,46 @@ sean@PAZUZU ~\Code\Fomu\foboot\releases\v1.8.1 master ≢
|
|||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Loading Programs onto Fomu</h2>
|
<h2>Loading Programs onto Fomu</h2>
|
||||||
<code>dfu-util -l</code>
|
<pre><code>
|
||||||
<code>dfu-util -D update.bin</code>
|
$ dfu-util -l
|
||||||
|
Found DFU: [1209:5bf0] name="Fomu DFU Bootloader v1.8.1"
|
||||||
|
$ dfu-util -e # Boot current program
|
||||||
|
$ dfu-util -D new-image.dfu # Load new program</code></pre>
|
||||||
|
<h3 class="fragment">u<code>5b f0</code>mu</h3>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Loading MicroPython</h2>
|
<h2>Loading MicroPython</h2>
|
||||||
<code>dfu-util -D micropython.dfu</code>
|
<pre><code>$ dfu-util -D micropython-fomu.dfu</code></pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Connecting via serial</h2>
|
<h2>Connecting via serial</h2>
|
||||||
|
<pre class="fragment"><code>screen /dev/cu.usbserial*</code></pre>
|
||||||
|
<pre class="fragment"><code>screen /dev/ttyACM*</code></pre>
|
||||||
|
<pre class="fragment"><code>Teraterm</code></pre>
|
||||||
|
<pre class="fragment"><code>MicroPython v1.10-296-g0a5a77a on 2019-06-18; fomu with vexriscv
|
||||||
|
>>></code></pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Interacting with Fomu</h2>
|
<h2>Interacting with Fomu</h2>
|
||||||
|
<pre><code class="python" data-trim>
|
||||||
|
>>> import fomu
|
||||||
|
>>> rgb = fomu.rgb()
|
||||||
|
>>> rgb.mode("error")
|
||||||
|
>>>
|
||||||
|
</code></pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>RGB LEDD reference</h2>
|
<h2>RGB LEDD reference</h2>
|
||||||
|
<img data-src="img/ice40-ledd.png" alt="ICE40 LEDD registers">
|
||||||
|
<pre class="fragment"><code class="python" data-trim>>>> rgb.write_raw(0b0001, 255)
|
||||||
|
>>> rgb.write_raw(0b1010, 14)
|
||||||
|
>>> rgb.write_raw(0b1011, 1)
|
||||||
|
>>>
|
||||||
|
</code></pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
Loading…
Reference in New Issue
Block a user