2025-04-09 7:20 AM
Dear community members,
I am using STM32CubeIDE to develop and debug the STM32H7 series dual-core microcontrollers, but I have encountered a stubborn problem and hope to get help and suggestions from the community.
### Problem description
I used the built-in example project GPIO for testing according to the application note AN5361(You can refer to the attached content).
I was able to successfully compile, burn and debug the program for the Cortex-M7 core, but when trying to debug the Cortex-M4 core, I always received the following error message:
```
Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
An error occurred while initializing the ST-Link device.
Reason: (255) Unknown reason. Please check the power supply and cable connected to the target machine.
```
More specifically, the debug console shows:
```
Failed to read ROM table via AP 3
Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.
```
### Solutions I have tried
1. **Checked and configured option bytes**:
* Verified via STM32CubeProgrammer that BCM4 (CM4 boot option) is enabled
* NRST_STOP_D2 and NRST_STBY_D2 are also correctly enabled
* Boot address is also correctly configured (CM7: 0x08000000, CM4: 0x08100000)
2. **Debugger configuration**:
* CM7 configuration: Access port set to "0 - Cortex-M7", Reset behavior set to "Connect under reset"
* CM4 configuration: Access port set to "3 - Cortex-M4", Reset behavior set to "None"
Both configurations have "Enable shared ST-LINK" enabled
* CM4's port number is 3 higher than CM7 (CM7: 61234, CM4: 61237)
* Download disabled in CM4's Startup tab (because CM7 is already responsible for downloading)
3. **Boot sequence** :
* Start a CM7 debug session and let it run
* Then try to start a CM4 debug session
* Make sure the CM7 code contains code to release the hardware semaphore to wake up the CM4
4. **Connection test** :
* Use STM32CubeProgrammer to successfully connect to the device and read memory
* ST-LINK firmware has been updated to the latest version
* Tried different USB cables and ports
### System information
* Development board model: [NUCLEO-H755ZI-Q]
* Chip: STM32H755
* STM32CubeIDE version: [1.18.0]
* ST-LINK version: [STLINK-V3 V3J16M7]
* Operating system: [Linux 22.04]
### Debug information
When CM7 debugging is successfully started, the program falls into a loop waiting for CM4 to start:
When executing GPIO_EXTI_CM7_Debug, the output information is:
STMicroelectronics ST-LINK GDB server. Version 7.10.0
Copyright (c) 2025, 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
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.19.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_q3TuDb.log
ST-Link Server is running on port : 7184
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
ST-LINK SN : 004400193433510A37363934
ST-LINK FW : V3J16M7
Board : NUCLEO-H755ZI-Q
Voltage : 3,29V
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
SWD freq : 8000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x450
Revision ID : Rev V
Device name : STM32H7xx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M7/M4
BL Version : 0x91
Opening and parsing file: ST-LINK_GDB_server_dxfKHW.srec
Memory Programming ...
File : ST-LINK_GDB_server_dxfKHW.srec
Size : 4.59 KB
Address : 0x08100000
Erasing memory corresponding to sector 0:
Erasing internal memory sector 8
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:03.647
Verifying ...
Download verified successfully
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
-------------------------------------------------------------------
STM32CubeProgrammer v2.19.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_FY9gId.log
ST-Link Server is running on port : 7184
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
ST-LINK SN : 004400193433510A37363934
ST-LINK FW : V3J16M7
Board : NUCLEO-H755ZI-Q
Voltage : 3,29V
SWD freq : 8000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x450
Revision ID : Rev V
Device name : STM32H7xx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M7/M4
BL Version : 0x91
Opening and parsing file: ST-LINK_GDB_server_4APDtX.srec
Memory Programming ...
File : ST-LINK_GDB_server_4APDtX.srec
Size : 8.66 KB
Address : 0x08000000
Erasing memory corresponding to sector 0:
Erasing internal memory sector 0
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:03.837
Verifying ...
Download verified successfully
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
When executing GPIO_EXTI_CM4_Debug, the output information is as follows:
STMicroelectronics ST-LINK GDB server. Version 7.10.0
Copyright (c) 2025, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61240
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
Failed to read ROM table via AP 3
Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.
My questions
1. Why can't I access CM4 through AP 3 even though the BCM4 option is enabled?
2. Are there any other configurations or settings that may affect dual-core debugging?
3. Are there any specific debugging commands or methods to get more detailed error information?
4. Is this issue related to a specific STM32H7 model or development board?
If any additional information is needed, please feel free to contact me!
Any help or suggestions are greatly appreciated!