5 Replies Latest reply on Oct 25, 2015 8:14 AM by user_1377889

    SWD as GPIO and J-LNK

    user_399270343

      Hi, While trying to test hibernation of Psoc5LP (cy8c5868axi-032LP) to minimize power consumption I have lost the device. This means J-LINK is unable to detect the device over SWD. I configured the SWD pins as GPIO as suggested by power management in order to obtain lowest possible power consumption. The SWD port shoult be possible waken up after reset and the GPIO pins will be SWD again. But I fail to access the SWD port with J-LINK programmer.

         

      I wonder if there is some trick that the programmer must do and the J-LINK does not do that. Any experience?

         

      I attached the project that will brick the device for me in order you can see maybe there is something else wrong too. I have carefully verified the bricking flag of firmware protection.

        • 1. Re: SWD as GPIO and J-LNK
          user_1377889

          Welcome in the forum, Spets

             

          The SWD - debugging capabilities draw remarkable current, so to measure the consumption of your chip you have to set the SWD pins to GPIO which cancels debugging. Not only the SWD pins are affected, but there are additional CPU structures that allow for debugging which are power-controlled.

             

          So: either debugging or measuring power consumption.

             

          I remember to have red that debugging does not work with deep-sleep mode, but I cannot remember if that was specific to PSoC4/4 or not.

             

           

             

          Bob

          • 2. Re: SWD as GPIO and J-LNK
            user_399270343

            Hi Bob !  Thank you for reply. Do you happen to know the sequence that has to be sent from debugger in order to turn the SWD back online. I have turned the SWD to GPIO and I have now 2 MCU-s that I can not reprogram anymore. Seems that J-LINK does not perform this sequence automatically. Maybe I will manage to write a script that will do the keying. Also, it is kind of hidden knowledge: all specs do mention the sequence, but the sequence is not specified.

            • 3. Re: SWD as GPIO and J-LNK
              user_1377889

              The SWD settings has nothing to do with programming the chip. There is a sequence shortly after reset or power-up where a programmer can gain control. The setting of the SWD/GPIO pins is done during the programming cycle. When your chip is not seen by your system try a complete reset (PC, programming hardware etc). Specs for the programming are shown in the resp. app notes.

                 

               

                 

              Bob

              • 4. Re: SWD as GPIO and J-LNK
                user_399270343

                Hi Bob ! Thanks for your help. I have found that J-Link's SEGGER J-Link Commander V4.96 will perform the initialisation when specifying the following at command line:

                   

                JLinkExe -if SWD -device cy8c5868xxxlp

                   

                Also I know that the commander v4.94 was not successful. The latest commander 5.02 will also succeed.

                • 5. Re: SWD as GPIO and J-LNK
                  user_1377889

                  Glad to see you got it running!

                     

                   

                     

                  Bob