We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I created a project on STM32F407ZET6 with Keil µVision V5 14.0.0.
When build project I have these errors:
compiling main.c... compiling os_app_hooks.c... linking... .\Flash\Obj\output.axf: Error: L6218E: Undefined symbol UART1_Init (referred from bsp.o). .\Flash\Obj\output.axf: Error: L6218E: Undefined symbol UART3_Init (referred from bsp.o). .\Flash\Obj\output.axf: Error: L6218E: Undefined symbol UART1_RxDMA_ReceiveLeftStr (referred from main.o). Not enough information to list image symbols. Finished: 1 information, 0 warning and 3 error messages. ".\Flash\Obj\output.axf" - 3 Error(s), 3 Warning(s). Target not created. Build Time Elapsed: 00:00:33
I have included .h files, and added .c files to project group.
Thanks!
Because have writed description, so there's no post codes.
some codes in bsp_uart.c:
#include "bsp.h" /***************************** USART1 Definition *****************************/ static OS_EVENT *UART1Sem; static UART_Data_t Uart1_Data; static COMM_Q_char UART1_RxTmpBuf[UART1_FIFO_LENGTH + 1]; static DMA_InitTypeDef DMA_UART1TxStructure; static DMA_InitTypeDef DMA_UART1RxStructure; /*************************** End USART1 Definition ***************************/ /***************************** USART3 Definition *****************************/ static OS_EVENT *UART3Sem; static UART_Data_t Uart3_Data; /*************************** End USART3 Definition ***************************/ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // USART1 Function // USART1 work with DMA mode using DMA2_Stream5 and DMA2_Stream7. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /*+++++ association code +++++*/ /****************************************************************************** * UART1_Init() * * Description : Initialize the USART1 peripheral. * Argument(s) : none. * Return(s) : TRUE or FALSE. * Caller(s) : BSP_Init(). * Note(s) : none ******************************************************************************/ u8 UART1_Init(void) { COMM_Q_Status tmpSts; UART1_GPIO_Config(); UART1_Config(); UART1_DMA_Config(); UART1_NVIC_Config(); tmpSts = COMM_QCreate(&Uart1_Rx_Q, Uart1_Data.RxBuffer, UART1_RxBufferSize); if (tmpSts == COMM_Q_FAILURE) { return FALSE; } tmpSts = COMM_QCreate(&Uart1_Tx_Q, Uart1_Data.TxBuffer, UART1_TxBufferSize); if (tmpSts == COMM_Q_FAILURE) { return FALSE; } UART1Sem = OSSemCreate(1); if (UART1Sem == NULL) { return FALSE; } return TRUE; } /*+++++ association code +++++*/ /****************************************************************************** * UART3_Init() * * Description : Initialize the USART3 peripheral. * Argument(s) : none. * Return(s) : TRUE or FALSE. * Caller(s) : BSP_Init(). * Note(s) : none ******************************************************************************/ u8 UART3_Init(void) { COMM_Q_Status tmpSts; UART3_GPIO_Config(); UART3_Config(); UART3_DMA_Config(); UART3_NVIC_Config(); tmpSts = COMM_QCreate(&Uart3_Rx_Q, Uart3_Data.RxBuffer, UART3_RxBufferSize); if (tmpSts == COMM_Q_FAILURE) { return FALSE; } tmpSts = COMM_QCreate(&Uart3_Tx_Q, Uart3_Data.TxBuffer, UART3_TxBufferSize); if (tmpSts == COMM_Q_FAILURE) { return FALSE; } UART3Sem = OSSemCreate(1); if (UART3Sem == NULL) { return FALSE; } return TRUE; } /*+++++ association code +++++*/ /****************************************************************************** * UART1_RxDMA_ReceiveLeftStr() * * Description : * Argument(s) : none. * Return(s) : none. * Caller(s) : none. * Note(s) : none ******************************************************************************/ void UART1_RxDMA_ReceiveLeftStr(void) { u16 i; COMM_QPushStr(&Uart1_Rx_Q, UART1_RxTmpBuf); DMA_Cmd(DMA2_Stream5, DISABLE); DMA_UART1RxStructure.DMA_MemoryBaseAddr = (u32)UART1_RxTmpBuf; DMA_UART1RxStructure.DMA_BufferSize = (u32)UART1_FIFO_LENGTH; DMA_Init(DMA2_Stream5, &DMA_UART1RxStructure); DMA_Cmd(DMA2_Stream5, ENABLE); for (i=0; i<UART1_FIFO_LENGTH+1; i++) { UART1_RxTmpBuf[i] = 0; } }
Finded the reason of error.
Click the right mouse button to view file "bsp_uart.c" options, The 'Path' is wrong, correct path and rebuild project, compiling is OK.