2016-03-01 04:39 AM
Hi,
My problem is this, i have a product that have in the pages 0-3 a bootloader, and the RDP is state ON to protect my code, then the application code (120KB). All works fine and with this bootloader i can change the applicacion code without problems. But now i need to change the bootloader with the only code that i can, this is from the application code, but i read a PDF that when RDP is ON the page 0-3 is protected to write and if a try to change the RDP to unprotect the pages this generate a mass erase and need to reset to take effect the RDP OFF to program the pages 0-3 but i dont have code to execute when return from the reset and the equipment will be lost. The equipments are on the customers because of that they have to be send to my to program again all, the bootloader and the application code. Any suggestion about that. thanks Diego #stm32-rdp-read-protection2016-03-01 11:34 PM
Dear turconi.diego,
RDP never stops your internal code to read/write flash. So even if the RDP is ON you easily can update your bootloader. For this you dont need to alter the RDP./*Please
mark helpfull
if this post helps you or solves your problem.*/
/* If you need any personal support for your work please contact at
embeddeddesign.help@gmail.com*/
2016-03-02 03:34 AM
Hi kk for the answer,
But if you read the pdf's file CD00246875.pdf page 17-18 you will see that.Read protection
The read protection is activated by setting the RDP option byte and then, by applying a
system reset to reload the new RDP option byte.
Note: If the read protection is set while the debugger is still connected through JTAG/SWD, apply a
POR (power-on reset) instead of a system reset (without debugger connection).
Once the protection byte has been programmed:
â—� Main Flash memory read access is not allowed except for the user code (when booting
from main Flash memory itself with the debug mode not active).
â—�
Pages 0-3 (for low- and medium-density value line devices), or pages 0-1 (for highdensity
value line devices) are automatically write-protected. The rest of the memory
can be programmed by the code executed from the main Flash memory (for IAP,
constant storage, etc.), but it is protected against write/erase (but not against mass
erase) in debug mode or when booting from the embedded SRAM.
â—� All features linked to loading code into and executing code from the embedded SRAM
are still active (JTAG/SWD and boot from embedded SRAM) and this can be used to
disable the read protection. When the read protection option byte is altered to a
memory-unprotect value, a mass erase is performed.
â—� When booting from embedded SRAM, Flash memory access through the code and
through data read using DMA1 and DMA2 are not allowed.
â—� Flash memory access through data read using JTAG, SWV (serial wire viewer), SWD
(serial wire debug), ETM and boundary scan are not allowed.
The Flash memory is protected when the RDP option byte and its complement contain the
pair of values shown in Table 4.
And this is that happen to me when i try to change the content of this pages. I can erase the code within this pages but can't write this again until make a power-on reset.
Thanks Diego
2016-03-02 10:22 PM
Dear turconi.diego,
In this case you need to keep 2 different Bootloaders. One basic in (0-4KB write protected area) and you will never change it. Second in area above0-4KB, whicj you can easily update./*Please
mark helpfull
if this post helps you or solves your problem.*/
/* If you need any personal support for your work please contact at
embeddeddesign.help@gmail.com*/