When an FX3 is running an image, how can it be S/W rebooted to load another image?

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

cross mob
JoNe_4646056
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

When an FX3 is running an image, how can it be S/W rebooted to then load another image via USB (RAM)?
I do this now by manually reseting the FX3 board. Yes, I realize it will re-enumerate etc.

For example, could a HOST (Vendor??) reset command cause the default FX3 USB driver to do a Device Reset?

Thanks

John

------------------------
On Ubuntu18 w/ libusb and cyusb.

1 Solution
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

You can make use of the FX3 second stage bootloader and USB Boot for this purpose.

Initially, you can use the USB boot option in the second stage bootloader and load the firmware from USB to RAM.

The firmware you are loading should have a vendor command to jump back to bootloader, CyU3PUsbJumpBackToBooter() API implemented.

Whenever you want to change the firmware, send the respective vendor command to jump back to the Second stage bootloader and then you can reload the RAM with new firmware using USB.

Please refer to below KBAs for information on Second Stage Bootloader:

FX3 as Custom USB Bootloader - KBA218343

Working of Second Stage Bootloader in FX3™ - KBA90266

Also, if you want to do device reset from software, you can use the Reset( ) API in CyUSB.dll(C#) or the CyAPI.lib(C++).

In control center it is the RESET device button highlighted in blue below:

pastedImage_1.png

Thanks,

Yatheesh

View solution in original post

4 Replies
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

You can make use of the FX3 second stage bootloader and USB Boot for this purpose.

Initially, you can use the USB boot option in the second stage bootloader and load the firmware from USB to RAM.

The firmware you are loading should have a vendor command to jump back to bootloader, CyU3PUsbJumpBackToBooter() API implemented.

Whenever you want to change the firmware, send the respective vendor command to jump back to the Second stage bootloader and then you can reload the RAM with new firmware using USB.

Please refer to below KBAs for information on Second Stage Bootloader:

FX3 as Custom USB Bootloader - KBA218343

Working of Second Stage Bootloader in FX3™ - KBA90266

Also, if you want to do device reset from software, you can use the Reset( ) API in CyUSB.dll(C#) or the CyAPI.lib(C++).

In control center it is the RESET device button highlighted in blue below:

pastedImage_1.png

Thanks,

Yatheesh

Thanks always for the prompt response. I will followup with the KBAs. It looks like CyU3PUsbJumpBackToBooter() may be the solution.

Note that the context is dev & debug, so when in production mode, I assume this path will allow to switch to SPI.


As for the Reset( ) API, this is NOT available in the cyusb (libusb) lib on linux, right?

BTW, I assumed the Reset Button on ControlCenter (Win & Linux) would hard (device) reset the board, but that does not seem to be the case?? Maybe I misunderstand something here?

-- I always need to press the FX3 reset button, or plug/unplug the USB cable.

Thanks

John

0 Likes

Hello John,

The all Reset APIs from the Host (library and control center) will cause the device to reset without loosing the firmware.

If you want to implement a hard reset, you can use the vendor command implementation, where a vendor command is sent to the Fx3 device and the FX3 firmware will call the CYU3PDeviceReset(CyFalse) to hard reset the device.

Please refer to the USBBulkloopAuto or USBBulkSourceSink Example from the FX3 SDK, Vendor request 0xE0 is used to perform a hard reset.

Thanks,

Yatheesh

Yatheesh,

OK, I now understand that the Reset APIs will reset but don't actually lose the f/w!

Thanks for also clarifying my second question - I'll use the Vendor request 0xE0 to do a hard reset for now.

Your initial response with CyU3PUsbJumpBackToBooter is the path I will take for loading lab/production images.

Thanks again!

John

0 Likes