cancel
Showing results for 
Search instead for 
Did you mean: 

stm32l4xx_hal_conf.h declaration of assert_failed() broken in STM32Cube_FW_L4_V1.15.0 ?

Dean Neumann
Associate II

the file stm32l4xx_hal_conf.h in firmware repository STM32Cube_FW_L4_V1.15.0

contains a datatype mismatch in parameter 1 between the invokation and declaration of assert_failed() :

#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
void assert_failed(char *file, uint32_t line);

The compiler correctly warns of this mismatch when compiling stm32l4xx_hal_dma.c, stm32l4xx_hal_flash.c, stm32l4xx_hal_exti.c, stm32l4xx_hal_flash_ex.c, etc.

stm32l4xx_hal_conf.h:437:65: warning: pointer targets in passing argument 1 of 'assert_failed' differ in   signedness [-Wpointer-sign]

Earlier versions of stm32l4xx_hal_conf.h did not contain this mismatch:

#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
void assert_failed(uint8_t* file, uint32_t line);

Why was this change introduced, and will it be corrected?

5 REPLIES 5
Amel NASRI
ST Employee

Hi @Dean Neumann​ ,

Could you please precise which compiler are you using?

Thanks,

Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Amel I am using the gcc compiler that was installed by the STM32CubeIDE package. However it is easy to see the parameter mismatch in the lines of code I included in my message. It is not compiler dependent.
Regards,
Dean
Amel NASRI
ST Employee

Hello @Dean Neumann​ ,

I checked that there is no more such issue With STM32CubeMX 5.6. Please check again on your side.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Please ignore about my previous comment, I checked for STM32F0 where there is no such issue. For STM32L4, problem is still there.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @Dean Neumann​ 

Thanks for the feedback,

Issue confirmed, it will be fixed as soon as possible.

Best regards,

Nesrine