Author Topic: STM8 SWIM pin as output/Debug  (Read 6307 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
STM8 SWIM pin as output/Debug
« 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
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: STM8 SWIM pin as output/Debug
« Reply #1 on: November 08, 2014, 11:15:16 am »
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.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: STM8 SWIM pin as output/Debug
« Reply #2 on: November 08, 2014, 01:53:57 pm »
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.
 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: STM8 SWIM pin as output/Debug
« Reply #3 on: November 19, 2014, 05:20:29 am »
I checked it & working.
But for now, in professional boards I won't use SWIM pin
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf