SWD as GPIO and J-LNK

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
PeVo_1249246
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

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.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

View solution in original post

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
PeVo_1249246
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

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.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
PeVo_1249246
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

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.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Glad to see you got it running!

   

 

   

Bob

0 Likes