cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: STM32CubeProgrammer in DFU/USB mode with elf file flash is not able to start app.

kareled
Associate II

Hello,

I've installed STM32CubeProgrammer 2.17.0 on Windows 11. I'm using it for flashing customer board using DFU mode over USB. I'm flashing elf file so cube programmer should be able to grab start address from it. For flashing I'm selecting 'Run after programming' but leaving 'Start address' box empty. In fact I'm not able to modify content of this box anyway.

Now, when I flash by clicking on 'Start Programming' button I see following output:

 

 

18:20:25 : Memory Programming ... 18:20:25 : Opening and parsing file: aximars_fw.elf 18:20:25 : File : aximars_fw.elf 18:20:25 : Size : 546.90 KB 18:20:25 : Address : 0x08000000 18:20:25 : Erasing memory corresponding to segment 0: 18:20:25 : Erasing internal memory sector 0 18:20:25 : erasing sector 0000 @: 0x08000000 done 18:20:25 : Erasing memory corresponding to segment 1: 18:20:25 : Erasing internal memory sectors [2 8] 18:20:26 : erasing sector 0002 @: 0x08008000 done 18:20:26 : erasing sector 0003 @: 0x0800c000 done 18:20:27 : erasing sector 0004 @: 0x08010000 done 18:20:29 : erasing sector 0005 @: 0x08020000 done 18:20:31 : erasing sector 0006 @: 0x08040000 done 18:20:33 : erasing sector 0007 @: 0x08060000 done 18:20:35 : erasing sector 0008 @: 0x08080000 done 18:20:35 : Download in Progress: 18:20:46 : File download complete 18:20:46 : Time elapsed during download operation: 00:00:20.816 18:20:46 : Verifying ... 18:20:46 : Read progress: 18:20:47 : Download verified successfully 18:20:47 : RUNNING Program ... 18:20:47 : Address: : 0x08000000 18:20:47 : Start operation achieved successfully 18:20:47 : Warning: Connection to device 0x441 is lost 18:20:47 : Disconnected from device.

 

 

 

Unfortunately my application is not started. To start it I need to switch board off and on again. Anyway, also my ELF file suggest (output below) that starting address should be 0x8008001 and not as programmer claims in output above 0x8000000. Now my question is if this is a know issue or not or how is it possible to work around the issue.

Thanks!
Karel

 

 

 

ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: ARM Version: 0x1 Entry point address: 0x8008001 Start of program headers: 52 (bytes into file) Start of section headers: 18814232 (bytes into file) Flags: 0x5000400 Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 6 Size of section headers: 40 (bytes) Number of section headers: 24 Section header string table index: 22

 

 

 

3 REPLIES 3
Amine_Jridi
ST Employee

Hello @kareled,

 

To fill the "Start address" box, you can use a .bin file instead of an .elf file.

Additionally, I tested a LED example using DFU with the Nucleo-F412ZG, and it worked fine (the application started and then disconnected from the device).

Could you please send your option bytes configurations using this command: 

$STM32_Programmer_CLI.exe -c port=SWD -ob displ

Thanks, Amine.

 


In order 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.

Hi Amine,

 

here is your required option bytes:

 

ST-LINK SN : 001E00203331511034333834 ST-LINK FW : V3J13M4B5S1 Board : STLINK-V3SET Voltage : 3.24V Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication 2nd connect tentative with frequency (8MHz) ST-LINK SN : 001E00203331511034333834 ST-LINK FW : V3J13M4B5S1 Board : STLINK-V3SET Voltage : 3.24V SWD freq : 8000 KHz Connect mode: Normal Reset mode : Software reset Device ID : 0x441 Revision ID : Rev C Device name : STM32F412 Flash size : 1 MBytes Device type : MCU Device CPU : Cortex-M4 BL Version : 0x91 UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x40023c14 Size : 8 Bytes ██████████████████████████████████████████████████ 100% OPTION BYTES BANK: 0 Read Out Protection: RDP : 0xAA (Level 0, no protection) PCROP Protection: SPRMOD : 0x0 (PCROP disabled. nWPRi bits used for Write protection on sector i) BOR Level: BOR_LEV : 0x3 (BOR OFF reset threshold level from 1.80 to 2.10 V) User Configuration: WDG_SW : 0x1 (Software watchdog) nRST_STOP : 0x1 (No reset generated) nRST_STDBY : 0x1 (No reset generated) Write Protection: WRP0 : 0x1 (Write protection not active) WRP1 : 0x1 (Write protection not active) WRP2 : 0x1 (Write protection not active) WRP3 : 0x1 (Write protection not active) WRP4 : 0x1 (Write protection not active) WRP5 : 0x1 (Write protection not active) WRP6 : 0x1 (Write protection not active) WRP7 : 0x1 (Write protection not active) WRP8 : 0x1 (Write protection not active) WRP9 : 0x1 (Write protection not active) WRP10 : 0x1 (Write protection not active) WRP11 : 0x1 (Write protection not active)
View more

thanks for the help! Karel

MM..1
Chief III

You create dupl thread and some teory info. GO command in utility or from code read start address from location entered as vector table base and start address is stored on first 32 vector. Then utility read 8008000+4 and get 32 bit number for jumping... realy impossible 8008001 ...