Table of Contents
System/OS: VMWare Fusion V.M. running on Mac OS X 10.14.6 host: VM is Windows 10 (Home/Free/Dev) x64, fresh installation, except that ft_prog was also installed prior.
This Windows installation sequence is presented here in the context of a fallback, if the Mac OS X tool chain installation and functionality is working completely or sufficiently (please see this post regarding Mac OS X installation). This post describes general HDL-0108-RSCPT board firmware update or development.
NOTE: Please see the section, “Full Development Tool Chain Vs. Uploading a Pre-Built Binary” to “adjust your expectations” and planning.
References
- https://github.com/FPGAwars/apio-ide/wiki
- https://apiodoc.readthedocs.io/en/stable/
- https://www.python.org/downloads/
- https://gitforwindows.org/
- https://notepad-plus-plus.org/
Full Development Tool Chain Vs. Uploading a Pre-Built Binary
It turned out that, as of this writing, the build chain on Windows worked to generate the binary and upload it to the board, but it functioned slightly differently, such that there were spurious values in the waveforms. It seems that, most likely, there are some differences between the development base platform (macOS 10.14.6 as of this writing) and even an attempt at exact replication on the Windows platform. Or something.
So the fallback is to use steps below to get the whole development tool chain, and then, instead of uploading from Atom IDE (or after you do so, if you verify or see this same problem), then you can upload a released binary from the repository releases page that was built and verified. See: https://github.com/oshablue/fpga-rscpt-up5k/releases.
The fixes and updates for more consistent behavior across build platforms and for the latest apio version are all on the very long development TODO list of course.
Steps (In Summary)
- (Please see links in the References, especially the overall installation guide)
- Download and install Python (at this writing: 3.8.3). Default options were fine, note however, that it installed to /Users/your-logged-in-user, in this case it was by default from the Windows installation, /Users/info. Yes, add the installation location to PATH variable, as indicated also in the apiodoc.readthedocs.io installation guide.
- Plug in the USB-Serial (SPI) cable from FTDI, with the description already updated, as per this post. Windows shows that the device is there, named correctly per the updated customized description.
- (Optional) Install Nodepad++ such that when you install git-bash, you can select it as your default editor – otherwise with nothing installed, you can use vim of course.
- Download and install git-bash for windows.
- pip install -U apio==0.4.1 (this version is for our project at this current writing). You might get a warning about the pip version. In this instance, the newer package was not installed. It was left as is.
- Open a git-bash terminal window session.
- apio install –all
- Plug in, importantly, the USB-SPI programming cable. The board’s main USB cable should be plugged in somewhere to power the board, but we are not directly addressing or using it here. That is important. We are talking about working with the USB-SPI programming cable whose description you have already changed to match the project’s needs, that is “Lattice iCE40UP5K Breakout”, for our purposes.
- apio driver –ftdi-enable
- Look for the Zadig (a driver tool) permission to change system dialog to appear, launched due to the previous command. Allow and proceed (if you want to do this).
- In the Zadiq dialog window, from the drop down, select the USB-SPI cable you have plugged in. Its name should be as you had programmed it, “Lattice iCE40UP5K Breakout”. This is important to get right so you don’t have to go back and uninstall a wrongly replaced driver (though that can be done). This differs from the instructions that appear on the command line after your type the apio drivers –ftdi-enable instruction.
- Use the controls to replace its current driver with the “libusbK” driver.
- Finish and close out of the window, if it doesn’t already close when you’re finished.
- Unplug and replug that USB-SPI programming cable (again, not the main board’s cable, though that needs to be plugged in somewhere to provide board power), we are talking about the separate USB-SPI programming cable.
- Download and install Atom IDE (1.47 as of this writing)
- Clone the CCC/FPGA firmware repository in a known location. It’s easier for me to do this via the git clone command line method, to a known path. Choose however your own method of course.
- Now we need to add the apio path to the Windows PATH environmental variable, explicitly, when using this particular sequence and scenario.
- In the git-bash terminal, type “which apio” and you should see the path of the installed apio. You need the parent directory (the result, without the word “apio” on the end of it).
- In the search bar, type “env” or “PATH” or similar to open the Environment Variables editor located within System Properties. Click “Environment” or similar (bottom right as of this writing). Edit the Envionment Variables “Paths”. Click “New” Add the directory that contains apio. That is the parent directory to which the previous step refers.
- Ok, Ok, etc. to store and close the windows. Screenshot below.
- Launch Atom IDE (or, if it already launched, restart it to load the updated PATHs).
- Install the apio-ide plugin using the +Install or Packages or whatever it is within Atom IDE.
- “Yes” to install all necessary dependencies.
- Now Open the directory of the repository (the clone repo itself) and it should open in Atom IDE as a project.
- Test, in this order, “Verify”, “Build” and “Upload”.
- As of this writing, using this sequence, all work, including a successful upload of the compiled code into the CCC/FPGA’s flash auxiliary chip.
- Run DacqMan with the HDL-0108-RSCPT and verify that the waveforms look good. If they don’t, for example, if they show spikes that are not real, etc. Please see the next section.
Upload a Firmware Image from the Command Line
If the Windows-built binary from the sequence above is different such that the waveforms come back with spurious “spikes”, try uploading the pre-built binary from the repository releases page at: https://github.com/oshablue/fpga-rscpt-up5k/releases
You’ll use “iceprog”, a program that is called by apio, and lives typically in: ~/.apio/packages/toolchain-icestorm/bin/
If your binary is still named, like, hardware-000a.bin, use that name in the command, or change the name to hardware.bin and upload it using the same command but specifying the filename as hardware.bin.
To test, here, a sibling directory next to the source repo has been created locally, and the binary downloaded into it. The sibling directory’s name is fpga-rscpt-up5k-releases.
In git-bash then, the command to upload, after changing directory to the directory that contains the binary file is:
$ ~/.apio/packages/toolchain-icestorm/bin/iceprog -d i:0x0403:0x6010:0 hardware-000a.bin
Comments are closed.