Commit f9dffc05 authored by Tristan Gingold's avatar Tristan Gingold

README.md: explain how to use ht-flasher

parent 329de5a5
......@@ -29,7 +29,7 @@ go for latest commit on the master branch).
``16A025-00_MM_mm`` will be generated in ``hdl/syn/fpga_files``. You should
**only** use those files for programming the FPGA. Please note that the
``hdl/syn/A25_top.bin`` is **not** the right file, it will lead to
a programmed FPGA with a missing Chameleon table.
a programmed FPGA with a missing bitstream header.
How to set a new FPGA revision
------------------------------
......@@ -60,3 +60,63 @@ When you need to bump the FPGA revision, please follow these steps:
4. Edit ``hdl/syn/scripts/gen_programming_files.tcl`` and change programming
file name to new revision in variable PROJECT_RELEASE_NAM "16A025-00_MM_mm".
5. All set, proceed with building the project and producing the FPGA bitstream.
Flashing using ht-flasher
-------------------------
The bitstreams are stored in a M25P32 flash (4MB). Although the
bitstream image is slightly less than 1MB, the system is supposed to
contain only 2 images.
At offset 0, the factory image is stored in the raw format (the .rbf,
without any header). At power-up, the fpga will automatically load
this image. This is the recue image and it shouldn't be reflashed in
operation. The bitstream will automatically load the application
image unless an error happened before (like invalid application
image).
At offset 0x200000 (2MB), the application image is stored with an
header (256B). By default, this is the bitstream used.
Using ht-flasher (and we assume the pci slot is 03:00), you can check
which image is loaded:
```
> ht-flasher -a mena25 -d 03:00 -i
control: 00000000
data: ffffffff
board status: 00000001
image: application
boot-addr: 00200100
flash id: 00000015 (15=M25P32 - 4MB)
```
You can flash the application bitstream using the `-w` option.
You can reconfigure the FPGA using the `-b` option. But you then need
to rescan the pci device.
You can display the FPGA header using the `-H` option. This is useful
to display the version and date:
```
> sudo ht-flasher -a mena25 -d 03:00 -o 0x200000 -H
magic at 0x00300000: 52d4268e
filename: './A25_top ', fpga: 'EP4CGX30 '
size: 841044
date: 2023-12-13 17:16
board type: '16A025-00 '
```
In case of invalid bitstream, the FPGA will fallback to the factory bitstream:
```
>sudo ht-flasher -a mena25 -d 03:00 -i
control: 00000000
data: ffffffff
board status: 00000022
image: fallback after error
boot-addr: 00000000
flash id: 00000015 (15=M25P32 - 4MB)
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment