Jump to content

FPGA programming

From GeekDotWiki

To fix a currently unknown bug or add more cool features to the card’s main firmware, we might need to update the card’s firmware in the future.

The firmware is stored inside the flash memory on the FPGA piggyback card, a Nano 20k (nicknamed “Seurat” after the artists who invented the pointillism painting technique); it can be programmed using two tools.

Preparation

While you can update the Seurat firmware with having the ATW800/2 installed in your ATARI it's recommended to remove it for easier access and making absolutely sure that your ATARI won't be harmed (which theoretically can't happen).
All you need to do is plugging a USB-C cable to the little piggybacked FPGA board which has its other end connected to your computer running the flashing software.

Firmware images can be found in the public share.
The firmware filenames contain their version, e.g. AtariNano20k_V0205.fs means version 2.05.

Windows

On Windows, we recommend using the GoWin Programmer tool. This is also available in the public share (for Windows 32 and 64 bit).
If you like to get the most recent version can also be downloaded for free at https://www.gowinsemi.com/en/support/download_eda/ You have to register before downloading. Sorry. On the download page, scroll down to the “Programmer” section and make sure to pick the education version, which is the free one.

After installing and running the GoWin Programmer the first time, you have to set up its connection (aka “cable”). It will greet you with this dialog box:

Initially the three dropdown fields might be empty, so connect your Nano 20k using its USB-C port. The LED on the Nano 20k should start pulsing or blinking. Wait for Windows to recognize the new device, then click on the “Query/Detect Cable” button in the dialog box until the fields are updated. Make sure the values are the same as in the dialog box above and click “Save.” Now you’ll see the main window showing you one device (row). You can click in each column and change its settings: Series should be set to GW2AR and Device to GW2AR-18C.

Clicking “Operation” will open a new dialog box, which you need to configure “Access Mode” and “Operation” as shown in the following screenshot:

In “Programming Options” you can specify a bitstream (aka “firmware”) for your nano. This is optional as you can do this later in the main window by clicking the “FS File” column.

Linux and macOS

For Linux we recommend openFPGA. GoWIN also has a Linux tool, but we have no experience using it. https://github.com/trabucayre/openFPGALoader

Here’s how to install openFPGALoader via git on Linux (and mac OS): https://wiki.sipeed.com/hardware/en/tang/Tang-Nano-Doc/flash-in-linux.html

When installed, connect your Nano 20k and make sure your system has detected it. Then let openFPGALoader detect your FPGA

$ sudo ./openFPGALoader --detect

If that worked, the programming command will look something like this:

$ sudo ./openFPGALoader -b tangnano20k -f /path/to/your/ATW800_2-stuff/AtariNano20k.fs

On macOS we recommend using homebrew to easily install openFPGALoader. Here, the code looks like this:

$ brew install openfpgaloader

is all you need to type. Everything else is the same as on Linux.

You can also install openFPGA in Windows using, e.g., Cygwin, MSYS2, etc. As usual, you’ll have to jump through several burning hoops to get this working. If you’d like to go this route, please use Google and wade through the recipes available there.