cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a valid DFU project in STM32CUBEIDE

samuel_zhang
Associate II

Tested on : one pieces of NUCLEO-L152RE evm board.

I could create one DFU project(NUCLEO-L152-DFU) together with one APP project(NUCLEO-L152-BLINK) in STM32CUBEIDE towards STM32L152.

I could upgrade firmware in STM32CUBEPROGRAMMER as well.

 0693W00000DmvnIQAR.pngAfter upgrading firmware, I pushed the reset button to make the MCU power-cycled. Then the bootloader identified the App firmware (base address = 0x801000) and tried to jump to "0x801093d". However, no expected logging information shown and LD2 didn't blink as wished as well.

Try to get button state

Button state: 1

Check hex-format data at address: 0x8010000

Jump to address: 0x801093d

I analyzed the App hex file, the starting-point address shoud be correct.

 0693W00000DmvnNQAR.png 0693W00000DmvnSQAR.png 

And the bytes in chip flash coincides with the data in hex file.

 0693W00000DmvnXQAR.png 0693W00000DmvncQAB.png 

So I could confirm that the DFU programming process is unquestionable. There must be somthing wrong with the App firmware.

Could somebody help find the root cause why the APP firmware couldn't run as expected- output logging information during blinking peroid?

Toggle LD2

Toggle LD2

Toggle LD2

I guess there's something wrong with the APP project.

I'll be gratefull if you could give me a hand.

8 REPLIES 8
Bruno_ST
ST Employee

Hello @samuel_zhang​ ,

You projet is password protected . Can you share it ?

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.

samuel_zhang
Associate II

Thanks Bruno!!!

The password is "123456".

Please download it and decompress.​

samuel_zhang
Associate II

Today I tried with the offical DFU example in "STM32CubeL1" and found that it was perfect during upgrading App firmware file ("STM32L152xE_NUCLEO_SysTick_0x08007000.dfu").

The project is located in the folder "STM32CubeL1-master\Projects\NUCLEO-L152RE\Applications\USB_Device\DFU_Standalone\SW4STM32\STM32L1_Nucleo".

Regretfully, I don't know how to conver the project together with the App project (not found- just a single image file included) into STM32CUBEIDE projects casuse I have been working in STM32CUBIDE so far.

Of course, I also don't want to upgrade firmware with the old tool "DfuSe_Demo". In contrast, I prefer “STM32CUBEPROGRAMMER�? to it.

I do expect ST staff could help generate demo projects (DFU project + APP project) towards STM32CUBEIDE soon.

Bruno_ST
ST Employee

Hello @samuel_zhang​ 

Sorry for long time without answer. Yes, APP & DFU project are separated project that can be compiled and run under STM32CUBEIDE, like you did it.

Where you able to make it work ?

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.

samuel_zhang
Associate II

For each of the projects, if you run it standalone in debug mode (in STM32CUBEIDE), everything is just fine.

However, if you program both of them (two hex files: bootloader to 0x800000, app to 0x810000), just log information of bootloader will show on the screen:

xxxxxxx

jump to 0x81xxxxxx,

And then nothing is displayed - expected App firmware log don't display on the screen at all.

In the other side, I could upgrade firmware in DFU mode inside STM32programmer tool.

But after upgrading and power-cycling the board, the same thing just happens- no expected App firmware log information is shown.

To understand concretely, you have to find one NUCLEO-L152RE board to try the routines I just mentioned.

Ok, but board NUCLEO-L152RE has only one USB connector (for STLINK) so what are you adding to get DFU working on STM32L152 ?

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.

samuel_zhang
Associate II

0693W00000FAzUHQA1.jpg 

I took use of one 4PIN-to-USB cable to connect the board to PC.

The pin definition is : D+ (CN10-12), D-(CN10-14) and GND-(CN10-9).

samuel_zhang
Associate II