My app will sometimes just freeze -- it stops logging and responding to network requests. I'd like to interrupt it and drop into the GDB stub and look at the thread/task stacks. Is there a way to do this? I can't find a monitor command for it.
My dev board (a SparkFun ESP32 Thing) has two physical buttons, but one just restarts the app and the other does nothing. Maybe there's a way to hook up the second button to raise an NMI whose handler will drop into the GDB stub?
(I know about the task watchdog; it isn't triggering. I suspect what I have is a deadlock, not an infinite loop.)
Debugging a deadlock/hang
Re: Debugging a deadlock/hang
Just FYI, The other does not do anything, it's used to manually put it into programming mode.
Just create another task that spits something like the time to the serial port every second.
If that stops working then you know you have bigger issues.
Start slapping them into your networking task as well, to see where the "hang / lockup" is.
Start spitting out your uxTaskGetStackHighWaterMark, to see if your running out of memory for your task.
printf, is one of your greatest helpers.it stops logging and responding to network requests.
Just create another task that spits something like the time to the serial port every second.
If that stops working then you know you have bigger issues.
Start slapping them into your networking task as well, to see where the "hang / lockup" is.
Start spitting out your uxTaskGetStackHighWaterMark, to see if your running out of memory for your task.
Re: Debugging a deadlock/hang
Memory problems tend to cause crashes rather than hangs. I once had an annoying hang from corruption by a buffer overflow due to my sloppy coding.
Who is online
Users browsing this forum: No registered users and 90 guests