2026-03-01 4:34 AM - edited 2026-03-01 4:50 AM
Hello Team,
Refering to this Thread :
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,
2026-03-01 10:47 AM
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.
2026-03-01 1:35 PM
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.
2026-03-05 6:54 AM
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,
2026-03-05 9:01 AM
@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.
2026-03-05 9:59 PM - edited 2026-03-05 11:21 PM
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 ?
2026-03-06 1:16 AM
@bsuthar I used the two solutions, with system bootloader of STM32 via USB and also made a custom bootloader, but I'm not following the DFU protocol on that bootloader.
Yes, I'm able to detect and reset to RDP0 with cubeProgrammer with USB DFU. If you can't do it, maybe it's because you need to install dfu-util on your PC. At least I needed to do it on Linux.
Best regards!
2026-03-12 8:08 AM
Hello Team,
After Clearing RDP bit using ST-link , detects USB System Bootloader with CubeProgrammer.
I would try to use following Bootloader , instead of system bootloader.