Skip to main content
DOsbo
Associate III
February 11, 2020
Question

BUG: assert_fail() fails

  • February 11, 2020
  • 6 replies
  • 1276 views

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

This topic has been closed for replies.

6 replies

DOsbo
DOsboAuthor
Associate III
February 11, 2020

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 Technical Moderator
February 11, 2020

Hello, thank you for reporting, ticket entered.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
Khouloud ZEMMELI
ST Employee
February 11, 2020

​Hi @DOsbo​ 

Could you please share your ioc file?

Best Regards,

Khouloud

DOsbo
DOsboAuthor
Associate III
February 12, 2020

Sure.

Cheers

David

Khouloud ZEMMELI
ST Employee
February 11, 2020

​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

alister
Senior III
February 11, 2020

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