cancel
Showing results for 
Search instead for 
Did you mean: 

RDP settings to disable main memory read

Hello there,

I am trying to find the right RDP config for the STM32G0 MCU. My aim is the following functionality:

  • User code can read/ write the flash,
  • Bootloader/ external SWD debugger cannot read the flash,
  • Bootloader/ external SWD debugger can erase and write the flash.

Does such configuration exist? I am trying to find the right config for production mode, in which it will be not possible for anyone to read the flash contents (erase and write is ok).

This table from the RM0454 Rev 2 doesn't seem to have this config available- maybe I am missing something?

0693W000008wMv7QAE.png 

I would appreciate all feedback.

13 REPLIES 13

Bump, I would appreciate all feedback.

Uwe Bonnes
Principal III

Newer STLINKV3 software sets the F723 to RDP2 but still allows to update the stlink firmware. So this could be the right thing for you.

Hi @Uwe Bonnes​ , thank you for answer.

Do you know whether it is possible to autoset this in firmware?

 > This table from the RM0454 Rev 2 doesn't seem to have this config available- maybe I am missing something?

Yes - you are missing that RM0454 is already in Rev 5.

JW

Hi @Community member​ , thank you for answer.

While touche, it seems this functionality is not updated between the re 2 and 5.

You may want to look at first line of Table 14 in RM0454 rev 5, and then at footnote 3.

If you want to write or selectively erase the Main FLASH without bulkerase (which will perform it "from inside"), you have to resort to custom bootloader or some other similar technique.

JW

I see the footnote regarding Write operations. For me, it is ok for someone else to write the memory in production. I don't want them to be able to read the memory. So ideally, the functionality I am looking for is that: One cannot read Main Flash area, before erasing the whole Main Flash area.

Footnote 3 says nothing about Write.

3. The Flash Main memory is erased when the RDP option byte is programmed with all level of protections disabled (0xAA).

That's exactly what you are looking for, except that the bulkerase is not accomplished through erase command from the debugger, but through changing the RDP to level 0.

JW

This is 1st line I am talking about:0693W000008wmxTQAQ.pngThe table is confusingly split to 2 pages... Footnote 3 is referenced also at Write for Option bytes, as that's how changing RDP thus the erase is accomplished.

JW