cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to debug with STM32CubeIDE after upgrading stlink firmware to V2.36.S7 version

Iman Hosseinzadeh
Associate III

Hi there,

I am using STM32CubeIDE 1.3.0 with STM32L152x MCUs.

When using ST-Link GDB Server, STM32CubeIDE insists on updating Stlink firmware to the latest version (Now is V2.36.S7). After that I get the following errors:

ST-LINK SN : 49FF76068370565215201781

ST-LINK FW : V2J36S7

Voltage    : 3.21V

SWD freq   : 1800 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x429

Device name : STM32L100x6xxA/STM32L100x8xxA/STM32L100xBxxA/STM32L15xx6xxA/STM32L15xx8xxA/STM32L15xxBxxA

Flash size : 64 KBytes

Device type : MCU

Device CPU : Cortex-M3

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a07132.srec

 File         : ST-LINK_GDB_server_a07132.srec

 Size         : 9052 Bytes

 Address      : 0x08000000

Erasing memory corresponding to segment 0:

Error: Flash loader cannot be loaded

Error: failed to erase memory

Encountered Error when opening E:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.3.0.202002181050\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Debugger connection lost.

Shutting down...

Using OpenOCD I encounter the following:

Open On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:57)

Licensed under GNU GPL v2

For bug reports, read

   http://openocd.org/doc/doxygen/bugs.html

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 8000 kHz

adapter_nsrst_delay: 100

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : clock speed 8000 kHz

Info : STLINK V2J36S7 (API v2) VID:PID 0483:3748

Info : using stlink api v2

Info : Target voltage: 3.179099

Info : SRST line asserted

Info : STM32L152RBTx.cpu: hardware has 6 breakpoints, 4 watchpoints

Info : Listening on port 3333 for gdb connections

Info : accepting 'gdb' connection on tcp/3333

Info : SRST line released

Error: timed out while waiting for target halted

TARGET: STM32L152RBTx.cpu - Not halted

Info : Device: STM32L1xx (Cat.2)

Info : STM32L flash size is 64kb, base address is 0x8000000

Info : SRST line asserted

Info : SRST line released

Error: timed out while waiting for target halted

TARGET: STM32L152RBTx.cpu - Not halted

Error: Target not halted

Error: failed erasing sectors 0 to 2

Error: flash_erase returned -304

shutdown command invoked

Info : dropped 'gdb' connection

But everything is OK with ST Link Utility Software. I think there is a problem with the latest STLink firmware version. Is there anyway to solve this problem or at least to prevent STM32CubeIDE from upgrading STLink firmware?

4 REPLIES 4
Pavel A.
Evangelist III

> at least to prevent STM32CubeIDE from upgrading STLink firmware?

+1

Iman Hosseinzadeh
Associate III

I think the problem is that I have not connected the Reset pin to the programmer. STM32CubeMXIDE can not handle this situation.

S.Ma
Principal

Seems CudeIDE doesn't use same drivers as STLink utility?

In IAR, the STLink properties has option to reset control or not by STLink, which typically is needed when the MCU goes deep low power clock stop modes.

CubeIde does have reset settings, for stlink gdb server or openocd, look in the debug configuration.

You can try without setting connect under reset mode and see if it works better.