Using SWD pin as as conventional IO?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-08 2:55 PM
Posted on April 08, 2016 at 23:55
Can I, used SWD pin, for example on STM32F0, as SWD
when debugging
and flashing MCU and as little used IO ,during normal
operation
? If yes, how?
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-08 3:26 PM
Posted on April 09, 2016 at 00:26
In principle, yes, you should be able to.
Without knowing your MCU it's hard to be too specific, but in general the pins used for SWD/JTAG default to AF mode on, AF ID 0. In firmware, you can disable AF mode in the GPIO configuration for those pins using the Mode register. They will then function as normal GPIO. You would need some way to detect the requirement to change from SWD to GPIO mode and/or vice versa, perhaps a button or switch on a different pin.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-08 3:45 PM
Posted on April 09, 2016 at 00:45
You can just reconfigure the pins. Use them for functions you can easily live without while debugging or single stepping, or use other debugging techniques.
The pins would be ideal for LEDs for example, which would not interfere with debug operation in the finished design. The BOOT pin should be usable to stop your code from actually running, and permit download, etc.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
