Please refer to the first response of this thread programming FX3S firmware and FPGA Bitstream into SPI Flash
You can use the application for merging second stage boot loader firmware and main application firmware to the flash. Also follow the suggestions in FX3 ROM Bootloader VID / PID Override Usage this thread too.
Please let me know if this helps
Thanks for your replay. I got it working last night but now my problem is to return to Bootloader with USB.
I set the Fx3BootAppGcc with SPI and USB boot.
I want to return to the bootloader from my main app and that the bootloader will wait for new software to be flashed.
Can you tell me if and how to do it?
Please confirm that you enable SPI and USB boot for SPI with USB fallback.
You can use CyU3PUsbJumpBackToBooter and CyU3PUsbSetBooterSwitch API to jump back to the second stage boot loader. For jumping back to the boot loader the descriptors of the main firmware should be same as the second stage boot loader descriptors. This can be done by setting the first parameter of CyFx3BootUsbStart to CyTrue.
You can add a vendor interface to the firmware. On passing the vendor command, using the above API's, you can return to 2nd stage boot loader and but there should be some flag which tells the boot loader that programming to flash is completed
The vendor command to switch to second stage boot loader should be passed only when the SPI flash is programmed with new firmware.
Please let me know when do you want to switch back to second stage boot loader from main firmware.
It doesn't work as I need it.
I gave up on this