1 Reply Latest reply on Nov 19, 2020 11:16 PM by DheerajK_81

    PSoC Programmer: CPU stopped at wrong address (0x10002958).

    user_4814686

      Hi,

       

      After modifying the TOC2 registers to disable the SWJ pins at startup, I have been unable to "Erase all Flash" using PSoC Programmer. When trying to erase, I get a "CPU stopped at wrong address" error message .

       

      How can I prevent this? Furthermore, what is the recommended process to unlock the SWJ pins once they have been locked using the SWJ_PINS_CTL register?

       

      Thank you,

      Xavier

        • 1. Re: PSoC Programmer: CPU stopped at wrong address (0x10002958).
          DheerajK_81

          Hello Xavier,

           

          After power on or hardware reset, the SWJ pins are not active. They are activated at the very end of boot code execution, unless prohibited by the TOC2_Flags register. The timeline looks like this:

           

          Hence, since you disabled the SWJ pins by writing to the TOC2 register, when you reset the device, the pins won't be configured as SWJ anymore and you won't be able to enter test mode. Test mode is required for performing any operations like erase or program. This is why erase operation is failing.

           

          To unlock the DAP, the user application must toggle the SWJ_PINS_CTL value and also update the TOC2 checksum as well. You only asked about disabling the DAP in your earlier interaction, so I think you did not do this step.

           

          If you haven't written any application code to unlock the DAP, you have no way to reprogram the device using SWJ. The device on reset, will skip test mode and proceed to execute the user application.

           

          For more information please refer:

          PSoC6 Programming Specification
          PSoC6 Architecture TRM

           

          Regards,

          Dheeraj