cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with STM32Cube libraries

MikeDB
Lead
Posted on November 10, 2014 at 02:34

I am developing a product on an STM32F4Discovery using Keil UV5 and the STM32 Cube libraries.  Mostly this has been straightforward but for some reason the USART functions were not included in the demo audio project.  I use the HAL_USART_Init() function so added stm32f4xx_hal_usart.c to the Drivers/HAL group with the Manage Project Items tool and included stm32f4xx_hal_usart.h in main.h.  Everything compiles ok until the end when I get the message :

STM32F4-DISCO\STM32F4-DISCO.axf: Error: L6218E: Undefined symbol HAL_USART_Init (referred from main.o).

I have rebuilt all target files but this doesn't go away.  Has anybody got the HAL_USART file to work, or have suggestions on what I am doing wrong ?

(Please note I do want to use the HAL functions and not write direct to any hardware)

Many thanks

#stm32-usart
4 REPLIES 4
Amel NASRI
ST Employee
Posted on November 13, 2014 at 11:10

Hi Mike,

Is the UART driver included in your project tree?

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

MikeDB
Lead
Posted on November 14, 2014 at 21:59

I've included stm32f4xx_hal_usart.c.  Is this the file you mean or is there another ?

MikeDB
Lead
Posted on November 17, 2014 at 20:54

If anybody else gets this same problem check you don't have

#define HAL_UART_MODULE_ENABLED commented out

in STM32xx_hal_conf.h.  Seems ST doesn't expect many people to use the USARTs as default as plenty of other things I can't imagine using aren't commented out.

Amel NASRI
ST Employee
Posted on November 18, 2014 at 14:48

Hi,

As described in

http://www.st.com/web/en/resource/technical/document/user_manual/DM00105879.pdf

, ''stm32f4xx_hal_conf.h'' is a file that allows  the user to customize the HAL drivers for a specific application.

Please have a look to this user manual, it should be helpful.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.