Sysprogs forums › Forums › VisualGDB › Dealing with STM32 Default_Handler() DEBUG_DEFAULT_INTERRUPT_HANDLERS
- This topic has 3 replies, 2 voices, and was last updated 7 years, 6 months ago by support.
-
AuthorPosts
-
March 25, 2017 at 22:58 #10800gojimmypiParticipant
Greetings,
I was wondering if there’s a tutorial / documentation on the DEBUG_DEFAULT_INTERRUPT_HANDLERS mentioned here:
https://sysprogs.com/w/forums/topic/visual-gdb-defualt-code-dose-not-work/#post-7891
You see, I’ve found myself somehow stuck here:
void __attribute__((naked, noreturn)) Default_Handler() { //If you get stuck here, your code is missing a handler for some interrupt. //Define a 'DEBUG_DEFAULT_INTERRUPT_HANDLERS' macro via VisualGDB Project Properties and rebuild your project. //This will pinpoint a specific missing vector. for (;;) ; }
And I cannot seem to find the place mentioned: “Preprocessor Macros field on the Makefile Settings page of VisualGDB Project Properties“; I do not seem to have a “Makefile Settings” page. As the post I am referring to is almost a year old, perhaps this setting has moved? See screen snip:
https://twitter.com/gojimmypi/status/845752682685972481
Additional information: I created a sample project using the SMM32F1 Legacy Peripheral Library – then added some OLED code I found on GitHub:
https://github.com/LonelyWolf/stm32/tree/master/ST7735
I tried simply defining a DEBUG_DEFAULT_INTERRUPT_HANDLERS per the comments, but there did not seem to be any noticeable difference in code operation.
Any tips on how I ended up there & how to resolve would be appreciated. 🙂
Thanks
*edit: code formatting, odd html was included with prior copy/paste from Visual Studio
March 26, 2017 at 00:44 #10805supportKeymasterHi,
Sorry, there is not much documentation on this one. DEBUG_DEFAULT_INTERRUPT_HANDLERS is a preprocessor macro used in an #ifdef statement, so it should be specified in the place where other preprocessor macros are. It is different for different project types, but generally opening the Build Settings page of VisualGDB Project Properties, locating a similarly named field and adding the macro there should be sufficient to get it working.
March 26, 2017 at 01:24 #10806gojimmypiParticipantaha! very cool. So that’s not a VisualGDB project property, rather simply a Visual Studio one: Select Project (Right-Click) Properties;
Configuration Properties; c/c++; Preprocessor
Pasted on the end line this:
%(ClCompile.PreprocessorDefinitions);DEBUG=1;DEBUG_DEFAULT_INTERRUPT_HANDLERS
and so now when I simply run, there’s a new automatic breakpoint here:
void __attribute__ ((weak)) SysTick_Handler() { //If you hit the breakpoint below, one of the interrupts was unhandled in your code. //Define the following function in your code to handle it: // extern "C" void SysTick_Handler(); asm("bkpt 255"); }
…complete with suggestion as to what to do; indeed the code in my specific case seems to have not properly implemented some sort of delay / interrupt initializer.
very cool @Sysprogs finding stray #C/#C++ undefined interrupts #VisualGDB complete with code suggestion https://t.co/PZA5BYwJPq pic.twitter.com/r0xF0TA8xB
— gojimmypi (@gojimmypi) March 26, 2017
That’s a very cool feature of VisualGDB 🙂
March 28, 2017 at 04:34 #10815supportKeymasterHi,
No problem. If you are using MSBuild, you can use the regular VS Project Properties as well. For other build systems like GNU Make the VisualGDB Project Properties will be the right place to go.
-
AuthorPosts
- You must be logged in to reply to this topic.