Skip to main content
Mikkel Bandholm
Associate
October 22, 2019
Question

Updating our own bootloader when the read out protection is set. Is it possible somhow to clear the Read out protection and then write a new bootloader from eiter our main firmware or maby a application in ram?

  • October 22, 2019
  • 3 replies
  • 1427 views

The processor is a STM32F107RB. We dont have the possiblilty to update it via jtag.

This topic has been closed for replies.

3 replies

TDK
October 22, 2019

It’s possible but not easy. You could run your code from SRAM to erase the flash and write a new bootloader. Make sure the code you run in SRAM doesn't try to access any variables in flash. The limited amount of SRAM could be an issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Mikkel Bandholm
Associate
October 22, 2019

It have just made a test and write the flash from sram, but it seems that i'm not able to write to the flash after i clear the read out protection. i just end up with a empty flash then.

TDK
October 22, 2019
Can you use the same method to write to flash if RDP is not enabled?
"If you feel a post has answered your question, please click ""Accept as Solution""."
Mikkel Bandholm
Associate
October 22, 2019

Yes then it works

berendi
Principal
October 22, 2019

Changing the readout protection level takes effect at the next system reset. So you have to load the reflashing code complete with vector table (a minimalist one would do if not using interrupts) in SRAM, and pull both BOOT0 and BOOT1 high while resetting the system to have it started.

Mikkel Bandholm
Associate
October 23, 2019

I have no posibility to manipulate the bootpins so i might not have any posibilitiese to change the bootloader then.