This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32 readout protection via uVision and Ulink

I'm trying to enable STM32 readout protection via Keil Ulink.
I defined a ROM1 area starting from 0x1FFFF800 up to 0x1FFFF80F.
I created a new c module containing two lines only:

#include <RTL.h>
const U32 optionByte[] = {0x00FF00FF};

I put optionByte[0] = optionByte[0] into main to force linker to include it.
I added the "STM32F10x Flash Options" into "Programming Algorithm".

I enabled the "Erase Sectors" option instead "Erase Full Chip" as suggested in http://www.keil.com/support/docs/3454.htm

If I burn the device, uVision told programming was done, but the device doesn't work. Obiuvsly, I cannot check why via JTAG, because the device is read protected.
If I disable the option programming, the device works.

I'd like to know if it's possible to enable the readout protection via Ulink under uVision.

Thanks,

Lorenzo

Parents
  • Flash readout protection is configured with the first 2 bytes only (RDP and negated RDP). Next two bytes are used for user configuration. So writing 4 bytes just to enable readout protection can already have side effects.

    Anyway I suggest you try out the reference example in MDK-ARM installation in folder Keil\ARM\Boards\Keil\MCBSTM32\Blinky which has a target "MCBSTM32 + OPT" that demonstrates how to use Flash options (in STM32F10xOPT.s).

Reply
  • Flash readout protection is configured with the first 2 bytes only (RDP and negated RDP). Next two bytes are used for user configuration. So writing 4 bytes just to enable readout protection can already have side effects.

    Anyway I suggest you try out the reference example in MDK-ARM installation in folder Keil\ARM\Boards\Keil\MCBSTM32\Blinky which has a target "MCBSTM32 + OPT" that demonstrates how to use Flash options (in STM32F10xOPT.s).

Children