dmitrystu / sboot_stm32

Secure USB DFU1.1 bootloader for STM32
Apache License 2.0
303 stars 63 forks source link

Clear FLASH_SR in stm32f0xx.S #45

Closed alexispolti closed 2 years ago

alexispolti commented 2 years ago

I might be wrong but I have some doubts about the way to clear the FLASH_SR in mcu/stm32f00x.S. Current code is (line 397)

/* clear FLASH_SR */
    movs    r4, 0x64
    str     r4, [r3, FLASH_SR]

But looking at stm32f072v8 and stm32f0x1stm32f0x2stm32f0x8 reference manuals, the correct value to write should be 0x34 (or 0x14) if I'm not mistaken. Did I miss something?

dmitrystu commented 2 years ago

Yes, you are right. It must be a copypaste. Anyway, it will clear at least EOP and PGERR, but must be fixed.