STM32F4 compile problem on example project (IOtoggle)

Asked by Amin Kamalzadeh

Hi,
I'm using STM32F407ZG with Coocox version 1.5.0.

I go through defining a new project and add the GPIO peripherals and missing "core_cm4" manually.
Up to this point, the project compiles fine.

As soon as I add the available example for GPIO, which is "IOtoggle", the compile fails giving the following errors.

Can somebody please help me to resolve the compile?

Thanks,
Amin

========================= compile and error logs.......................:

GCC HOME: C:\Program Files (x86)\GNU Tools ARM Embedded\4.6 2012q2\bin
compile:
    [mkdir] Created dir: C:\CooCox\CoIDE\workspace\test_project_17\Debug\bin
    [mkdir] Created dir: C:\CooCox\CoIDE\workspace\test_project_17\Debug\obj
       [cc] 6 total files to be compiled.
       [cc] arm-none-eabi-gcc -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -Wall -ffunction-sections -O0 -g -c -D__FPU_USED -DSTM32F407ZG -IC:\CooCox\CoIDE\workspace\test_project_17 -IC:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib -IC:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\include -IC:\CooCox\CoIDE\workspace\test_project_17\cmsis_boot -IC:\CooCox\CoIDE\workspace\test_project_17\example C:\CooCox\CoIDE\workspace\test_project_17\cmsis_boot\startup\startup_stm32f4xx.c C:\CooCox\CoIDE\workspace\test_project_17\main.c C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source\stm32f4xx_rcc.c C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source\stm32f4xx_gpio.c C:\CooCox\CoIDE\workspace\test_project_17\cmsis_boot\system_stm32f4xx.c C:\CooCox\CoIDE\workspace\test_project_17\example\IOToggle.c
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source\stm32f4xx_rcc.c: In function 'RCC_HSEConfig':
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source\stm32f4xx_rcc.c:240:3: warning: implicit declaration of function 'assert_param' [-Wimplicit-function-declaration]
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source\stm32f4xx_gpio.c: In function 'GPIO_DeInit':
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source\stm32f4xx_gpio.c:123:3: warning: implicit declaration of function 'assert_param' [-Wimplicit-function-declaration]
       [cc] Starting link
       [cc] arm-none-eabi-gcc -O0 -nostartfiles -Wl,-Map=test_project_17.map -mcpu=cortex-m4 -mthumb -LC:\CooCox\CoIDE\workspace\test_project_17 -Wl,--gc-sections -Wl,-TC:\CooCox\CoIDE\workspace\test_project_17\arm-gcc-link.ld -g -o test_project_17.elf ..\obj\startup_stm32f4xx.o ..\obj\main.o ..\obj\stm32f4xx_rcc.o ..\obj\stm32f4xx_gpio.o ..\obj\system_stm32f4xx.o ..\obj\IOToggle.o
       [cc] ..\obj\stm32f4xx_rcc.o: In function `RCC_AHB1PeriphClockCmd':
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source/stm32f4xx_rcc.c:1088: undefined reference to `assert_param'
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source/stm32f4xx_rcc.c:1090: undefined reference to `assert_param'
       [cc] ..\obj\stm32f4xx_gpio.o: In function `GPIO_Init':
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source/stm32f4xx_gpio.c:187: undefined reference to `assert_param'
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source/stm32f4xx_gpio.c:188: undefined reference to `assert_param'
       [cc] C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source/stm32f4xx_gpio.c:189: undefined reference to `assert_param'
       [cc] ..\obj\stm32f4xx_gpio.o:C:\CooCox\CoIDE\workspace\test_project_17\cmsis_lib\source/stm32f4xx_gpio.c:190: more undefined references to `assert_param' follow
       [cc] collect2: ld returned 1 exit status

BUILD FAILED
Total time: 1 second
=================================================

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Terry Guo
Solved:
Last query:
Last reply:
Revision history for this message
Best Terry Guo (terry.guo) said :
#1

Hi Amin,

The assert_param is a macro defined in file stm32f4xx_conf.h. This file will be included only when another macro USE_STDPERIPH_DRIVER is explicitly defined. You can find this in file stm32f4xx.h. The usage of assert_param is explained in where it is defined.

To solve your problem, please open "Project" -> "Configuration" and add USE_STDPERIPH_DRIVER into table "Defined symbols". Depends on how you are going to use assert_param, you may need further work.

Revision history for this message
Amin Kamalzadeh (amin-kamalzadeh) said :
#2

Thanks Terry Guo, that solved my question.

Revision history for this message
Amin Kamalzadeh (amin-kamalzadeh) said :
#3

Thanks a lot Terry,
That was straight to the point and it did resolve the problem.
Amin