- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
.
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Best regards,
Yocchi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
However, if you set Debug Select to SWD, then you will notice the functionality being set to SWD using the HSIOM as shown below:
Please see the Device datasheet and Register TRM of your device for more information.
Hope this answers your query 🙂
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Dheeraj-san,
Thank you very much!
Best regards,
Yocchi