cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: assert_fail() fails

DOsbo
Senior

Micro: STM32F030RCTx.

Compiler: GCC 9.2.1

Package: FW_F0 V1.11.0

When USE_FULL_ASSERT is enabled, STM32CubeMX generates this function in main.c:

void assert_failed(char *file, uint32_t line)
{
...
}

however the prototype in stm32f0xx_hal_conf.h has been changed to this:

void assert_failed(uint8_t* file, uint32_t line);

This causes a compile error from GCC "error: conflicting types for 'assert_failed'"

Easy fix, so I hope it makes it for the next release 🙂

Cheers

David

6 REPLIES 6
DOsbo
Senior

Obviously someone changed the prototype, but forgot to update the function. It happens all the time, but the funny thing is the change to uint8_t* is not correct anyway. I think it should be changed to const char*, or at least keep it at char*.

Mike_ST
ST Employee

Hello, thank you for reporting, ticket entered.

Khouloud ZEMMELI
ST Employee

​Hi @DOsbo​ 

Could you please share your ioc file?

Best Regards,

Khouloud

Khouloud ZEMMELI
ST Employee

​To avoid errors , Code generated from CubeMX should be aligned with stm32f0xx_hal_conf.h .

Then @Mike_ST​ will check the second point reported (const char*, char*..).

for the first one, issue will be fixed in the next CubeMX release.

Regards,

Khouloud

void assert_failed(const char *file, uint32_t line);

Sure.

Cheers

David