cancel
Showing results for 
Search instead for 
Did you mean: 

Read Out Protection Problem

kb24
Senior

Hi, I am using stm32f407vg. There is no read/write protection for sectors, there is only write protection option. 0693W000000VdujQAC.png

So I had to enable read out protection, when I change protection level 0 to 1, code doesnt work. It's not working for even led blink code. Should I do something before chancing protection level? I am just downloading code then changing protection level. When I change 1 to 0 and download same application, it works. What should I do? Thanks.

6 REPLIES 6

>>There is no read/write protection for sectors, there is only write protection option.

Correct, the F2/F4 design doesn't have selective read protection.

Read Out Protection is an array level control.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kb24
Senior

Yes I saw that but why application doesnt work when level is 1?

Danish1
Lead II

What do you mean "application doesn't work". There are many ways for it to not work; some that generate error or warning messages. Those messages might be hard to understand but they should contain clues as to what specifically is going wrong in your case.

You can't use the ST bootloader or JTAG to download to FLASH when code READOUT protection is set.

This is because

  1. there's no way to verify that the download = FLASH programming has succeeded if you're not allowed to read the FLASH
  2. Some people have devised tricks that involve writing to part of the FLASH in order to read the remainder of it. A way to prevent this line of attack is to prevent any writes to FLASH.

It is possible to download code to RAM and execute that code even when readout protection is set to level 1. But that code isn't allowed to read the FLASH.

Of course I am not trying to download when Read Out Protection level is 1. When protection level is 0 I download the code and see led is blinking, UART is sending messages, then I only change protection level, nothing else. Same code should work but after I change protection level 0 to 1 from STM32 ST-LINK Utility, led is not blinking and UART is not sending anything. What I meant was that.

Try some very simple program first, only blinking LED and NOTHING else.

JW

I tried, it is just blinking. 0693W000000VgPoQAK.jpg

Then I changed protection level.

0693W000000VgQ3QAK.png

And nothing is working.

0693W000000VgQNQA0.jpg

Couple of weeks ago, I touched to on board debugger and static killed it, I cant use that debugger anymore so I am using external debugger. Maybe static also damaged MCU, is it possible? It may be nonsense because without read out protection everything is working fine.