cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H755 CM7 Reset_Handler Stuck at 'ldr sp, =_estack' – Solution Needed for Single-Core Debugging

durna
Associate

Hello everyone,

I am currently working on a project using the STM32H755 microcontroller, and I am facing an issue with the program getting stuck in the `Reset_Handler` during debugging. Specifically, the code halts at the instruction `ldr sp, =_estack`, which sets the stack pointer, and does not proceed further.

### Project Setup:
- **Microcontroller**: STM32H755
- **Core**: Only using the Cortex-M7 (CM7) core, with Cortex-M4 (CM4) code generation disabled.
- **Debugger**: ST-LINK V3
- **IDE**: STM32CubeIDE
- **Firmware**: No custom firmware for CM4, only CM7 is active.

### Steps Taken:
1. I created the project with STM32CubeMX, configured it to use only the CM7 core (CM4 is disabled).
2. During debugging, the code reaches `Reset_Handler` but gets stuck at `ldr sp, =_estack`.
3. I have tried stepping through the code and confirmed the program halts at the stack pointer initialization.

### Possible Causes Considered:
- **Dual-Core Synchronization**: Since this is a dual-core MCU, I suspect there might be some synchronization code left that attempts to wake up CM4, causing CM7 to wait indefinitely.
- **Linker Script**: I have reviewed the linker script but am unsure if the stack pointer (_estack) is correctly defined for CM7's RAM region.
- **Memory Configuration**: I am also wondering if the memory regions are correctly defined in the linker script, especially since CM7 and CM4 share certain memory areas.
- **ST-LINK V3 Debugger**: It's possible that the debugger configuration might be causing some issues with resetting the core.

### What I Need Help With:
- Has anyone encountered a similar issue with the STM32H755 or other STM32H7 series MCUs? Specifically with single-core operation where CM4 is not being used.
- Could this issue be related to a dual-core synchronization process that’s still present in the code, even though CM4 is disabled?
- What changes should be made in the linker script to ensure the correct stack pointer for CM7 is used?
- Any advice on how to bypass or resolve the issue with the `Reset_Handler` getting stuck?

I would greatly appreciate any help or suggestions!

Thank you in advance!

Best regards,

2 REPLIES 2

What address SPECIFICALLY is it trying to load?

Does it need to load this? Doesn't it implicitly load SP/PC to reach Reset_Handler?

You have a working Hard Fault Handler?

Settings in Option Bytes?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Super User

> I have tried stepping through the code and confirmed the program halts at the stack pointer initialization.

How exactly are you "confirming" this? What happens when you press play and then pause?

Are hardware watchdogs enabled in option bytes?

Doesn't matter if _estack is defined correctly, this statement can execute. Core sync issues also would not matter here.

If you feel a post has answered your question, please click "Accept as Solution".