5 Replies Latest reply on Jan 21, 2019 10:02 PM by ShifangZ_26

    CCG3 I2C bootloader boot delay


      I am using the CCG3 CYPD3125 with a firmware based on the notebook example on SDK v3.2.1. There is a long boot delay, about 1 second, for the bootloader to jump to the application firmware. This is causing me some problems in the way my firmware works.


      I have opened the I2C bootloader project and I found that it has a wait timeout before loading the application firmware. The timeout is set by the function boot_set_wait_timeout, in boot.c. This function seems to always return a 1 second delay, from the following line, if the boot_app_id is not a special value:

      gl_boot_wait_delay = GET_MAX (CCG_BL_WAIT_MAXIMUM, GET_MIN (CCG_BL_WAIT_MINUMUM, md_p->boot_app_id));

      The wait delay is always CCG_BL_WAIT_MAXIMUM, therefore 1000ms. This was probably not the intention. GET_MAX and GET_MIN seems to be inverted.


      I was able to bypass this line by setting the boot_app_id to CCG_FWMETA_APPID_WAIT_DEF (0xFFFF), which use the default delay of 50ms. This is done by setting the Application ID of the bootloadable component in the application firmware.


      I could also set the boot_app_id value to CCG_FWMETA_APPID_WAIT_0 to eliminate the boot delay completely, but with a delay of 0, it seems to skip bootloader flash access boundaries protection.


      Is this method valid to reduce the boot delay of the application firmware?