Problems using 2nd Stage Bootloader

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

cross mob
Anonymous
Not applicable

Hi,

So I'm trying to understand the use of the 2nd Stage Bootloader and I'm having the following issue.

I program the 2nd Stage Bootloader into the I2C EEPROM for the FX3 and set up the jumpers so that it will attempt EEPROM first. This part of the project works, as on startup, the device enumerates as my custom bootloader with custom serial number and ect... However when programming the 2nd stage bootloader with my final firmware (a modified FIFO) the success rate is typically only about 80%. The only modification I have made to the Fx3BootAppGcc, is switching CyFx3BootUsbStart (CyTrue, myUsbEventCallback); to CyFx3BootUsbStart (CyFalse, myUsbEventCallback);, so to enable booting from the USB once the 2nd stage bootloader has enumerated.

Any advice on the poor success rate of programming my 2nd Stage Bootloader would be much appreciated!

Kind Regards

0 Likes
1 Solution

Hi,

The ways of using the second stage bootloader:

1. The first parameter of CyFx3BootUsbStart is CyTrue:

- In this case there won't be re-enumeration when the final firmware starts executing.

- You can jump back to second stage bootloader whenever required during the execution of the main firmware

(Details of how to do it is mentioned in the KBA pointed in the previous post)

- So, in this case, since there is no re-enumeration in the final firmware, the second stage bootloader should supply the descriptors of the main firmware during it's enumeration.

2. The first parameter of CyFx3BootUsbStart is CyFalse:

- In this case there will be re-enumeration when the final firmware starts executing.

So, in this case, the bootloader need not have the same descriptors as the final firmware.

- Jump to second stage bootloader during final firmware execution is also not possoible.

Hope this is clear.

Having, said the same, if you intend to use CyFalse in your second stage bootloader, then please let us know what problem you are facing?

Regards,

Anil Srinivas.

View solution in original post

0 Likes
5 Replies
alamandaa_16
Moderator
Moderator
Moderator
10 likes received First like received

Hi Ricky Thomson,

Please go through the below link which specks about working of second stage bootloader.

"Working of Second Stage Bootloader in FX3™ - KBA90266 "

Best Regards,

Anil Srinivas.

0 Likes
Anonymous
Not applicable

Hey Anil,

I've been through that document when initially setting up my FX3 firmware. I did find it a bit confusing where it says "Therefore, the bootloader must have the same descriptors as the main firmware.". Does this imply that my main firmware and my 2nd stage bootloader firmware must have the same descriptors (VID, PID, Manufacturer, Product)? If this is the case then my device would then be recognised as a bootloader device, rather than a streamer application device.

Kind Regards

0 Likes

Hi,

The ways of using the second stage bootloader:

1. The first parameter of CyFx3BootUsbStart is CyTrue:

- In this case there won't be re-enumeration when the final firmware starts executing.

- You can jump back to second stage bootloader whenever required during the execution of the main firmware

(Details of how to do it is mentioned in the KBA pointed in the previous post)

- So, in this case, since there is no re-enumeration in the final firmware, the second stage bootloader should supply the descriptors of the main firmware during it's enumeration.

2. The first parameter of CyFx3BootUsbStart is CyFalse:

- In this case there will be re-enumeration when the final firmware starts executing.

So, in this case, the bootloader need not have the same descriptors as the final firmware.

- Jump to second stage bootloader during final firmware execution is also not possoible.

Hope this is clear.

Having, said the same, if you intend to use CyFalse in your second stage bootloader, then please let us know what problem you are facing?

Regards,

Anil Srinivas.

0 Likes
Anonymous
Not applicable

Hey Anil,

Thanks for the reply. So my design is using option number 2 that you mentioned above. My problem occurs when loading my main firmware onto the fx3, whilst my 2nd stage bootloader is running (through the Cy Control Centre). Most of the time, the programming of the ram works correctly and re-enumeration occurs. However about 1/4 attempts to program the RAM will yield a "Programming Failed" result in the Cy Control Centre.

Thanks for clarifying the descriptor confusion.

Cheers

0 Likes
Anonymous
Not applicable

I might also add, that it doesn't seem to be a hardware issue or a problem with my final firmware. As I've connected Jumper J$, so that the Fx3 loads the default bootloader. Then I can continue to load my main firmware into ram, with 100% success rate.

0 Likes