- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to create the .img file to download the FX3 firmware through the USB interface (CyControl.exe) in RAM ?
Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can find the ELF to IMG conversion tool in C:\Cypress\FX3 SDK\util\elf2img.
I put this in the Eclipse Post Build Step: elf2img.exe -i "${BuildArtifactFileName}" -o "${BuildArtifactFileBaseName}.img"
For this you have to set the PATH variable in Windows correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Since which version is this util (elf2img) present ?
I've been currently using a 321 version and it was not present.
I've downloaded a 384 version (of FX3 SDK only, not Eclipse nor GCC toolchain) but it is still not present.
Best Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok it is present, but there was a bad installation because I selected a different directory than "c:\cypress\fx3 sdk" as root.
Sorry.
Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok It seems to work. 2 additionnal questions :
is the .img file created with these options directly downloadable into RAM via USB interface ?
what are the options to create a SPI bootable file ?
Thank you for your help,
Best Regards.
D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) what are the options to create a SPI bootable file ?
Please check following Applucation Note for details - AN70193 - EZ-USB® FX3 SPI Boot Option.
You can use the same utility to create the image by just choose an appropriate EEPROM Control byte.
2) is the .img file created with these options directly downloadable into RAM via USB interface ?
The Image generated will have following 8 bytes as header:
'C' ,'Y',0xXX, 0xXX //CY Signature followed by 2 dummy bytes
4bytes of 'length' of image section //get length
4bytes of start 'address' in RAM //get address
Next byte is start of Image section.
So after this you can use vendor command 0xA0 and the image can be downloaded to RAM in chunks of 4Kbytes. Each section is terminated by 4bytes of zeroes. 0x0000_0000.
And all new sections start with 4bytes length and 4bytes address followed by Image.
Thanks,
Shruti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correction: Image generated has 12 bytes of header.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You said there are 4 bytes of zeros at the end of every section.
Can you explain this in more detail? Are these bytes just padding? Are they included in the size calculations for each section?
Also, the elf2img tool, distributed with the SDK, does _not_ have 4 bytes of zero padding in the *.img output. Is there a reason for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the confusion.
After end of the last section next 4 bytes are 0x0000_0000. This indicated image termination. After that next 4 bytes are address you want PC to jump to after download complete.
And after that last 4 bytes of image are checksum bytes.
Any data after that is ignored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for responding! You are being very helpful.
Okay, so, just to make sure I understand this:
1) Image Header:
C, Y, 0xXX, 0xXX
<4 bytes length of image>
<4 bytes start address in RAM>
Push the image header using the command 0xA0.
2) Each section of 4Kb chunks:
<4 bytes section length>
<4 bytes start address>
<image data of the length specified above>
Push all of the sections using the command 0xA0.
3) Image termination:
0x0000_0000,
<4 bytes address to jump to>
<checksum of image>
Push image termination sequence using 0xA0.
My last question is what other fields do we need to use for the vendor command 0xA0? For example, in the FX2, you would need to tell the CPU to reset by pushing: <0xA0, 0xE600, 0x0000, 0x1, 1>. Each section you pushed then looked like:
<0xA0, address, index (unused?), data, length>
Since the FX3 has 32 bit addressing, how do we do this? For example, in order to write the image header, what does it look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The firmware (.img) is downloaded to FX3 RAM using the Control Center --> Program --> FX3 --> RAM and selecting the .img file.
My question is: How can I do it programmatically from C/C++ promgram ?
Is there an API that do the above operation done by the Control Center GUI?
Thanks,
Zafrir Patt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The firmware download is included in the CyUSB3 API. Without the API you can download the new firmware by every driver/API you want (WinUSB, LibUSB) using the control transfers as described above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everybody,
I just studied this topic, and it may be helpfull to others that there is pseudocode in
AN73150: Booting EZ-USB® FX3 over High-Speed USB
Further you may test your firmware uploader using the firmware example in
C:\Cypress\EZ-USB FX3 SDK\1.1\firmware\boot_fw
It worked for me