Printf debugging
AN4989
76/118
AN4989 Rev 3
library which split trace between stimulus based on their importance (info, debug,
error) or there source.
STM32CubeIDE
With STM32CubeIDE you also have to redirect printf to SWO by some piece of code.
With syscall.c integrated to the project:
#include "stdio.h"
int __io_putchar(int ch)
{
ITM_SendChar(ch);
return(ch);
}
Without syscall, add:
int _write(int file, char *ptr, int len)
{
int DataIdx;
for (DataIdx = 0; DataIdx < len; +)
{
__io_putchar(*ptr++);
}
return
len;
}
Enable SWD in Debug configuration ? Debugger pane (see
Core clock must be the same as Cortex clock. You can then start the debug session.
Содержание STM32 Series
Страница 46: ...Connecting to the board AN4989 46 118 AN4989 Rev 3 Figure 30 Keil hotplug step2 ...
Страница 91: ...AN4989 Rev 3 91 118 AN4989 Debug through hardware exploration 117 Figure 69 STM32F4 F7 dual MCO capabilities ...
Страница 103: ...AN4989 Rev 3 103 118 AN4989 Managing DBGMCU registers 117 Figure 78 Generator Options debug MCU in STM32CubeIDE ...