cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE updated stlink on a stm32H743-EVALv2 board to V3J4M2, but then is unable to program the board.

Brian Khuu
Associate III

Was able to program the board previously, but today after updating my STM32CubeIDE, it refused to run debug until I updated the stlink on my dev board.

But upon doing so, it gave these error. Essentially meaning I cannot program my dev board.

```

STMicroelectronics ST-LINK GDB server. Version 5.3.2

Copyright (c) 2019, STMicroelectronics. All rights reserved.

Starting server with the following options:

    Persistent Mode      : Disabled

    Logging Level       : 1

    Listen Port Number     : 61234

    Status Refresh Delay    : 15s

    Verbose Mode        : Disabled

    SWD Debug         : Enabled

Waiting for debugger connection...

Debugger connected

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.2.0          

   -------------------------------------------------------------------

Log output file:  /tmp/STM32CubeProgrammer_TqQf5t.log

ST-LINK SN : 002F001F3137511233333639

ST-LINK FW : V3J4M2

Voltage   : 3.28V

SWD freq  : 24000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Cannot identify the device

Error: unknown or unsupported device (DevID = 0x0000)

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_QKNgwM.srec

 File     : ST-LINK_GDB_server_QKNgwM.srec

 Size     : 157296 Bytes

 Address    : 0x08000000 

Erasing memory corresponding to segment 0:

Download in Progress:

File download complete

Time elapsed during download operation: 00:00:00.199

Verifying ...

Error: Data mismatch found at address 0x08000004 (byte = 0x31 instead of 0x5D)

Error: Download verification failed

Encountered Error when opening /Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_1.1.0.201910081157/tools/bin/STM32_Programmer_CLI

Error in STM32CubeProgrammer

Debugger connection lost.

Shutting down...

```

I am running this IDE on a mac on MacOS catalina. Oh and btw I still cannot run latest STM32CubeProgrammer on mac, even after updating java to latest version.

29 REPLIES 29

Would probably edge back the speed from 24 MHz, and select most verbose logging.

Try setting the BOOT0 switch to 1-System Mode

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
hansd56
Senior II

No problems here.

STMicroelectronics ST-LINK GDB server. Version 5.3.2

Copyright (c) 2019, STMicroelectronics. All rights reserved.

Starting server with the following options:

       Persistent Mode           : Disabled

       Logging Level             : 1

       Listen Port Number        : 61234

       Status Refresh Delay      : 15s

       Verbose Mode              : Disabled

       SWD Debug                 : Enabled

Waiting for debugger connection...

Debugger connected

     -------------------------------------------------------------------

                      STM32CubeProgrammer v2.2.0                 

     -------------------------------------------------------------------

Log output file:  C:\Users\hansd\AppData\Local\Temp\STM32CubeProgrammer_a09124.log

ST-LINK SN : 002000463137510939383538

ST-LINK FW : V3J4M2

Voltage    : 3.29V

SWD freq   : 24000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x450

Device name : STM32H7xx

Flash size : 2 MBytes

Device type : MCU

Device CPU : Cortex-M7

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a09124.srec

 File         : ST-LINK_GDB_server_a09124.srec

 Size         : 69496 Bytes

 Address      : 0x08000000

Erasing memory corresponding to segment 0:

Erasing internal memory sector 0

Download in Progress:

File download complete

Time elapsed during download operation: 00:00:01.258

Verifying ...

Download verified successfully

The funny thing is Cube Programmer offers version V3J3M2 and ST Link Utility V3J4M2???

Anyway try Cube Programmer with a reduced speed.

hansd56
Senior II

Sorry, I should mention I have the poor man's version Nucleo-H743I2.

hansd56
Senior II

There is now a new option with ST Link Server to set SWD speed. Not sure how to use it with CubeIDE yet. There should really be a selection box like in CubeProgrammer.

--frequency <max freq kHz>

Specifies the ST-LINK communication frequency in kHz, such as 5, 25, 100, 240, 950, 1800, 4000, 8000,

24000 kHz.

Brian Khuu
Associate III

Yeah there is a way to change the swd speed. Just tried 5Khz to no success... so not too sure what changed between the old version and this version of STLink

/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_1.1.0.201910081157/tools/bin/STM32_Programmer_CLI -c port=swd freq=5 reset=HWrst mode=UR
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.2.0                  
      -------------------------------------------------------------------
 
ST-LINK SN  : 002F001F3137511233333639
ST-LINK FW  : V3J4M2
Voltage     : 3.28V
SWD freq    : 5 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Cannot identify the device
Error: unknown or unsupported device (DevID = 0x0000)

It would be nice if STM32CubeIDE allowed me to use an older version of STLink.

Brian Khuu
Associate III

Okay just rediscovered the windows only stlink GUI utility STSW-LINK004 from:

https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.html

Turns out that the windows STSW-LINK004 utility works and was able to erase the board. However I was still not able to access the board from my mac using STM32CubeIDE. I wonder if it's to do with any change in stlink debug configuration between the old STM32CubeIDE and the new STM32CubeIDE.

Btw how did you get "STM32CubeProgrammer" working? I've already tried it on Mac, Linux, Windows with no luck. Is it requiring a specific java version?

Ok, going to try making a new STM32CubeIDE project to see if it's anything to do with the project migration.

Brian Khuu
Associate III

Just created a new CubeMX project named `testproj` and kept it to all the default values and just ran it in STM32CubeMX on my mac. Still failed.

Looks like something is wrong with the inbuilt`STM32CubeProgrammer v2.2.0` in STM32CubeIDE for `stm32H743-EVALv2`. But the windows STSW-LINK004 stlink GUI utility works... so maybe windows STM32CubeIDE would work?

Spaced Cowboy
Associate III

I think I'm running into this as well - see here

impact-art.org
Associate

I have the same issue. With F303 Discovery and STM3240G-EVAL. Running mac os sierra and STM32CubeIDE Version: 1.1.0. Everything worked fine before updating