Skip to main content
ERazz.3
Associate II
March 9, 2022
Solved

STM32CubeProgrammer connection over UART error

  • March 9, 2022
  • 9 replies
  • 7983 views

Hi, I've some problem using SMT32CubeProgrammer.

i am trying to connect via uart to micro stm32g491 but i receive some error messages.

15:21:34:034 : RTS low

 15:21:34:034 : DTR low

 15:21:34:171 : Serial Port COM15 is successfully opened.

 15:21:34:172 : Port configuration: parity = even, baudrate = 115200, data-bit = 8,           stop-bit = 1.0, flow-control = off

 15:21:34:172 : No Init bits value is : 0 

 15:21:34:172 : Sending init command: 

 15:21:34:175 : byte 0x7F sent successfully to target

 15:21:34:176 : Wait ends after 1 loop, dataready = 1, delay = 0

 15:21:34:176 : Received response from target: 0x79

 15:21:34:191 : Activating device: OK

 15:21:34:192 : Sending GetID command and its XOR:

 15:21:34:192 : byte 0x02 sent successfully to target

 15:21:34:192 : byte 0xFD sent successfully to target

 15:21:34:192 : Wait ends after 1 loop, dataready = 1, delay = 0

 15:21:34:192 : Received response from target: 0x79

 15:21:34:192 : Received 4 data bytes from target : 0x03047b7b

 15:21:34:194 : Chip ID: 0x47B 

 15:21:34:195 : Sending Get command and its XOR:

 15:21:34:195 : byte 0x00 sent successfully to target

 15:21:34:195 : byte 0xFF sent successfully to target

 15:21:34:195 : Wait ends after 1 loop, dataready = 1, delay = 0

 15:21:34:195 : Received response from target: 0x7b

 15:21:34:196 : Error: GET command not acknowledged!

 15:21:34:197 : Reemission of Get command

 15:21:34:197 : Sending Get command and its XOR:

 15:21:34:197 : byte 0x00 sent successfully to target

 15:21:34:214 : byte 0xFF sent successfully to target

 15:21:34:214 : Received response from target: 0x1b

 15:21:34:215 : Error: GET command not acknowledged!

 15:21:34:218 : Reemission of Get command

 15:21:34:218 : Sending Get command and its XOR:

 15:21:34:222 : byte 0x00 sent successfully to target

 15:21:34:224 : byte 0xFF sent successfully to target

 15:21:34:226 : Received response from target: 0x33

 15:21:34:228 : Error: GET command not acknowledged!

 15:21:34:328 : UART PORT CLOSE 

but if I try to communicate with the embedded bootloader of stm32 using another software (for example minicom or docklite) I can communicate correctly.

here are some messages on the serial:

09/03/2022 14:37:50.788 [TX] - 7F

09/03/2022 14:37:50.804 [RX] - 79

09/03/2022 14:37:51.966 [TX] - 02 FD

09/03/2022 14:37:51.971 [RX] - 7A 03 04 7B 3F 79

09/03/2022 14:37:53.091 [TX] - 01 FE

09/03/2022 14:37:53.094 [RX] - 79 33 00 00 7B 3F

09/03/2022 14:37:53.787 [TX] - 02 FD

09/03/2022 14:37:53.793 [RX] - 7B 3F 03 04 7B 7B 3F

09/03/2022 14:37:54.490 [TX] - 01 FE

09/03/2022 14:37:54.497 [RX] - 79 71 00 00 7B 3F

why can't i use stm32cubeprogrammer software?

This topic has been closed for replies.
Best answer by Houda GHABRI

Hi @ERazz.3​ ,

I tested with the same device you have (same Device ID and Bootloader version), it works fine on ST Board with both CubeProgrammer 2.9.0 and 2.10 version.

So I suspect a wiring issue , you can try to reduce the Baudrate and test again?

Houda

9 replies

Houda GHABRI
ST Employee
March 9, 2022

Hi @ERazz.3 ,

Are you using the last CubeProgrammer version 2.10.0.? If not can you please switch to this version which contain many enhancement related to UART connection?

Houda

ERazz.3
ERazz.3Author
Associate II
March 9, 2022

i've installed stm32cubeprogrammer 2.10.0.

it seem to be the same...

here the log.

14:29:04:255 : Activating device: OK

14:29:04:256 : Board : --

14:29:04:256 : Sending GetID command and its XOR:

14:29:04:257 : byte 0x02 sent successfully to target

14:29:04:260 : byte 0xFD sent successfully to target

14:29:04:260 : Wait ends after 1 loop, dataready = 1, delay = 0

14:29:04:306 : Received response from target: 0x79

14:29:04:306 : Received 4 data bytes from target : 0x01047b79

14:29:04:307 : Chip ID: 0x47B

14:29:04:307 : Sending Get command and its XOR:

14:29:04:309 : byte 0x00 sent successfully to target

