Skip to main content
LCE
Principal III
Question

STM32CubeProgrammer - wrong setting or bug? With *.hex not starting at 0x08000000

Heyho,

I recently updated the STM32CubeProgrammer (latest update today).

Using a new ST-Link-Mini seemd to require that, before I think I used a version from 2022 or so.

Since the update, I have a problem with programming a hex file to a H733, which is partioned into:

  • bootloader 0x08000000 .. 0x0803FFFF → *.bin file 
  • application: 0x08040000 … → *.hex file

Until before the update, this was no problem at all, but now it seems that I have to flash the bootloader again, but not always.
It’s really annoying and eats time.

Any idea if this is a bug or I forgot to update some setting in the new CubeProg ?

 

PS: the Log window does not complain, the addresses displayed are correct.

 

18 replies

LCE
LCEAuthor
Principal III

Here’s what the Log window says:

flashing the application *.hex, with both bootloader and app already in flash:

14:23:00 : File: D:\Projects\..\Release\STM32H733_Rev_0-1.hex
14:23:00 : Number of segments: 3
14:23:00 : segment[0]: address= 0x8040000, size= 0x2CC
14:23:00 : segment[1]: address= 0x8040400, size= 0xB0
14:23:00 : segment[2]: address= 0x8040800, size= 0x702E0
14:23:10 : UR connection mode is defined with the HWrst reset mode
14:23:10 : ST-LINK SN : 003F003A3235511737333439
14:23:10 : ST-LINK FW : V3J17M11
14:23:10 : Board : STLINK-V3MINIE
14:23:10 : Voltage : 2.04V
14:23:11 : SWD freq : 8000 KHz
14:23:11 : Connect mode: Normal
14:23:11 : Reset mode : Hardware reset
14:23:11 : Device ID : 0x483
14:23:11 : Revision ID : Rev Z
14:23:11 : Debug in Low Power mode is not supported for this device.
14:23:11 : UPLOADING OPTION BYTES DATA ...
14:23:11 : Bank : 0x00
14:23:11 : Address : 0x5200201c
14:23:11 : Size : 92 Bytes
14:23:11 : UPLOADING ...
14:23:11 : Size : 1024 Bytes
14:23:11 : Address : 0x8000000
14:23:11 : Read progress:
14:23:11 : Data read successfully
14:23:11 : Time elapsed during the read operation is: 00:00:00.002
14:23:11 : Opening and parsing file: STM32H733_Rev_0-1.hex
14:23:11 : Memory Programming ...
14:23:11 : File : STM32H733_Rev_0-1.hex
14:23:11 : Size : 449.590 KB (460380 B)
14:23:11 : Address : 0x08040000
14:23:11 : Erasing memory corresponding to segment 0:
14:23:11 : Erasing internal memory sector 2
14:23:12 : Erasing memory corresponding to segment 1:
14:23:12 : Erasing internal memory sector 2
14:23:13 : Erasing memory corresponding to segment 2:
14:23:13 : Erasing internal memory sectors [2 5]
14:23:16 : Download in Progress:
14:23:20 : File download complete
14:23:20 : Time elapsed during download operation: 00:00:08.933

"DISCONNECT"
manual hardware RESET
-> nothing, MCU seems dead

now flashing the bootloader *.hex
14:25:12 : UR connection mode is defined with the HWrst reset mode
14:25:12 : ST-LINK SN : 003F003A3235511737333439
14:25:12 : ST-LINK FW : V3J17M11
14:25:12 : Board : STLINK-V3MINIE
14:25:12 : Voltage : 3.23V
14:25:12 : SWD freq : 8000 KHz
14:25:12 : Connect mode: Normal
14:25:12 : Reset mode : Hardware reset
14:25:12 : Device ID : 0x483
14:25:12 : Revision ID : Rev Z
14:25:12 : Debug in Low Power mode is not supported for this device.
14:25:12 : UPLOADING OPTION BYTES DATA ...
14:25:12 : Bank : 0x00
14:25:12 : Address : 0x5200201c
14:25:12 : Size : 92 Bytes
14:25:12 : UPLOADING ...
14:25:12 : Size : 1024 Bytes
14:25:12 : Address : 0x8000000
14:25:12 : Read progress:
14:25:12 : Data read successfully
14:25:12 : Time elapsed during the read operation is: 00:00:00.002
14:25:13 : Opening and parsing file: STM32H7_Bootloader_Rev_0-4.bin
14:25:13 : Memory Programming ...
14:25:13 : File : STM32H7_Bootloader_Rev_0-4.bin
14:25:13 : Size : 200.625 KB (205440 B)
14:25:13 : Address : 0x08000000
14:25:13 : Erasing memory corresponding to segment 0:
14:25:13 : Erasing internal memory sectors [0 1]
14:25:14 : Download in Progress:
14:25:16 : File download complete
14:25:16 : Time elapsed during download operation: 00:00:03.472
14:25:52 : Disconnected from device.

"DISCONNECT"
manual hardware RESET
-> all okay

 

LCE
LCEAuthor
Principal III

I just found this:

14:23:10 : Voltage : 2.04V

 

Checked it on the scope, directly on the prog. connector pin, when connecting and while programming: stable 3.3V.

LCE
LCEAuthor
Principal III

Ouch, too stooopid before to read the flash.

After flashing the hex file, the bootloader part is erased.

Aziz BRIGUI
ST Technical Moderator

Hi ​@LCE,

Seems like a watchdog issue, maybe it’s interrupting the programming. Could you please dump your option bytes? Try having IWDG1_SW =1.

Kind regards,

Aziz

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.
LCE
LCEAuthor
Principal III

IWDG1_SW is “checked” in Cube Prog - whatever that means ...

Aziz BRIGUI
ST Technical Moderator

Please dump all the option bytes:

>STM32_Programmer_CLI -c port=SWD -ob displ

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.
TDK

Even if the process is interrupted, the bootloader shouldn’t be erased if it doesn’t touch that flash page, which it doesn’t say that it does.

 

14:23:10 : Voltage : 2.04V

This is also certainly a showstopper that will need fixed. Perhaps the connection is bad.

"If you feel a post has answered your question, please click ""Accept as Solution""."
LCE
LCEAuthor
Principal III

> Perhaps the connection is bad.

Checked it, on this board I had the place for the 14-pin SMD-connector which directly fits the ST-Link connector cable.

Also checked the voltage going to the connector, stable 3.3V.