5 years, 12 months ago.

Error: Symbol HAL_UART_TxCpltCallback multiply defined

I currently am trying to transmit UART using the DMA. One of the DMA callback functions executed after transmitting is:

void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart);

This is a weak function that can be overwritten to add my own functionality. However, after doing so, the mbed compiler shows me the following error:

Error: Symbol HAL_UART_TxCpltCallback multiply defined (by /extras/mbed/TARGET_DISCO_F746NG/TOOLCHAIN_ARM_STD/serial_device.o and ../../build/DmaToUart.DISCO_F746NG.o).

I tried overriding/intercepting the function. Ideally, I would register a different callback function. How can I solve this?

1 Answer

5 years, 12 months ago.

Hello Alex,

Since MBED has already ovewritten the HAL_UART_TxCpltCallback weak function in the serial_device.c file I'm afraid that your only option is to modify it there using the CLI. (Or perhaps to modify the UART_DMATransmitCplt function in the stm32f7xx_hal_uart.c file.)