FX3 firmware update

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Subhash24
Level 4
Level 4
25 replies posted 10 likes given 50 sign-ins

Can any one give me some steps on how to write DFU for FX3 ?

0 Likes
1 Solution

Hello,

Please find our comments to your questions below:

1. This question is already answered in the following community thread:

https://community.infineon.com/t5/USB-Superspeed-Peripherals/what-is-DETACH-ATTACH-sequence/td-p/324...

If you have any further questions, please post it in the thread mentioned above.

2. As per the DFU specification, when the host is about to perform a firmware update, the device should re-enumerate with the DFU mode descriptors. Suspend and resume thread APIs will not make the device to re-enumerate. You can try the following:

a. Maintain 2 sets of descriptors

b. Initially, the first set of descriptors (runtime) can be registered with the driver by using the API CyU3PUsbSetDesc () 

b. When DFU firmware update is initiated, stop each and every ongoing activity and de-initialize all the peripherals. After this, disconnect the device by using CyU3PConnectState () API. 

c. After a small delay, reconnect the device again.

d. This time, the new set of descriptors (DFU mode) should be registered with the driver by using the API CyU3PUsbSetDesc ()

Please try this and let us know if this helps.

3. Yes, it is necessary to erase SPI flash before writing firmware.

4. As you might be knowing, FX3 has a ROM bootloader. When the device is configured for SPI boot (Using PMODE pins), the ROM bootloader starts to look for the application firmware stored in address 0 of the SPI flash. So, you should write your firmware into address 0 of SPI flash.

5. If the new firmware is written to address 0 of the SPI flash and if the PMODE[2:0] pins are set to 0z1, then after the update, you can call the API CyU3PDeviceReset (CyFalse). This API will trigger a software reset.

6. Please refer to sections 3.5.2 and 3.5.3 of the following document:

https://www.cypress.com/file/133836/download

The above document is specifically for Superspeed explorer kit. If you are using a custom board, then make sure that the PMODE pins are brought to F11 before programming the device. The only difference for programming an SPI flash is in the selection Program-> FX3 -> SPI Flash. Everything else remains the same.

Best Regards,
Jayakrishna

View solution in original post

4 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please elaborate your requirement so that we can understand it better. Did you mean how to upload firmware into FX3 RAM?

Best Regards,
Jayakrishna
0 Likes

I'm a begginer

I'm trying to use SPI to update firmware and for handling requests from host I used this

https://www.usb.org/sites/default/files/DFU_1.1.pdf

I followed everything as mentioned in the document

but I have lot of doubts now

1) what is DETACH_ATTACH sequence and how to implement it in FX3?

2) Im using suspend and resume thread API's to switch from running app to DFU mode is it fine? If not what do I need to use?

3)Is it necessary to erase SPI flash before writing firmware?

4)what  starting address of SPI flash should I take to write my firmware to SPI flash?

5)after completion how can I switch to updated firmware?

6) how to upload firmware through control center?

Thank you.

0 Likes

Hello,

Please find our comments to your questions below:

1. This question is already answered in the following community thread:

https://community.infineon.com/t5/USB-Superspeed-Peripherals/what-is-DETACH-ATTACH-sequence/td-p/324...

If you have any further questions, please post it in the thread mentioned above.

2. As per the DFU specification, when the host is about to perform a firmware update, the device should re-enumerate with the DFU mode descriptors. Suspend and resume thread APIs will not make the device to re-enumerate. You can try the following:

a. Maintain 2 sets of descriptors

b. Initially, the first set of descriptors (runtime) can be registered with the driver by using the API CyU3PUsbSetDesc () 

b. When DFU firmware update is initiated, stop each and every ongoing activity and de-initialize all the peripherals. After this, disconnect the device by using CyU3PConnectState () API. 

c. After a small delay, reconnect the device again.

d. This time, the new set of descriptors (DFU mode) should be registered with the driver by using the API CyU3PUsbSetDesc ()

Please try this and let us know if this helps.

3. Yes, it is necessary to erase SPI flash before writing firmware.

4. As you might be knowing, FX3 has a ROM bootloader. When the device is configured for SPI boot (Using PMODE pins), the ROM bootloader starts to look for the application firmware stored in address 0 of the SPI flash. So, you should write your firmware into address 0 of SPI flash.

5. If the new firmware is written to address 0 of the SPI flash and if the PMODE[2:0] pins are set to 0z1, then after the update, you can call the API CyU3PDeviceReset (CyFalse). This API will trigger a software reset.

6. Please refer to sections 3.5.2 and 3.5.3 of the following document:

https://www.cypress.com/file/133836/download

The above document is specifically for Superspeed explorer kit. If you are using a custom board, then make sure that the PMODE pins are brought to F11 before programming the device. The only difference for programming an SPI flash is in the selection Program-> FX3 -> SPI Flash. Everything else remains the same.

Best Regards,
Jayakrishna

JayaKrishna,

Thanks a lot .

0 Likes