-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[reset] Unable to reset board in gdb #254
Comments
Please test against |
I can reliably debug with my current toolchain and stlink on a STM32F4 CMSIS project. Unfortunately I cannot easily go back to the toolchain I had 2 years ago, but I doubt it has much value. I did notice while testing that doing a kill/run in gdb would produce:
I found that I can: a. Instead of kill/run, I can kill, then "target remote :4242" to re-attach and it is waiting for me in ResetHandler() Is this expected? |
Thank you for testing, that is a good answer. I have currently no clue what is expected (by others) and why it is solved by using gdb 7.11. I have seen similar problems when running under ChibiOS RTOS also under OpenOCD. This needs more investigation by others who may or may not reproduce the problem. |
To me: "even pressing the reset button doesn't reset it" is a red flag. The hardware reset should always work. What possibly might not be working is that the debugger catches the processor as it comes out of reset. In that case Chibios will be crashed in "unhandled exception" before you get to move your finger from the reset button to your keyboard. |
You are right, I have no clue how OpenOCD handles this nicely. Again the gdb-stubs in stlink are in a very bad shape currently (as you know yourself). |
@Nightwalker-87 |
The observed behaviour obviously derived from the following issues:
With this conclusion based on a final review of the related topic we can safely close this ticket as resolved. |
I am using ChibiOS-2.6.5 and attempting to integrate the CMSIS library for DSP functionality.
My board is a STM32F407-Discovery and my toolchain was generated using Gentoo's crossdev package, with the following:
gcc-4.7.3 (compiled arm-hardfloat-eabi)
binutils-2.23.2
newlib-2.0.0
gdb-7.6.2
So far, the process of compile, flash, debug, repeat has worked great on this, as well as another project using a STM32L151 chip.
After adding linking the CMSIS library into my project, I have found that I cannot debug reliably. If I attach to the gdb server, it will often be in the ChibiOS unhandled_exception() handler, or maybe __gnu_unwind_execute(), I assume after hitting an exception condition.
Oddly though, I cannot reset the board in gdb with kill/run. Doing so ends up right where it was before, even with a breakpoint in the ResetHandler() function. Even pressing the reset button on the devkit doesn't reset it. I have to use 'load' with gdb, sometimes pressing the reset button while loading the firmware before it works fully.
I am wondering if this is a known issue, and if there is anything I can do to debug or work around it?
The text was updated successfully, but these errors were encountered: