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

PSoC™ 5, 3 & 1 Forum Discussions

alro_2373731
Level 1
Level 1

I have a long wait period setup in the configuration and I would like to skip it if I dont have a new firmware to write. Is there an i2c command I can issue to start it?  I was looking in the Bootloader_PVT header and I didn't see anything straight forward.

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator 250 solutions authored 100 solutions authored 50 solutions authored
Moderator

Hello Alex,

On device reset, the bootloader can wait for a command from the bootloader host specified by the wait time. When you want to skip the wait time; validate the available bootloadable application, upon success schedule the bootloadable image and perform a software reset. The appended code monitors a Pin to switch between bootloader and bootloadable. Similarly, you may monitor the I2C channel for a user command.

int main()

{

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    CyGlobalIntEnable;

    if(Pin_Read()==0)

    {

        /* Start bootloader communication. This will wait for bootloading as configured by Wait for command*/

        Bootloader_Start();

    }

    else

    {

       

        /* Validate and schedule bootloadable. Perform software reset*/

        if(CYRET_SUCCESS == Bootloader_ValidateBootloadable(Bootloader_activeApp))

            {

                Bootloader_SET_RUN_TYPE(Bootloader_SCHEDULE_BTLDB);

                CySoftwareReset();

            }

     

    }

 

    for(;;)

    {

        /* Place your application code here. */

    }

}

Best Regards,

Geona Mary

View solution in original post

0 Likes
1 Reply
GeonaP_26
Moderator
Moderator 250 solutions authored 100 solutions authored 50 solutions authored
Moderator

Hello Alex,

On device reset, the bootloader can wait for a command from the bootloader host specified by the wait time. When you want to skip the wait time; validate the available bootloadable application, upon success schedule the bootloadable image and perform a software reset. The appended code monitors a Pin to switch between bootloader and bootloadable. Similarly, you may monitor the I2C channel for a user command.

int main()

{

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    CyGlobalIntEnable;

    if(Pin_Read()==0)

    {

        /* Start bootloader communication. This will wait for bootloading as configured by Wait for command*/

        Bootloader_Start();

    }

    else

    {

       

        /* Validate and schedule bootloadable. Perform software reset*/

        if(CYRET_SUCCESS == Bootloader_ValidateBootloadable(Bootloader_activeApp))

            {

                Bootloader_SET_RUN_TYPE(Bootloader_SCHEDULE_BTLDB);

                CySoftwareReset();

            }

     

    }

 

    for(;;)

    {

        /* Place your application code here. */

    }

}

Best Regards,

Geona Mary

0 Likes