Skip to main content
Associate III
March 1, 2026
Question

USB DFU Firmware update while RDP1

  • March 1, 2026
  • 3 replies
  • 325 views

Hello Team,

Refering to this Thread : 

https://community.st.com/t5/stm32-mcus-products/updating-firmware-through-usb-dfu-with-readout-protection-level/m-p/838635

We want to achieve same , 

Can I upgrade the firmware using USB DFU, with RDP set to level 1? 
We are fine setting RDP1 -> RDP0 and Erase Flash, then Flash the Firmware.

I tried with Cubeprogrammers and CLI , but unroftunately USB1 ( STM32 Bootloader in PC device manager ) not showing and connection does not happen. Tried making BOOT0 pin high when Reset.

However , Actual plan is jump to system bootloader from User code through jump address.

 

Regards,

@STOne-32 @j_filipe 

3 replies

Senior
March 1, 2026

Greetings @bsuthar 
I don't know if you're using your own implementation of the DFU protocol, but what I did on my own was kinda of reset all the Option Bytes back to its defaults (the values are in the reference manual of your MCU). That did work for me on my java implementation. 

TDK
Super User
March 1, 2026

If you boot into the system bootloader, you cannot access the flash if RDP=1 is set. This is by design.

You should be able to read unprotect which erases the flash and then program as you see fit.

If USB DFU isn't showing up, perhaps the hardware is bad. Provide some context here.

"If you feel a post has answered your question, please click ""Accept as Solution""."
bsutharAuthor
Associate III
March 5, 2026

Thank you for Updates, Guys

@TDK  , 

1. In case RDP1 is set will CubeProgrammer detect DFU through USB ? 

2. Can I set RDP1 --> RDP0 , Using CubeProgrammer through USB externally ? we do not want to use SWD.

 

@j_filipe , So you did not use System bootloader but developed custom DFU Firmware which would on STM32 memory Right ? 

Can you sugegst any link/Doc which guide for same ?

Thank you,

 

Senior
March 5, 2026

@bsuthar 
What I did was a java program that would flash a firmware and then set RDP to 1.
1 - I would set my board into Bootloader / System Memory Boot connecting it via USB (that means DFU mode) 
2 - My program would send a read unprotect to remove all the RDP, setting back to 0.
3 - Since the flash would be erased, the program would flash the firmware
4 - After flashing the firmware, it would program the Option Bytes to set RDP to 1 again. 

bsutharAuthor
Associate III
March 6, 2026

Hello @j_filipe ,

So, You are using Pre-built in system bootloader of STM32 via USB. Not customized one. 

For your First Step , while RDP1 is set , are you able to detect and Reset to RDP0 with cubeProgrammer USB DFU ?

Or it is only possible with your customised Java Programmer only ? 

Any Reference document you used for that ?