今天配置Usart.c和Usart.h串口通讯文件时编译后报错。
Error: L6200E: Symbol USART1_IRQHandler multiply defined (by usart.o and stm32f10x_it.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
经过了漫长的检查,发现程序本身的编写没有错误,然后右键单击报错的中断函数void USART1_IRQHandler(void),尝试性的点了下Go to Definition of......
发现它跳转到了stm32f10x_it.c文件中的USART1_IRQHandler(),但是在同一个工程中,不可以出现两个相同的中断函数,所以这个报错的原因就是stm32f10x_it.c文件中重复定义了USART1_IRQHandler()函数。
那么解决报错就很简单了,方案有以下两种:
1.将stm32f10x_it.c文件中的USART1_IRQHandler()函数删去。
2.将Usart.c中的USART1_IRQHandler()函数的内容填入到stm32f10x_it.c中,然后将Usart.c文件中的USART1_IRQHandler()函数删去。(因为在stm32工程文件中stm32f10x_it.c文件原本的功能就是管理中断函数)。