Processor stuck if I run code without debugger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 1:52 AM
Hello.
I have developed an application with touchgfx, lwip, freertos.
I had some problems with lwip (see processor goes to HardFault at __ISB - STMicroelectronics Community, HardFault_Handler when enable LWIP and touchgfx - STMicroelectronics Community).
I understand some causes of HardFault and this morning code seems to work properly.
I tried to run the code without debugger but my processor stuck in some point that I can't see because I have no debugger connected.
I reconnect debugger, reflash and rerun. After this operations I obtain the problem described in processor goes to HardFault at __ISB - STMicroelectronics Community
Why processor run with debugger but it stucks without it ?
Thankyou in advance.
Solved! Go to Solution.
- Labels:
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 2:09 AM
@MauFanGilaMedical wrote:I tried to run the code without debugger but my processor stuck in some point that I can't see because I have no debugger connected.
Add instrumentation so that you can see where it's hanging; eg,
- UART output;
- LEDs;
- Pins observable on scope/logic analyser;
- etc, ...
LwIP debug output: https://community.st.com/t5/stm32-mcus/using-the-itm-console-for-printf-redirects-and-lwip-debug/ta-p/723472
@MauFanGilaMedical wrote:Why processor run with debugger but it stucks without it ?
Suggests a timing issue:
- Debugger adds some start-up delays - so code works;
- Without debugger, no delays, so something(s) is/are not ready - so doesn't work.
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 2:09 AM
@MauFanGilaMedical wrote:I tried to run the code without debugger but my processor stuck in some point that I can't see because I have no debugger connected.
Add instrumentation so that you can see where it's hanging; eg,
- UART output;
- LEDs;
- Pins observable on scope/logic analyser;
- etc, ...
LwIP debug output: https://community.st.com/t5/stm32-mcus/using-the-itm-console-for-printf-redirects-and-lwip-debug/ta-p/723472
@MauFanGilaMedical wrote:Why processor run with debugger but it stucks without it ?
Suggests a timing issue:
- Debugger adds some start-up delays - so code works;
- Without debugger, no delays, so something(s) is/are not ready - so doesn't work.
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 2:24 AM
yes, you are right... I'm doing now..thankyou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 6:31 AM
@MauFanGilaMedical wrote:I tried to run the code without debugger but my processor stuck in some point that I can't see because I have no debugger connected.
Note that you can attach the debugger to an already-running system - so you can see where it is "stuck":
Disable the Reset:
Disable the download:
and you don't want it doing a build:
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-15 1:22 AM
@MauFanGilaMedical - I think you're a bit premature in marking my post as the solution: that post just contains some suggestions for how to debug the issue - it's not actually a solution to the problem.
See this for how to un-mark a solution.
Take a look at the two posts by @Guillaume K in this thread:
https://community.st.com/t5/stm32-mcus-embedded-software/stm32f767-lwip-tcp-client/m-p/778561
do they address your issue?
In particular, are you getting the mentioned ERR_RTE error?
A complex system designed from scratch never works and cannot be patched up to make it work.
