cancel
Showing results for 
Search instead for 
Did you mean: 

USB DFU not work with RDP Level1

bsuthar
Associate II

Hello Team,

With RDP set to Zero Level , Firmware upload succesfully using CubeProgrammer GUI ( USB DFU mode ).

But If I set RDP LeveL 1 , Device not able to detect on PC device manager and not able to connect with STM32 using CubeProgrammer USB interface Option. It does not connect at all.

Hence , Firmware update not possible with RDP 1 using USB DFU.

After Setting RDP Level 1 to Zero using STlink V2 SWD interface , It works fine in USB DFU mode.

Is it the correct behaviour ? Everytime do we need to set RDP Level 0 using STlink SWD and Then use USB DFU ?

MCU is : STM32F303Rb

7 REPLIES 7
Pavel A.
Super User

When RDP is not 0, the MCU will not boot off the "system" bootloader, this is why it isn't working. This is the correct behavior. So indeed firmware update is not possible using the "system" bootloader. Yes, SWD can be used to reset the RDP and update.

 

 

 

Hello Pavel,

Thank you for this update.

Whole Idea is to Update the Firmware from PC with USB Interface Only While Existing Firmware is Read Protected ( SWD interface Used first time to Flash & set RDP1 ).

Physical access to Boot0Pin and Reset Pin is not available Due to legacy system design.

So, Even if we write Custom  Bootloader for USB DFU in separate Memory Region With RDP1 ( or we Can call In-built USB DFU BootLoader ) to Re-Flash the Main Application ( which is also RDP1) when it needed , Would it be same Behaviour ?  

Regards,

Bhupendra

A custom bootloader is for the MCU the same as user application, so in RDP1 state it can do everything that application can do. It can rewrite the internal flash.

Okay , Got It.

1. Here , I believe , Custom bootloader can set RDP Level 0 --> 1 and 1--> 0 after Flashing. Correct ?

2. Can you suggest any Good Resource of Project Example where custom USB DFU Bootloader accept main application .bin file from STMCubeProgrammer GUI on USB and Update to given Flash address ? 

Pls. Consider Beginner Level.

Appreciate your support.

FBL
ST Employee

Hi @bsuthar 

  • A custom bootloader is just a user application running in flash. It is possible to program Option Bytes to change RDP level, but it requires a reset to apply changes.
  • ST provides USB DFU examples in STM32CubeF3 firmware packages. You can adapt these for a custom bootloader. Also, STM32CubeProgrammer supports USB DFU upload to custom bootloaders.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Thank you, FBL 

For this Suggestion. I will Look into it.

By the way , you Suggested to use DFU of  STM32373C_EVAL  , Would it better to use DFU of STM32303C_EVAL "OR"  STM32F3-Discovery ? Considering my Device : STM32F303rb.

bsuthar_0-1758801197438.png

Also , if you can Confirm these DFU example resembles to this Training Session : https://www.youtube.com/watch?v=n_LDXOQHerU

 

Thanks.

Hello FBL ,

Awaiting your suggestion Previouse queries ...

Thank you,

Bhupendra