Skip to main content
Lukasz Przenioslo
Associate III
March 9, 2021
Question

RDP settings to disable main memory read

  • March 9, 2021
  • 12 replies
  • 2808 views

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.

This topic has been closed for replies.

12 replies

Lukasz Przenioslo
Associate III
March 12, 2021

Bump, I would appreciate all feedback.

Uwe Bonnes
Chief
March 12, 2021

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.

Lukasz Przenioslo
Associate III
March 12, 2021

Hi @Uwe Bonnes​ , thank you for answer.

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

waclawek.jan
Super User
March 12, 2021

 > 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

Lukasz Przenioslo
Associate III
March 12, 2021

Hi @Community member​ , thank you for answer.

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

waclawek.jan
Super User
March 12, 2021

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

Lukasz Przenioslo
Associate III
March 12, 2021

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.

waclawek.jan
Super User
March 12, 2021

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

waclawek.jan
Super User
March 12, 2021

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

Lukasz Przenioslo
Associate III
March 12, 2021

I see... Thank you! I will evaluate this new info.