项目场景:
使用STM32F030R8T6进行TSM12的项目实验时,需要用到USART2端口传送数据.
问题描述
编译时出现如下提示:
..\System\usart\usart.c(43): error: #20: identifier "USART2_IRQn" is undefined
NVIC_InitStructure.NVIC_IRQChannel =USART2_IRQn;
..\System\usart\usart.c: 0 warnings, 1 error
".\TSM12_USART.axf" - 1 Error(s), 2 Warning(s).
Target not created.
原因分析:
加载文件里没有USART2中断定义!
查询USART2_IRQHandler 定义时,发现启动文件使用的是startup_stm32f0xx_ld.s,其中并无USART2_IRQHandler 项: