2025-06-23 10:59 AM - last edited on 2025-06-24 12:47 AM by Andrew Neil
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,
Solved! Go to Solution.
2025-06-24 6:12 AM - edited 2025-06-24 6:48 AM
There is no issue in your code. I've already tested it.
The solution:
Don't step over/into SCB_EnableICache/SCB_EnableDCache.. The behavior you are seeing is expected and seen on all products featuring Cortex-M7.
So put a break point at HAL_Init() and step over starting from this point and go ahead.