cancel
Showing results for 
Search instead for 
Did you mean: 

SWIM ICP programming on STM8L050j3

MGuer.1
Associate

Hello,

I'm trying to program and STM8L050J3 from another MCU through ICP programming on the SWIM interface. Section 5.6.1 of PM0051 presents a sequence where it is required to apply a reset and release it after the SWIM_CSR register hase been configured. However, the STM8 device I'm using has no RESET line available. And when I try to program the SWIM_CSR with 0xA0 (without applying the reset), I always readback 0x40.

What is the ICP sequence for this kind of devices? Could it be that missing to apply reset is not allowing me to write the proper value on SWIM_CSR?

Thanks

2 REPLIES 2
Philipp Krause
Senior II

ICP should work, even without reset, as long as you don't use the SWIM pin for other purposes.

The recommended solution if you do need the SWIM pin for other purposes is: Do not configure the SWIM pin for a few seconds after boot. Then during that time, the device can still be programmed.

RKong.1
Associate II

That's interesting to know; I had assumed that the RESET line needed to be asserted before the entry sequence is initiated but then it this were true, one would not be able to use SWIM as a debugger!!