10 Replies Latest reply on Dec 1, 2015 6:25 AM by user_1377889

    Serious bug in bootloader component.

    user_189995688

      I'm telling you. If I didn't have to support existing products out there in the field (thousands of them), I would have moved far away from PSoC 5/5LP many years ago. Working around bugs in Cypress components that should have been caught by the most basic of in-house testing at Cypress has cost me many thousands in lost productivity and visits to customer sites.

         

      **EDITED to add critical information**

         

      Here's another serious bug, it's in the latest bootloader component. V1.30

         

      If your main (bootloadable) app uses the flash for persistent storage, using the Emulated EEPROM component. This is perfectly legitimate, but you MUST switch off the "Bootloader application validation" flag in the bootloader component in the bootloader app. So far, so good. This is all perfectly normal. You need to turn off that flag becuase otherwise your app fails validation because the contents of FLASH have changed and checksum is no longer valid.

         

      Except there is a serious bug in the bootloader component, when running on PSoC 5LP. It pans out like this:

         

      The generated code for the bootloader component contains lots of blocks that are not compiled if the "Bootloader Application validation" flag is not set.

         

      So the first bit of code to get executed is:

         
          

      cystatus validApp = CYRET_BAD_DATA;

         
         

      Then lots of code gets skipped because you are not using Dual Apps, and not using App Validation.

         

      But when it skips code because you are not using Daul Apps - it then does this:

         

      Bootloader_1_ValidateBootloadable(...);

         

      Which it should NOT do because the validate bootloadable flag is not set!! This leaves validApp set to CYRET_BAD_DATA

         

      The next piece of code is:

         
          

      if ((Bootloader_1_GET_RUN_TYPE == Bootloader_1_START_BTLDR) || (CYRET_SUCCESS != validApp))

          

      {

          

      Bootloader_1_SET_RUN_TYPE(0u);

          

      Bootloader_1_HostLink(Bootloader_1_WAIT_FOR_COMMAND_FOREVER);

          

      }

         
         

       

         

      So, even if you have a valid app loaded in flash, and you are not using app validation,  the bootloader will now wait forever because CYRET_SUCCESS != validApp.

         

       

         

      The upshot of all this, is that when you use bootloader component 1.3 and switch off Bootloader Application Verification, then use Emulated EEPROM to store data in flash, your system will enter the bootloader and wait forever for bootloader commands, instead of waiting for the specified time and then loading your app.