EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: Vindhyachal.takniki on November 08, 2014, 10:37:17 am
-
1. I have STM8S003F3 & want to use its debug pin as output.
So I will configure it my code.
2. Will that make debug option dead?
On next power up, will I be able to debug the code?? Because pin will already be configured as output by that time
-
I haven't used 8bit swim but use the swd for the stm32 range. So I haven't read the datasheet.
you should be able to intercept the chip on boot to debug it.
but you will need to debug it without the pin being used as a gpio.
wrap the pins initialisation in
#ifndef debug
// set pin as output.
#endif
obviously while in debug mode you cant use this pin as normal gpio, but this way you can debug the rest of your code and hardware.
-
For SWIM debugging no, you need to continuously keep communicating to the device so you can not configure it during debugging as a hard output for instance.
For final product, it also is kinda tricky so I never do this but it should be possible.
The problem I encountered in the past was that the SWIM signal is high frequency (order of 10MHz) so for instance a small capacitance on that pin can already inhibit the use of SWIM programming/debugging.
So my advice is to breadboard your design first and do a lot of testing before putting it in a real product. For hobby purposes you can always make a jumper or small switch.
-
I checked it & working.
But for now, in professional boards I won't use SWIM pin