How to develope FX3 2-stage bootloader?

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

cross mob
xixu_4093676
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

We are planing to develope our 2-stage bootloader

the function feature is following :

1. the Fx3BootAppGcc check whether there are one valid app img on the I2C EEPROM(assumed the app img locate at eeprom address 0x8000)

2. if the app img is Ok,2-stage bootloader  will boot the app img

3. if the app img been damaged, the 2-stage bootloader download new app img by usb and write to eeprom.

So I 'm reviewing the following code usb_boot.c in the Fx3BootAppGcc to try to how to get the img data by usb ep0.

My question is : the  Fx3BootAppGcc only support download the img data to ITCM Memory region(CY_FX3_BOOT_ITCM_BASE to CY_FX3_BOOT_ITCM_END)?

Also, Are there one windows tools that can be used with this example(Fx3BootAppGcc) to download the app img ?

if ((address + gEP0.wLen) <= CY_FX3_BOOT_ITCM_END)

            {

                /* Avoid writing to the interrupt table. */

                if (address < 0xFF) {

                    gEP0.pData += 0xFF-address;

                    gEP0.wLen -= 0xFF-address;

                    address = 0xFF;

                }

                CyFx3BootMemCopy((uint8_t *)address, gEP0.pData, gEP0.wLen);

            }

void

myVendorCmdHandler (

        void

        )

{

....

else if (stage == eDataOut)
        {
            status = CyFx3BootUsbDmaXferData (0x00, (uint32_t)gEP0.pData, gEP0.wLen, CY_FX3_BOOT_WAIT_FOREVER);
            if (status != CY_FX3_BOOT_SUCCESS)
            {
                /* USB DMA Transfer failed. Stall the Endpoint. */
                CyFx3BootUsbStall (0, CyTrue, CyFalse);
                return;
            }

            /* Validate ITCM Memory */
            if ((address + gEP0.wLen) <= CY_FX3_BOOT_ITCM_END)
            {
                /* Avoid writing to the interrupt table. */
                if (address < 0xFF) {
                    gEP0.pData += 0xFF-address;
                    gEP0.wLen -= 0xFF-address;
                    address = 0xFF;
                }
                CyFx3BootMemCopy((uint8_t *)address, gEP0.pData, gEP0.wLen);
            }
        }

....

}

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

Please look at the below document and check if it suits your requirement.

FX3 Fail Safe Firmware Update

Best regards,

Srinath S

View solution in original post

0 Likes
1 Reply
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

Please look at the below document and check if it suits your requirement.

FX3 Fail Safe Firmware Update

Best regards,

Srinath S

0 Likes