PSoC6 SWD reset/acquire issues, works with MiniProg/PSoC programmer, but not with daplink/pyocd

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

cross mob
DaEr_349131
Level 5
Level 5
25 likes received 50 sign-ins 5 comments on KBA

I'm using a PSoC6 where SWDCLK and SWDIO is used as GPIO's in its application mode
so once flashed with an app that disables SWD, its tricky to aquire the target to debug, erase and reflash...

If I use a MiniProg4 + PSoC programmer, Programming mode "Reset", I can erase the target

but if I use a segger, or daplink probe with 'pyocd -M pre-reset' it doesn't manage to aquire the target.

 

anyone here that can explain the timings of how miniprog can do this successfully.
i.e. does it keep holding XRES on the psoc while it starts the SWD communication?

0 Likes
1 Solution
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @DaEr_349131 

This issue looks similar to what is mentioned in the discussion: SWD as GPIO and J-LNK 

Can you try using JLINK Commander as mentioned in this thread and see if the device can be acquired?
Meanwhile, I will also try to do the same at my end.

As mentioned by you, yes there is a very strict timing where you need to acquire the device.

PSoC 6 MCU is put into Test mode (or Programming mode). This is a
special mode in which the CPU is controlled by the external programmer, which can also access other system
resources such as SRAM and registers. The main purpose of this step is to prevent the execution of the user’s code from the application flash region. After the user’s code starts, it can repurpose the SWJ pins [3]
(use them as GPIO), so the external debugger will not be able to communicate with the device.

You can refer to the Port acquire section of the PSoC 6 programming specification for more details on this: https://www.infineon.com/dgdl/Infineon-PSoC_6_Programming_Specifications-Programming%20Specification...

 


Thanks and Regards
Ekta

View solution in original post

0 Likes
1 Reply
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @DaEr_349131 

This issue looks similar to what is mentioned in the discussion: SWD as GPIO and J-LNK 

Can you try using JLINK Commander as mentioned in this thread and see if the device can be acquired?
Meanwhile, I will also try to do the same at my end.

As mentioned by you, yes there is a very strict timing where you need to acquire the device.

PSoC 6 MCU is put into Test mode (or Programming mode). This is a
special mode in which the CPU is controlled by the external programmer, which can also access other system
resources such as SRAM and registers. The main purpose of this step is to prevent the execution of the user’s code from the application flash region. After the user’s code starts, it can repurpose the SWJ pins [3]
(use them as GPIO), so the external debugger will not be able to communicate with the device.

You can refer to the Port acquire section of the PSoC 6 programming specification for more details on this: https://www.infineon.com/dgdl/Infineon-PSoC_6_Programming_Specifications-Programming%20Specification...

 


Thanks and Regards
Ekta

0 Likes