Trying to imitate the performance of the Open Control Center tool provided by Cypress EZ USB Suite, opening firmware image for RAM upload ans writing image has been successful by using libusb.
Here is the repository used:
So basically, what I've done is running fxload.exe on Command Prompt app (Windows 10) executing the following command line:
> fxload project.img -d 04b4:00f3
Where project.img is the result of my application and 04b4:00f3 is the Vendor ID and the Product ID respectively.
As a result, the next message is showed:
> found device 'Cypress FX3' [04b4:00f3] (1,22)
> microcontroller type: fx3
> project.img: type Cypress IMG format
> open firmware image project.img for RAM upload
> normal FW binary executable image with checksum
> FX3 bootloader version: 0x000000A9
> writing image...
> transfer execution to Program Entry at 0x4000b71c
The result is exactly the same when you click on "Program" tab > "RAM" in Open Control Center tool, so I'm happy with that.
Now I want to load a image file to EEPROM, imitating the performance of the Open Control Center tool one more time but I couldn't find a solution to this.
Looking through libusb-1.0.20, I've assumed that EEPROM needs a Second Stage Loader to load the firmware properly:
"If you want a loader for development use, which can write to the I2C boot EEPROM using the 0xA2 request, see the "Vend_Ax" code provided with the developer kit for your microcontroller."
"Vend_Ax" code, provided by Cypress, is located in "<Installation_Path>\Cypress\EZ-USB" but only for FX and FX2 versions.
In EZ-USB FX3 SDK this file doesn't exist, so it's impossible for me to execute the following command line:
> fxload -i project.img -d 04b4:00f3 -s vendor_ax.hex
I've assumed two things:
- EEPROM needs a Second Stage Loader compulsorily, but I'm not sure about that.
In that case, where can I get a "Vendor_Ax.hex" file for FX3?
- fxload.exe has to provided me the specific functionalities to load a firmware to EEPROM, , but I'm not sure about that either.
Even if it were not, what is the properly way to load a firmware to EEPROM?
In libusb, "ezusb.c" file provides "fx3_load_ram" implementation but "fx3_load_eeprom" isn't, although this function is declared in "ezusb.h" including practically the same parameters that "fx3_load_ram". Where this function implementation is?
Could someone help me to load a firmware to EEPROM?