AnsweredAssumed Answered

Problem with flash programming (SWIM) and memory protection

Question asked by s.mats on Nov 27, 2016
Latest reply on Nov 29, 2016 by s.mats
Hi!
I'm trying to implement a SWIM programmer using only the datasheets, for an STM8S003F3.
I have got the basics working (swim entry, rotf, wotf, srst). An I've been trying to figure out how to actually program the flash.
I can write MASS key to FLASH_PUKR and can verify that PUL is set.
I can verify FLASH_FPR is unset.

As far as I can tell, issuing wotf commands to the flash memory region (0x8000-0x9FFF) should be all that is required, but doing so only sets WR_PG_DIS in FLASH_IASPR, indicating that memory is protected. What am I missing here?

Thanks in advance!
//Mats


Outcomes