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?
Solved! Go to Solution.
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?
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 🙂