Hi. I'm a newbie coding for an STM32F4 Discovery board. I'm working with some modified sample code and when I try to debug it, I'm getting stuck at "BKPT 0XAB", and I can't progress any further.
Can someone help me understand what causes this and how I can fix it?
Ok, but just be clear you shouldn't be #include'ing .C files, this will charge the ownership to the file doing the #include, you simply add the .C file to the project.
If you don't want to add files to the project, you'd paste something like this directly into the primary source file.
//****************************************************************************** // Hosting of stdio functionality through ITM/SWV //****************************************************************************** #include <stdio.h> #include <rt_misc.h> #pragma import(__use_no_semihosting_swi) struct __FILE { int handle; /* Add whatever you need here */ }; FILE __stdout; FILE __stdin; int fputc(int ch, FILE *f) { ITM_SendChar(ch); return(ch); } int fgetc(FILE *f) { char ch = 0; return((int)ch); } int ferror(FILE *f) { /* Your implementation of ferror */ return EOF; } void _ttywrch(int ch) { ITM_SendChar(ch); } void _sys_exit(int return_code) { label: goto label; /* endless loop */ } //******************************************************************************
When using SWV via the trace set up you must set the frequency of the processor correctly for the data to show up in the Serial Debug (printf) tab.