Hi All,
I am having trouble building a project in the Eclipse IDE (OPENOCD) to use the I2C, I am using the ST standard library, the olimex ARM-USB-OCD JTAG and the Olimex H103 board with STM32F103 chip. After a lot of tweaking around after receiving many errors, building now seems to fail with only the below error (many of it though!):
D:\OlimexODS\projects_STM32\STM32-H103_flash-I2C/lib/stm32f10x_i2c.c:165: undefined reference to `assert_param'
main.o: In function `I2C_Init':
D:\OlimexODS\projects_STM32\STM32-H103_flash-I2C/lib/stm32f10x_i2c.c:198: undefined reference to `assert_param'
D:\OlimexODS\projects_STM32\STM32-H103_flash-I2C/lib/stm32f10x_i2c.c:199: undefined reference to `assert_param'
D:\OlimexODS\projects_STM32\STM32-H103_flash-I2C/lib/stm32f10x_i2c.c:200: undefined reference to `assert_param'
D:\OlimexODS\projects_STM32\STM32-H103_flash-I2C/lib/stm32f10x_i2c.c:201: undefined reference to `assert_param'
main.o:D:\OlimexODS\projects_STM32\STM32-H103_flash-I2C/lib/stm32f10x_i2c.c:202: more undefined references to `assert_param' follow
make: *** [main.out] Error 1
After some searching, I found people recommending including the file “stm32f10x_conf.h” in every “.c” file, which didn’t sound right for me, and didn’t work as well! I have found though that the definition for this “assert_param” is mentioned in the “stm32f10x_conf.h” file as:
#ifdef  DEBUG
/*******************************************************************************
* Macro Name     : assert_param
* Description    : The assert_param macro is used for function's parameters check.
*                  It is used only if the library is compiled in DEBUG mode. 
* Input          : - expr: If expr is false, it calls assert_failed function
*                    which reports the name of the source file and the source
*                    line number of the call that failed. 
*                    If expr is true, it returns no value.
* Return         : None
*******************************************************************************/ 
  #define assert_param(expr) ((expr) ? (void)0 : assert_failed((u8 *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
  void assert_failed();//u8* file, u32 line);
#else
  #define assert_param(expr) ((void)0)
#endif /* DEBUG */
As i said, I tried including the file, but it still insists that it’s “undefined reference” 
I had worked the board with USART with no problems, I am not sure why the I2C is such a trouble!  
 
Help very much appreciated 
 I would appreciate a little more clarification on that. I am new to makefiles, gcc, and STM32 as well…
 I would appreciate a little more clarification on that. I am new to makefiles, gcc, and STM32 as well…