Cypress FX2 on OSX
To build firmware for FX2 chips – which are 8051 cores, you need SDCC. I got it from MacPorts.
sudo port install sdcc
To program FX2 parts on Linux, use fxload, a part of the Linux hotplug project. This unfortunately does not exist under OSX. Thankfully, it was ported to OSX as part of Nall’s nexys2-osx project on github, a project that I’ll be revisiting while I am getting my FPGA stuff up and running.
The fxload-osx project built nicely with the xcodebuild command in the fxload-osx directory. The binaries are hiding in build/Release. I then softlinked the binary to /usr/local/bin – because aliased commands do not appear in non-interactive shells such as the environment that Makefiles use.
git clone https://github.com/nall/nexys2-osx.git
ln -s build/Release/fxload-osx /usr/local/bin/fxload
To check how the device has enumerated to the operating system, use the built in utility, system_profiler with the flag SPUSBDataType. Cypress parts default to: Product ID 0x8613 and Vendor ID 0x04b4.
To flash the firmware without programming the eeprom, one can simply use the fxload utility (where your firmware is fw.ihx).
fxload -v -t fx2 -D 04b4:8613 -I fw.ihx
Now, here’s where it gets weird… To put the firmware in an eeprom attached to the FX2, one needs a “second stage loader” to flash the eeprom. The Linux Hotplug Project thankfully distributes a second stage loader as a3load.hex, and Linear distributes a second stage loader Vend_Ax.hex. I have not successfully flashed attached eeprom under osx. When I get it working, I’ll report back.