Skip to main content
Visitor II
March 3, 2020
Question

SWIM ICP programming on STM8L050j3

  • March 3, 2020
  • 2 replies
  • 767 views

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

    This topic has been closed for replies.

    2 replies

    Visitor II
    March 6, 2020

    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.

    Visitor II
    June 11, 2020

    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!!