14:29:04:312 : byte 0xFF sent successfully to target

14:29:04:312 : Wait ends after 1 loop, dataready = 1, delay = 0

14:29:04:312 : Received response from target: 0x6f

14:29:04:313 : Error: GET command not acknowledged!

14:29:04:313 : Reemission of Get command

14:29:04:313 : Sending Get command and its XOR:

14:29:04:314 : byte 0x00 sent successfully to target

14:29:04:316 : byte 0xFF sent successfully to target

14:29:04:316 : Received response from target: 0x61

14:29:04:316 : Error: GET command not acknowledged!

14:29:04:317 : Reemission of Get command

14:29:04:317 : Sending Get command and its XOR:

14:29:04:317 : byte 0x00 sent successfully to target

14:29:04:317 : byte 0xFF sent successfully to target

14:29:04:318 : Received response from target: 0xee

14:29:04:318 : Error: GET command not acknowledged!

14:29:04:341 : UART PORT CLOSE

Houda GHABRI
ST Employee
March 9, 2022

Hi @ERazz.3​ ,

Ok I will check , can you tell me if you are using CLI or GUI? If CLI command line used please.

Houda

ERazz.3
ERazz.3Author
Associate II
March 9, 2022

@Houda GHABRI​  i'm using GUI.

Thanks

Houda GHABRI
ST Employee
March 15, 2022

Hi @ERazz.3​ ,

I did same checks using NUCLEO-G491RE board and connection via UART works correctly.

I see in your traces that the Device ID is not correct :

14:29:04:306 : Received 4 data bytes from target : 0x01047b79

14:29:04:307 : Chip ID: 0x47B

The correct device ID for STM32G491  is 0x479 so tell me please if you are using an ST Board? Also send me please the Bootloader version of your chip ( value of Bootloader is in 0x1FFF6FFE address).

Houda

ERazz.3
ERazz.3Author
Associate II
March 15, 2022

Hi, at address 0x1FFF6FFE I see 0xD2.

we're using our custom bord.

thanks

Houda GHABRI
ST Employee
March 15, 2022

Hi @ERazz.3​ 

The Baudrate value used during connection please?

Houda

ERazz.3
ERazz.3Author
Associate II
March 15, 2022

Hi, 155200

Houda GHABRI
Houda GHABRIBest answer
ST Employee
March 15, 2022

Hi @ERazz.3​ ,

I tested with the same device you have (same Device ID and Bootloader version), it works fine on ST Board with both CubeProgrammer 2.9.0 and 2.10 version.

So I suspect a wiring issue , you can try to reduce the Baudrate and test again?

Houda

ERazz.3
ERazz.3Author
Associate II
March 15, 2022

lowering the bourate worked.

 15:40:30 : RTS low

 15:40:30 : DTR low

 15:40:31 : Serial Port COM9 is successfully opened.

 15:40:31 : Port configuration: parity = even, baudrate = 38400, data-bit = 8,           stop-bit = 1.0, flow-control = off

 15:40:33 : Timeout error occured while waiting for acknowledgement.

 15:40:33 : Activating device: OK

 15:40:33 : Board    : --

 15:40:33 : Chip ID: 0x479 

 15:40:33 : BootLoader protocol version: 3.1

 15:40:33 : Response received from device: NACK

 15:40:34 : Response received from device: NACK

 15:40:34 : UPLOADING OPTION BYTES DATA ...

 15:40:34 :  Bank     : 0x00

 15:40:34 :  Address    : 0x1fff7800

 15:40:34 :  Size     : 48 Bytes

 15:40:35 : UPLOADING ...

 15:40:35 :  Size     : 1024 Bytes

 15:40:35 :  Address    : 0x8000000

 15:40:35 : Read progress:

 15:40:37 : Data read successfully

 15:40:37 : Time elapsed during the read operation is: 00:00:01.498

 15:40:52 : Memory Programming ...

 15:40:52 : Opening and parsing file: BloodySensor.bin

 15:40:52 :  File     : BloodySensor.bin

 15:40:52 :  Size     : 149.54 KB 

 15:40:52 :  Address    : 0x08000000 

 15:40:52 : Erasing memory corresponding to segment 0:

 15:40:52 : Erasing internal memory sectors [0 74]

 15:40:53 : Download in Progress:

 15:41:43 : File download complete

 15:41:43 : Time elapsed during download operation: 00:00:51.146

ERazz.3
ERazz.3Author
Associate II
March 15, 2022

how is it possible that the Chip ID changes according to the boudrate?

I am using the same board as when i wrote the question

Houda GHABRI
ST Employee
March 15, 2022

Hi @ERazz.3​ ,

No the chip ID doesn't' change according to the baudrate.

When the HW connection is not good( bad quality of cable ,long wires ...) Data cannot be exchanged correctly with Bootloader.

Lowering Baudrate can enhance the signal integrity so we read data correctly.

Hope it is clear.

Houda