2020-03-03 03:48 AM
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
2020-03-06 02:52 AM
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.
2020-06-11 02:45 PM
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!!