cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with multiple definition of UART callbacks when compiling in Arduino IDE using STM32duino.

ngupt.19
Associate

I am trying to setup UART via DMA on STM32L432 Nucleo-32 to read NMEA data from NEO 6M GPS peripheral. I am using Arduino IDE for compiling. However, when I compile I am getting a multiple definition error on void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) and void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart). I checked the underlying files and found that these procedures are also defined in uart.c ( in STM32duino files) which are not weak definitions. My question is how do I use these interrupt callback routines given the above issue. Thanks for your help.

FYI I was able to setup the above microcontroller to work using polling UART without any issues. So I know that the hardware is correctly setup.

2 REPLIES 2
Fred P.
ST Employee

Hi @ngupt.19​ 

Right those callback are defined as current Serial implementation use IT so you could not redefine it without change by yourself the STM32 core (uart.c).

DMA could be a good enhancement for the Serial or at least be able to let end user redefine it.

Do not hesitate to submit an issue on the STM32duino GitHub organization or a pull request.

Best regards

https://github.com/stm32duino

Hi @ngupt.19, you can now disable the Arduino API using decicated  HAL modulet:

https://github.com/stm32duino/Arduino_Core_STM32/wiki/HAL-configuration#hal-module-only

 

So, by defining the HAL_UART_MODULE_ONLY you will be able to get HAL UART module enabled but no callback defined.

 

 

https://github.com/stm32duino