STM32电机培训online,大佬带你玩电机 小弟接触stm32不久,抄了标准库(v3.5)里面的例程(flash) 建了一个工程,连接时总有下面的问题,没定义的这些在stm32f10x.h都找到了定义,网上找到的一些说法都不能解决,求高手解惑,多谢先。 例程下载 Build target 'FLASH_02' linking... .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol ADC1_2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol ADC3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol BusFaultException (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol CAN_RX1_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol CAN_SCE_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel1_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel4_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel5_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel6_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel7_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel1_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel4_5_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DebugMonitor (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI0_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI15_10_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI1_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI4_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI9_5_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FSMC_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol HardFaultException (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C1_ER_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C1_EV_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C2_ER_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C2_EV_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol MemManageException (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol NMIException (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol PVD_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol PendSVC (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol RCC_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol RTCAlarm_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol RTC_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SDIO_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SPI1_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SPI2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SPI3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SVCHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SysTickHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TAMPER_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_BRK_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_CC_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_TRG_COM_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_UP_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM4_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM5_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM6_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM7_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_BRK_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_CC_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_TRG_COM_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_UP_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol UART4_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol UART5_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USART1_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USART2_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USART3_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USBWakeUp_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USB_HP_CAN_TX_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USB_LP_CAN_RX0_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol UsageFaultException (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol WWDG_IRQHandler (referred from stm32f10x_vector.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_ClearFlag (referred from main.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_ErasePage (referred from main.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_LockBank1 (referred from main.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_ProgramWord (referred from main.o). .\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_UnlockBank1 (referred from main.o). Target not created |
不然的话就会导致上面的错误。
因为stm32f10x_vector.s文件中调用了ADC1_2_IRQHandler没有定义,解决办法:(1)在外部.c文件中定义ADC1_2_IRQHandler;
(2) 把stm32f10x_vector.s文件中关于ADC1_2_IRQHandler的部分注释掉;
其余的你就可以自己推出来了
RE:库例程连接时出现Undefined symbol的问题
回复:库例程连接时出现Undefined symbol的问题
小弟接触stm32不久,抄了标准库(v3.5)里面的例程(flash) 建了一个工程,连接时总有下面的问题,没定义的这些在stm32f10x.h都找到了定义,网上找到的一些说法都不能解决,求高手解惑,多谢先。
Build target 'FLASH_02'
linking...
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol ADC1_2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol ADC3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol BusFaultException (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol CAN_RX1_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol CAN_SCE_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel1_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel4_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel5_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel6_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA1_Channel7_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel1_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DMA2_Channel4_5_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol DebugMonitor (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI0_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI15_10_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI1_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI4_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol EXTI9_5_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FSMC_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol HardFaultException (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C1_ER_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C1_EV_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C2_ER_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol I2C2_EV_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol MemManageException (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol NMIException (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol PVD_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol PendSVC (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol RCC_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol RTCAlarm_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol RTC_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SDIO_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SPI1_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SPI2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SPI3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SVCHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol SysTickHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TAMPER_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_BRK_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_CC_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_TRG_COM_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM1_UP_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM4_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM5_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM6_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM7_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_BRK_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_CC_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_TRG_COM_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol TIM8_UP_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol UART4_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol UART5_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USART1_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USART2_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USART3_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USBWakeUp_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USB_HP_CAN_TX_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol USB_LP_CAN_RX0_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol UsageFaultException (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol WWDG_IRQHandler (referred from stm32f10x_vector.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_ClearFlag (referred from main.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_ErasePage (referred from main.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_LockBank1 (referred from main.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_ProgramWord (referred from main.o).
.\obj\FLASH_02.axf: Error: L6218E: Undefined symbol FLASH_UnlockBank1 (referred from main.o).
Target not created
建议了解新库与旧库的区别
哎~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
也有可能是stm32fxxx_hal.h开头Module Selection。那边如果相应的module不打开,即使像这样#include “xxx.h”也可能会没用
並於lib內定義完成,但卻無法compiler done
求解大大