Skip to main content
dandantas88
Associate II
June 26, 2015
Question

audio_playback_and_record example add uart2

  • June 26, 2015
  • 4 replies
  • 1097 views
Posted on June 26, 2015 at 20:36

audio_playback_and_record example add uart2

hello everyone.

this week i start to dev in stm32f4discovery

install cubeMX and get examples STM32Cube_FW_F4_v1.6.0

edditing audio_playback_and_record example

 

and add uart interface

1)

at this point i want to add an uart to send the ''song'' name to be played

i added the library stm32f4xx_hal_usart.c and stm32f4xx_hal_uart.c and header files(in any case )

and when i try to build it generate the error

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

because of the line 677 - see print atach

there is any point i'm missing?

i'm block at this, so i'll apreciate any help =)

there is a link to the project

https://www.dropbox.com/sh/yfdixj9nnmo7q4u/AACFoq5s_Gqy8vbY8VISjb98a?dl=0

thanks in advance

grettings from Portugal
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    June 26, 2015
    Posted on June 26, 2015 at 22:26

    Make sure HAL_UART_MODULE_ENABLED is defined in your project

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    dandantas88
    Associate II
    June 26, 2015
    Posted on June 26, 2015 at 22:47

    i added a line to my main

    #define HAL_UART_MODULE_ENABLED

    still didnt get results...

    if i right click on HAL_UART_Init(&huart2); in void USART2Init(void) called from main and do ''go to definition of HAL_UART_Init'' it show up ''source browser: ' HAL_UART_Init' - undefined Definition/Reference!

    but if i do a search in current project it found on the stm32f4xx_hal_uart.c line 240

    PS: clive1, i had read a lot of your answers...great job in helping and discuting around! hope to be alike in future

    Tesla DeLorean
    Guru
    June 26, 2015
    Posted on June 26, 2015 at 23:20

    I think it needs to be in the project's stm32f4xx_hal_conf.h , not main.c as it does no help there.

    Not a HAL/Cube user.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    dandantas88
    Associate II
    June 26, 2015
    Posted on June 27, 2015 at 00:00

    great it work

    wasnt stm32f4xx_hal_conf.h ! i put it in stm32f4xx_hal_uart.c (i describe for someone with similar error)

    but analizing the files in stm32f4xx_hal_conf.h the code line

    /* #define HAL_UART_MODULE_ENABLED     */ is comented

    now i'll migrate my code to the main project.

    Thanks a lot! how can i thank you?

    see around