SWD pins set to GPIO output pins.

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

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

I set the SWD pins to GPIOs on the System of Design Wide Resources(DWR).

And I set the GPIOs as output.

 I would like to continue to change the program as SWD.

Is it possible to program from SWD regardless of whether the GPIOs output are ‘0’ output or ‘1’ output?

Best regards,

Yocchi

.

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @YoIs_1298666 ,

Yes, you will still be able to acquire and program the device even if Debug Select is set to GPIO. The state of the GPIO doesn't matter. You won't be able to debug the program though.

Refer to this KBA for additional information.

Regards,
Dheeraj

View solution in original post

0 Likes
4 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @YoIs_1298666 ,

Yes, you will still be able to acquire and program the device even if Debug Select is set to GPIO. The state of the GPIO doesn't matter. You won't be able to debug the program though.

Refer to this KBA for additional information.

Regards,
Dheeraj

0 Likes

Hello Dheeraj-san,

Thank you very much for your reply.

Does that mean that M0 + / M0 in the figure below is deciding whether to switch to SWD while executing the boot code?

YoIs_1298666_0-1622616168073.png

Best regards,

Yocchi

 

 

0 Likes

Hello @YoIs_1298666 ,

The pins are configured as SWJ pins as part of the boot code. After the boot sequence, the CPU waits for 400us for the correct sequence of SWD commands. If sent, the CPU enters test mode where you can program the device. If not it enters the user code.

If the debug select is set to GPIO, the SWJ pins are configured as GPIO as part of the startup just before the main is executed. Please check the function cyfitter_cfg() in cyfitter_cfg.c file. 

For example, if the Debug Select is set as GPIO, the SWD pins (P3.2 and P3.3 in PSoC4100S for example) are set to GPIO using the HSIOM as shown below:

DheerajK_81_0-1623425198364.png

However, if you set Debug Select to SWD, then you will notice the functionality being set to SWD using the HSIOM as shown below:

DheerajK_81_1-1623425300949.png

Please see the Device datasheet and Register TRM of your device for more information.

Hope this answers your query 🙂

Regards,
Dheeraj

 

0 Likes

Hello Dheeraj-san,

Thank you very much!

Best regards,

Yocchi

0 Likes