- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone. I have written a code which uses SWD pins as GPIO, but the code does not work. My question is that Can we use SWD protocol pins (clock and data) which is dedicated for debug purposes as GPIO? If Yes, What is the related setting for using those pins as GPIO in the code?
Thanks for your time.
Solved! Go to Solution.
- Labels:
-
XMC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mrnoone,
SWD pins may be used as general purpose IOs, but this change has to be done only after you program your device. Are you following this flow?
You may use the XMC_GPIO_Init() API to initialize the SWD pin as GPIO.
It should be noted that debug functionality cannot be used when SWD lines are configured as GPIOs.
Regards,
Nikhil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mrnoone,
SWD pins may be used as general purpose IOs, but this change has to be done only after you program your device. Are you following this flow?
You may use the XMC_GPIO_Init() API to initialize the SWD pin as GPIO.
It should be noted that debug functionality cannot be used when SWD lines are configured as GPIOs.
Regards,
Nikhil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @ncbs for the answer. Yes, it is obvious that it should be after finishing SWD programming.
I have used the following code to init swd pins as gpio:
static XMC_GPIO_CONFIG_t swd_port_output_config =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL,
.input_hysteresis = XMC_GPIO_INPUT_HYSTERESIS_STANDARD,
.output_level = XMC_GPIO_OUTPUT_LEVEL_LOW,
};
XMC_GPIO_Init(P0_14, &swd_port_output_config);
XMC_GPIO_Init(P0_15, &swd_port_output_config);
but it does not work and I do not know what is the problem!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This discussion is continued in the following thread: https://community.infineon.com/t5/XMC/Configuring-SWD-pins-as-general-purpose-outputs-in-XMC1202/td-...
Regards,
Nikhil