geoffreymbrown/STM32-Template

Exercise 4.1 does not compile - undefined reference to `assert_failed'

Closed this issue · 3 comments

Hi,
I was working my way through your book and hoping to learn how to program STM32s using the gcc tool chain. Turns out my geekyness is not high enough... Trying to compile the modified blinky from exercise 4.1 throws a lot of "undefined reference to assert_failed" from STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c

I've downloaded the library from STM just yesterday. I found two suggested 'fixes' for that, none of them made it compile.

Helpless,
Stephan

you have to include this in your code

#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
/* Infinite loop /
/
Use GDB to find out why we're here */
while (1);
}
#endif

On Sun, Sep 7, 2014 at 7:10 AM, Stephan Goldenberg <notifications@github.com

wrote:

Hi,
I was working my way through your book and hoping to learn how to program
STM32s using the gcc tool chain. Turns out my geekyness is not high
enough... Trying to compile the modified blinky from exercise 4.1 throws a
lot of "undefined reference to assert_failed" from
STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c

I've downloaded the library from STM just yesterday. I found two suggested
'fixes' for that, none of them made it compile.

Helpless,
Stephan


Reply to this email directly or view it on GitHub
#3.

d'oh...typo, haven't seen this before

#ifdef USE_FULL_ASSERT
void asset_failed(uint8_t* file, uint32_t line){ // 'r' missing
// Infinite loop
// Use GDB to find out why
while(1);

Thank you very much && have a nice sunday,
Stephan

I had the same problem too, adding ifdef USE_FULL_ASSERT di solve my problem.
Thank you!