개발환경 : STM32CubeIDE
MCU : stm32f411ceu6
디버거 : ST-LINK/V2
프로젝트 타입: STM32Cube
프로젝트 리포지토리 : https://github.com/mokhwasomssi/STM32Cube_Example_Project.git
1. Debug : Trace Asynchronous Sw
2. Run → Debug Configuration → STM32 Cortex-M C/C++ Application → Debugger
3. Serial Wire Viewer (SWV) enable. 사용 중인 mcu의 Core Clock 입력.
4. #include <stdio.h> 추가
main.c 에 _write 함수 작성
while 문에 printf 함수 넣음
int _write(int file, char *ptr, int len)
{
for(int i = 0; i < len; i++)
{
ITM_SendChar(*ptr++);
}
return len;
}
5. Debug(F11) -> SWV ITM Data Console 창 띄움
5. 타임 스태프 활성화 -> ITM 활성포트 0에 체크
6. Start Trace -> Resume (F8)