cancel
Showing results for 
Search instead for 
Did you mean: 

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?

Mikkel Bandholm
Associate II

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

6 REPLIES 6
TDK
Guru

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 II

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.

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".

Yes then it works

berendi
Principal

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.

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