Skip to main content
Dean Neumann
Associate
February 18, 2020
Question

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

  • February 18, 2020
  • 3 replies
  • 1314 views

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?

This topic has been closed for replies.

3 replies

Amel NASRI
Technical Moderator
February 26, 2020

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 "Best Answer" on the reply which solved your issue or answered your question.
Dean Neumann
Associate
March 1, 2020
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
Technical Moderator
May 26, 2020

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 "Best Answer" on the reply which solved your issue or answered your question.
Amel NASRI
Technical Moderator
May 26, 2020

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 "Best Answer" on the reply which solved your issue or answered your question.
Nesrine.JLASSI
Visitor II
May 27, 2020

Hello @Dean Neumann​ 

Thanks for the feedback,

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

Best regards,

Nesrine