SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By naveed_33
Hi, i have written a very simple code for my controller (i am a newbie to stm32 controller programming) and the code gives following errors
123.axf: Error: L6218E: Undefined symbol assert_param (referred from misc.o).
i have included the files misc.c in the std peripherals library too.
and i have absolutely no idea how to remove them and make my code work kindly help. i will share my code here too

#include "stm32f2xx.h"
#include "stm32f2xx_gpio.h"
#include "stm32f2xx_spi.h"
#include "misc.h"
#include "stm32f2xx_rcc.h"

int main()
int x;
while (1)

By naveed_33
and there is one more warning stating the following:
\STM32F2xx_StdPeriph_Driver\src\misc.c(220): warning: #223-D: function "assert_param" declared implicitly
and it comes many times in every library file how can i remove it
By fll-freak
assert_param is an object (variable, function, ...) that is not being resolved during link. Other routines are expecting it to be available, but the linker can't find it. The most likely reason is that you are not compiling the code that defines it. I would suggest grep-ing the source code tree looking for this assert_param. You should find many references/calls to it, but only one place should it be defined. Once you find the definition, you need to make sure you compile and link that in as well.

The other possibility is that you have a "linker loop". Module A needs something in Module B that needs something back in Module A. Sometimes a compiler just can't resolve this issues and you need to fix the problem yourself. I hope this is not the case as they are often difficult to resolve.
By UhClem
This problem has turned up here before (search using "assert_param" to find that discussion).

There is no function assert_param(). It is a macro in stm32f2xx.h that should result in a call to either assert_failed() if you are using this feature ("#define USE_FULL_ASSERT") or void() if you are not.

Your code is fine but the compilation of the standard peripheral library code (stm32f2xx_gpio.c, etc.) is not. As I recall you need to define the symbol USE_STDPERIPH_DRIVER and there is an option block in the file st32f2xx.h to do just that.