2025-09-04 4:16 AM
Greetings,
I'm making a project, using a B-U585I-IOT02A board in which I made a Java program that can flash a firmware (using the USB DFU protocol) and also set Readout Protection to Level 1 through the Option Bytes. The program can flash the firmware and set RDP level 1 successfully, but I wanted to be able to flash a firmware, using the USB DFU while having the RDP set to level 1 and I can't. Every time I set the RDP level 1, I can't upgrade using USB DFU, I need to use the STLINK, go to the STM32CubeProgrammer and set the Option Bytes back to level 0, which will mass erase the flash.
I know I can't do all this with the STM32CubeProgrammer, but I want to be able to do it with my program (for personal reasons).
So the question is, how can I upgrade the firmware using USB DFU, with RDP set to level 1?
Thank you!
Solved! Go to Solution.
2025-09-12 9:15 AM
Yeah, I'm not actually using STM32CubeProgrammer to do it. I made an implementation of DFU protocol in java to do that. But I already solved the issue, I needed to send a Read Unprotect (0x92) command to do it. Already did it. Thanks anyway!
2025-09-04 2:50 PM
Dear @j_filipe ,
Can you try the scenario shown here Introduction to Arm® TrustZone® features on STM32L5, STM32U5, and STM32U3 MCUs - Application note Page 22 , figure 11
If RDP is set to level 1 and the TZEN regression cannot be done using the STM32CubeProgrammer graphical
interface, the STM32CubeProgrammer CLI (command line instructions) must be used, applying the following
TZEN regression command:
> STM32_Programmer_CLI.exe -c port=USB1 -tzenreg
Hope it helps.
STOne-32.
2025-09-12 9:15 AM
Yeah, I'm not actually using STM32CubeProgrammer to do it. I made an implementation of DFU protocol in java to do that. But I already solved the issue, I needed to send a Read Unprotect (0x92) command to do it. Already did it. Thanks anyway!