目录
硬件环境搭建
jlink下载,引脚连接:
stm32c6t6
3V3 SWO SWCLK GND
jlink的SWD 4pin接口
VT SWDIO SWCLK GND
重定向只需3步
step1
keil中,flash-->configure flash tools-->target-->勾选USEmicroLIB
step2
加代码:
/* USER CODE BEGIN PFP */
int fputc(int ch,FILE *f)
{
//
HAL_UART_Transmit(&huart1,(uint8_t *)&ch,1,HAL_MAX_DELAY);
return ch;
}
/* USER CODE END PFP */
step3
加代码:
/* USER CODE BEGIN Includes */
#include "stdio.h"
/* USER CODE END Includes */