Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > firmware download in RAM for FX3

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



firmware download in RAM for FX3
Moderator:
RSKV

Post Reply
Follow this topic



firmware download in RAM for FX3

DamL posted on 26 Jul 2011 5:18 AM PST
Senior Member
18 Forum Posts

How to create the .img file to download the FX3 firmware through the USB interface (CyControl.exe) in RAM ?

Best Regards,




Re: firmware download in RAM for FX3

Chris R. posted on 26 Jul 2011 06:05 AM PST
Top Contributor
135 Forum Posts

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.



Re: firmware download in RAM for FX3

DamL posted on 26 Jul 2011 06:38 AM PST
Senior Member
18 Forum Posts

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.



Re: firmware download in RAM for FX3

DamL posted on 26 Jul 2011 06:45 AM PST
Senior Member
18 Forum Posts

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,

 



Re: firmware download in RAM for FX3

DamL posted on 26 Jul 2011 07:02 AM PST
Senior Member
18 Forum Posts

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.

 



Re: firmware download in RAM for FX3

posted on 27 Jul 2011 04:18 AM PST
Member
7 Forum Posts

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



Re: firmware download in RAM for FX3

posted on 27 Jul 2011 04:41 AM PST
Member
7 Forum Posts

Correction: Image generated has 12 bytes of header.



Re: firmware download in RAM for FX3

wglados posted on 07 Sep 2011 05:17 PM PST
Top Contributor
23 Forum Posts

 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?



Re: firmware download in RAM for FX3

posted on 12 Sep 2011 06:18 AM PST
Member
7 Forum Posts

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.

 

 



Re: firmware download in RAM for FX3

wglados posted on 12 Sep 2011 10:01 AM PST
Top Contributor
23 Forum Posts

 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?

 



Re: firmware download in RAM for FX3

zafrir posted on 09 Jul 2012 01:48 AM PST

1 Forum Post

 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



Re: firmware download in RAM for FX3

Chris R. posted on 09 Jul 2012 07:03 AM PST
Top Contributor
135 Forum Posts

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.



Re: firmware download in RAM for FX3

dtromp_nl posted on 17 Jul 2012 06:33 AM PST
Senior Member
11 Forum Posts

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

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.