6 Replies Latest reply on Jul 16, 2018 10:27 AM by udo.preussner

    Corrupt Flash Data

    udo.preussner

      Hi All

      we use a PSoC4 BLE Module in a simple BLE application. We have installed a uart-bootloader component, which communicates with a host uC, to update firmware in the field.

      In the application-hardware we have different suplies for the host and the BLE. The voltage rising of both supplies may sometimes not proper, but the internal brow-out circuit should prevent any corruption of flash data in such cases.

      Now we have the phenomenon that in really rare cases one data-row is damaged. It is always the configaration-row in the top area of the flash memory.

      Does anyone have a smiliar experience or an idea what can be wrong?

       

      Thanks!

        • 2. Re: Corrupt Flash Data
          udo.preussner

          Dear Geona,

           

          thank you very much for the Link,

          We use a bootloader with a UART component as communication channel, so in my project a "Launcher.c" is not generated.

          Where can I find the code instead ?

           

          Best Regards

          Udo

          • 3. Re: Corrupt Flash Data
            geon

            Hello Udo,

             

            Could you please share the project?

             

            Best Regards,

            Geona Mary

            • 4. Re: Corrupt Flash Data
              udo.preussner

              Hello Geona,

               

              please find attached the bootloader project.

               

              Thanks and best Regards

              Udo

              • 5. Re: Corrupt Flash Data
                geon

                Hello Udo,

                 

                Thank you for sharing the bootloader project.

                 

                (1) Please probe VDDD, XRES untill observing the issue and confirm whether there is any glitch/abnormality.

                (2) At which stage are you observing the metadata corruption? (in bootloader, while bootloading, in bootloadable, during first run of application, while toggling power/reset continously etc.,)

                (3) Remove watch dog resets if enabled in your projects. The device should not be reset during flashwrites which can take as much as 20 mS.

                (4) If step 3 does not help, please replace the Bootloader_Exit in your bootloader project with

                         Bootloader_SET_RUN_TYPE(Bootloader_SCHEDULE_BTLDB);

                          CySoftwareReset();

                      This does not involve flash writes but will have almost the same result.

                 

                Best Regards,

                Geona Mary

                • 6. Re: Corrupt Flash Data
                  udo.preussner

                  @

                  Hello Geona,

                   

                  thank you for your reply.

                  We are actually trying to record the Signals VDD and XRES in the case the BT-chip will not start anymore.

                  So the hardware runs in a continous power-on-off cycle and a uC-test-pin is used for triggering.

                   

                  I think that the metadata corruption is coused by the bootloader during start-up or powering down (brown out?).

                  In the apllication there is no code for writing to flash and the app is flashed using the bootloader only one time at production.

                   

                  Do I understand the Bootloader_Exit function in the right way that the Byte-Flash-Write is done after checking the validation

                  and immediately before starting the app?

                  If the app ist started with corrupted metadata (app will not run at the next start), this will give us the possibillity to repair the metadata-row

                  by storing the data in the host and transferring it to the PSoC via UART.

                   

                  The problem we have is that the electronic units are allready produced and potted by an epoxy material.

                  Unfortunately we have the bootloader flash sections fully protected, so there no way to change the bootloader by the app.

                  We can test a modified bootloder, if it will be an alternative in the future.

                   

                  I have attached the schematic, maybe this is helpfull.

                   

                  Thanks and best Regards

                  Udo