cancel
Showing results for 
Search instead for 
Did you mean: 

Bug report: Incorrect validation in com port initalization of nucleo (G4) BSP

lamare
Associate

When using the register callbacks feature ( USE_HAL_UART_REGISTER_CALLBACKS = 1) , the BSP does not register the default callback, causing the serial port not to work. 

Fix:

 

 
diff --git a/Drivers/BSP/STM32G4xx_Nucleo/stm32g4xx_nucleo.c b/Drivers/BSP/STM32G4xx_Nucleo/stm32g4xx_nucleo.c
index 89b0837..bd2dd97 100644
--- a/Drivers/BSP/STM32G4xx_Nucleo/stm32g4xx_nucleo.c
+++ b/Drivers/BSP/STM32G4xx_Nucleo/stm32g4xx_nucleo.c
@@ -384,7 +384,7 @@ int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init)
     /* Init the UART Msp */
     COM1_MspInit(&hcom_uart[COM]);
 #else
-    if(IsComMspCbValid == 0U)
+    if(IsComMspCbValid[COM] == 0U)
     {
       if(BSP_COM_RegisterDefaultMspCallbacks(COM) != BSP_ERROR_NONE)
       {
 
1 REPLY 1
CMYL
ST Employee

Hi @lamare 

Do you configured the uart interrupt line and Nvic ?