cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX for G4 deleting function name HAL_FDCAN_GetRxMessage in HAL driver

facotti1
Associate II

Hi all,

I'm encountering a strange behaviour of STM32CubeMX: from some point on, every time I update the IOC file the generated code is missing the FDCAN function name HAL_FDCAN_GetRxMessage.

Obviously this results in a build error; the function declaration in driver file stm32g4xx_hal_fdcan.h is correct:

HAL_StatusTypeDef HAL_FDCAN_GetRxMessage(FDCAN_HandleTypeDef *hfdcan, uint32_t RxLocation, FDCAN_RxHeaderTypeDef *pRxHeader, uint8_t *pRxData);

While in stm32g4xx_hal_fdcan.c function name is missing:

HAL_StatusTypeDef (FDCAN_HandleTypeDef *hfdcan, uint32_t RxLocation, FDCAN_RxHeaderTypeDef *pRxHeader, uint8_t *pRxData)
{
uint32_t *RxAddress;
uint8_t *pData;
uint32_t ByteCounter;
uint32_t GetIndex;
HAL_FDCAN_StateTypeDef state = hfdcan->State;
//... other code
}

So I add manually the function name in .c file and everything works, but the next time I generate the code the function name will be deleted again.

Is there a way to avoid this or maybe can it be a CubeMX bug?

I'm using:

- STM32CubeIDE v1.14.0

- STM32CubeMX 6.10.0-RC9 integrated in IDE

- STM32Cube MCU Package for STM32G4 v1.5.1

 

Thanks,

agostino

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

It's definitely defined correctly in the latest library version:

https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/a23ffa48610f70f9dd7ce867502d9390f7f1dcab/Src/stm32g4xx_hal_fdcan.c#L2220

Perhaps your library files got edited/corrupted somehow. Perhaps remove and re-download the G4 package.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

It's definitely defined correctly in the latest library version:

https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/a23ffa48610f70f9dd7ce867502d9390f7f1dcab/Src/stm32g4xx_hal_fdcan.c#L2220

Perhaps your library files got edited/corrupted somehow. Perhaps remove and re-download the G4 package.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks @TDK ! You're totally right 🙂

Uninstalled and reinstalled the G4 package everything now works correctly!