3 Replies Latest reply on Mar 21, 2020 1:07 AM by DheerajK_81

    PSoC6 Programmer COM API PSoC6_WriteProtection() corrupts SFLASH if aborted

    JeHu_3414236

      I am writing the protection state using PSoC6_WriteProtection() and I will see this warning:

      psocwarning.png

       

      If I choose Cancel, the next time I try to write protection state on the same chip, I get this error:

      GenerateHASH API returned: Error code 0xF0000020: Table of contents 2 (TOC2) CRC check failed or /and magic number is not present.

       

      Is cancelling the operation changing some SFLASH values?  I erase the SFLASH with PSoC Programmer and it still gives this error.  How do I avoid this problem if I cancel the write protection?

        • 1. Re: PSoC6 Programmer COM API PSoC6_WriteProtection() corrupts SFLASH if aborted
          DheerajK_81

          The warning is displayed in PSoC Programmer when you try to program EFuse bits. If you click "Cancel", the EFuse bits are not set. You can do an erase after this to get the lifecycle and protection states and you will notice they are in Normal stage.

          protect.png

           

          After this I proceeded with "OK" and I was able to change lifecycle stage successfully as shown below:

          protect1.png

           

          So it works for me and I wasn't able to reproduce your error. Can you tell me the detailed steps to reproduce this? Basically when are you switching between using PSoC Programmer and PPCLI scripts?

           

          Looking forward to your reply

           

          Regards,

          Dheeraj

          1 of 1 people found this helpful
          • 2. Re: PSoC6 Programmer COM API PSoC6_WriteProtection() corrupts SFLASH if aborted
            JeHu_3414236

            The problem is intermittent.  I tried doing DAP_Acquire, PSoC6_WriteProtection, DAP_ReleaseChip repeatedly on the same chip and cancelling each time and sometimes it is ok and sometimes gives the 0xF0000020 error.  I don't use PSoC Programmer or erase SFlash.  I don't think it is a hardware problem because I try programming a bootloader instead of calling PSoC6_WriteProtection and it never fails.

            • 3. Re: PSoC6 Programmer COM API PSoC6_WriteProtection() corrupts SFLASH if aborted
              DheerajK_81

              I'm not sure if you have used the right sequence of commands. Note that to blow the EFuse you need 2.5V. Hope you are powering the target device at 2.5V.

               

              Please find attached the PPCLI script I used for testing. Just modify it to add your Miniprog3 serial number. When I ran the test three times, I am wasn't able to reproduce your issue. Anything I'm missing?

               

              To run the attached script just run the command

              ppcli "--runfile writeprotection.cli"

               

              I'm using the latest PSoC Programmer 3.38.6. If you are on the previous version, can you please try upgrading to the latest version and then trying?

               

              Regards,

              Dheeraj