2022-03-27 08:03 PM
When I try to debug with CubeIDE, the following happens
1. start debugging
2. program is written and debugger is attached successfully (startup sound is heard at the board side)
3. break in HAL_Init() in main()
4. resume (proceed to the next breakpoint)
5. debugger exits and returns to 1, but HAL_Init() will not break thereafter
6. repeat this 3 times to finish debug mode (changes on GUI)
Last remaining console log
STMicroelectronics ST-LINK GDB server. Version 6.1.0
Copyright (c) 2022, 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
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.10.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_5ZmSLp.log
ST-LINK SN : 55FF66067867515426571767
ST-LINK FW : V2J39S7
Board : --
Voltage : 3.26V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x438
Revision ID : Rev Z
Device name : STM32F303x4-x6-x8/F328xx/F334xx
Flash size : 64 KBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : --
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_oPKewb.srec
File : ST-LINK_GDB_server_oPKewb.srec
Size : 51.00 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 25]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:02.549
Verifying ...
Download verified successfully
Shutting down...
Exit.
After debugging starts, nothing is done except to restart the HAL_Init() break once at the beginning.
This occurred with CubeIDE 1.9.0. Previously, we were using 1.1.0, where the problem did not occur.
I am not sure what is causing this problem, partly because I don't really understand what is happening during STM32 debugging. I would like to know the cause and solution.
Thank you in advance for your help.
Execution environment is macOS Monterey.
2022-03-30 01:23 AM
Hello there!
Could you try to create a new workspace with a new project with STM32CubeIDE 1.9.0 and see if it's the same behavior with the new project?
If the behavior is the same, could you try to switch debug probe to OpenOCD to see if anything changes?
2022-06-07 12:08 AM
Sorry, I wrote it wrong...
2022-06-07 12:09 AM
Sorry for the delay in replying.
> Could you try to create a new workspace with a new project with STM32CubeIDE 1.9.0 and see if it's the same behavior with the new project?
There was no change (same behavior)
> If the behavior is the same, could you try to switch debug probe to OpenOCD to see if anything changes?
I think they behaved almost identically. Couldn't debug it.
It seems to have been rebooted several times. This error message was the last one left.
Open On-Chip Debugger 0.11.0+dev-00443-gcf12591 (2022-02-09-13:36) [ST Internal]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J39S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.266272
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x2ba01477
Info : STM32F303K8Tx.cpu: Cortex-M4 r0p1 processor detected
Info : STM32F303K8Tx.cpu: target has 6 breakpoints, 4 watchpoints
Info : STM32F303K8Tx.cpu: external reset detected
Info : starting gdb server for STM32F303K8Tx.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800031c msp: 0x20003000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : device id = 0x10016438
Info : flash size = 64kbytes
O.K.
O.K.:0xE00FFFD0
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800031c msp: 0x20003000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800031c msp: 0x20003000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800031c msp: 0x20003000
Info : dropped 'gdb' connection
Info : dropped 'gdb' connection
shutdown command invoked
2022-06-07 12:14 AM
After this, I restored the settings (debug probe to OpenOCD to ST-LINK) and was able to debug successfully.
I don't know why...
2024-01-09 07:26 PM
Has the problem been solved?