Build fail eclipse FreeRTOS I.MX7 Cortex-M4

Hi members!
I have a problem in Eclipse, I’m using Ubuntu 16.04 for compile FreeRTOS, followed this post Tutorial1 and Tutorial 2.

I work with the next files:

gcc-arm-none-eabi-4_9-2015q3 gcc-arm

and Toradex FreeRTOS

git clone -b colibri-imx7-m4-freertos-v8 git://git.toradex.com/freertos-toradex.git freertos-colibri-imx7/

but when I try to compile the Eclipse (Eclipse neon .3) show the following error:

#error This port can only be used when the project options are configured to enable hardware floating point support.

This is the make output:

make all 
Building file: ../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
Invoking: GNU ARM Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -ffreestanding -fno-builtin  -g3 -DCPU_MCIMX7D_M4 -DARM_MATH_CM4 -D__DEBUG -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/examples/imx7_colibri_m4" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/platform/CMSIS/Include" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/platform/devices" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/platform/devices/MCIMX7D/startup" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/platform/devices/MCIMX7D/include" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/platform/drivers/inc" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/platform/utilities/inc" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/rtos/FreeRTOS/Source/include" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/im7_colibri_m4_hello_word/sources" -std=c11 -MMD -MP -MF"sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.d" -MT"sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o" -c -o "sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o" "../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c"
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:79:3: error: #error This port can only be used when the project options are configured to enable hardware floating point support.
  #error This port can only be used when the project options are configured to enable hardware floating point support.
   ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:273:7: error: expected '(' before 'void'
 __asm void vPortSVCHandler( void )
       ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:285:10: error: stray '#' in program
  mov r0, #0
          ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:322:14: error: stray '#' in program
  orr r1, r1, #( 0xf << 20 )
              ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:468:11: error: stray '#' in program
  tst r14, #0x10
           ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:479:10: error: stray '#' in program
  mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY
          ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:484:10: error: stray '#' in program
sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/subdir.mk:18: recipe for target 'sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o' failed
  mov r0, #0
          ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:497:11: error: stray '#' in program
  tst r14, #0x10
           ^
make: *** [sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o] Error 1

this is my folder tree:

1568-screenshot-from-2019-04-04-17-39-15.png

make file

Please any suggestion about it? because I google it but I do not have lucky.

hi @JesusP88

Did the example using command line compile for you?

Yes, this is the output:

-- TOOLCHAIN_DIR: /home/gualberto/opt/gcc-arm-none-eabi-8-2018-q4-major/
-- BUILD_TYPE: Debug
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- Configuring done
CMake Warning in CMakeLists.txt:
  The build directory is a subdirectory of the source directory.

  This is not supported well by Eclipse.  It is strongly recommended to use a
  build directory which is a sibling of the source directory.


-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: /home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/demo_apps/hello_world/armgcc/debug
[  4%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/portable/MemMang/heap_2.c.obj
[  8%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c.obj
[ 12%] Building ASM object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S.obj
[ 16%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/demo_apps/hello_world/main.c.obj
[ 20%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/uart_imx.c.obj
[ 25%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/croutine.c.obj
[ 29%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/event_groups.c.obj
[ 33%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/list.c.obj
[ 37%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/queue.c.obj
[ 41%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/tasks.c.obj
[ 45%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/timers.c.obj
[ 50%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/ccm_analog_imx7d.c.obj
[ 54%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/ccm_imx7d.c.obj
[ 58%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/lmem.c.obj
[ 62%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/rdc.c.obj
[ 66%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/wdog_imx.c.obj
[ 70%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/utilities/src/debug_console_imx.c.obj
[ 75%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/utilities/src/print_scan.c.obj
[ 79%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c.obj
[ 83%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/pin_mux.c.obj
[ 87%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/board.c.obj
[ 91%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/clock_freq.c.obj
[ 95%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/demo_apps/hello_world/hardware_init.c.obj
[100%] Linking C executable hello_world.elf
[100%] Built target hello_world
-- TOOLCHAIN_DIR: /home/gualberto/opt/gcc-arm-none-eabi-8-2018-q4-major/
-- BUILD_TYPE: Release
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: /home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/demo_apps/hello_world/armgcc/release
[  8%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c.obj
[  8%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/demo_apps/hello_world/main.c.obj
[ 16%] Building ASM object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S.obj
[ 16%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/portable/MemMang/heap_2.c.obj
[ 20%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/uart_imx.c.obj
[ 25%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/croutine.c.obj
[ 29%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/event_groups.c.obj
[ 33%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/list.c.obj
[ 37%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/queue.c.obj
[ 41%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/tasks.c.obj
[ 45%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/rtos/FreeRTOS/Source/timers.c.obj
[ 50%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/ccm_analog_imx7d.c.obj
[ 54%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/ccm_imx7d.c.obj
[ 58%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/lmem.c.obj
[ 62%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/rdc.c.obj
[ 66%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/drivers/src/wdog_imx.c.obj
[ 70%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/utilities/src/debug_console_imx.c.obj
[ 75%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/utilities/src/print_scan.c.obj
[ 79%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c.obj
[ 83%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/pin_mux.c.obj
[ 87%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/board.c.obj
[ 91%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/clock_freq.c.obj
[ 95%] Building C object CMakeFiles/hello_world.dir/home/gualberto/freertos-colibri-imx7/examples/imx7_colibri_m4/demo_apps/hello_world/hardware_init.c.obj
[100%] Linking C executable hello_world.elf
[100%] Built target hello_world

I’m using the following tools for make this.

  • GNU Make 4.1
    Built for x86_64-pc-linux-gnu
  • Eclipse neon.3
  • cmake version 3.5.1
  • My Linux workstation: Linux gualberto-hp-g42 4.15.0-47-generic #50~16.04.1-Ubuntu SMP Fri Mar 15 16:06:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

but when I try to compile on Eclipse the following out put is showing:

make all 
Building file: ../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
Invoking: GNU ARM Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-builtin  -g3 -DCPU_MCIMX7D_M4 -D__DEBUG -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/examples/imx7_colibri_m4" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/CMSIS/Include" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/devices" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/devices/MCIMX7D/startup" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/devices/MCIMX7D/include" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/utilities/inc" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/drivers/inc" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/rtos/FreeRTOS/Source/include" -I"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F" -std=gnu11 -MMD -MP -MF"sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.d" -MT"sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o" -c -o "sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o" "../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c"
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:75:3: error: #error This port can only be used when the project options are configured to enable hardware floating point support.
sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/subdir.mk:18: recipe for target 'sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o' failed
  #error This port can only be used when the project options are configured to enable hardware floating point support.
   ^~~~~
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:263:7: error: expected '(' before 'void'
 __asm void vPortSVCHandler( void )
       ^~~~
       (
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:275:10: error: stray '#' in program
  mov r0, #0
          ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:310:14: error: stray '#' in program
  orr r1, r1, #( 0xf << 20 )
              ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:446:11: error: stray '#' in program
  tst r14, #0x10
           ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:457:10: error: stray '#' in program
  mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY
          ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:460:10: error: stray '#' in program
  mov r0, #0
          ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:473:11: error: stray '#' in program
  tst r14, #0x10
           ^
../sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:696:10: error: stray '#' in program
  mov r1, #configMAX_SYSCALL_INTERRUPT_PRIORITY
          ^
make: *** [sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o] Error 1

Could you share with me a make file for compile freertos? Maybe if I use a import makefile in eclipse could be work, or what rules do I need consider for makefile for gcc arm?

Thanks for your advice and answer.

waiting for you.

hi @JesusP88

I am sorry for the delayed answer. Here is the makefile I used. Could you try on your side, if this works for you.

Best regards,
Jaski

Hi Jaski! Thanks again for your help, finally I could compile the “hello world example”, However the compile warning me, this is the output:

Description	Resource	Path	Location	Type
cannot find entry symbol Reset_Handler; defaulting to 000000001fff8000	gpio_demo		 	C/C++ Problem

Could you explain me this? please.

In the following section I put my steps in eclipse for future revision in this community.

1.- The version of eclipse that i used: Eclipse Neon 3 (neon-3) eclipse build Id = 4.6.3.M20170301-0400

2.- I’m using Ubuntu 16.04 x64

3.- export the path :~$ export ARMGCC_DIR=${HOME}/opt/gcc-arm-none-eabi-7-2017-q4-major/ and run eclipse from this shell ~/eclipse/neon-3/eclipse$ ./eclipse

4.- I create a makefile project File>New>C project

5.- I selected Empty project > ARM Cross GCC

[upload|q0NE7VOuU0Q5ggvCmmaYNvtjElM=]

6.- Set the ARM gcc downloaded from this post

[upload|4Z5d3XOg2+8AqVoOkYXQHWYSZms=]

7.- I create the tree folder project for rtos

[upload|9rLXLHDjy25WOkKaMYpeLsmaICQ=]

8.- I added a make file to project.

make file with a little change

9.- out put compilation:

09:47:53 **** Build of configuration Default for project gpio_demo ****
make all 
Building target: gpio_demo.elf
Invoking: GNU ARM Cross C Linker
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -Wall -g3 -T  "MCIMX7D_M4_tcm.ld" -Xlinker --gc-sections -L"/home/gualberto/Documents/eclipse-work/eclipse-c-cpp/gpio_demo/sources/platform/devices/MCIMX7D/linker/gcc" -Wl,-Map,"gpio_demo.map" --specs=nano.specs --specs=nosys.specs -o "gpio_demo.elf"   
/home/gualberto/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 000000001fff8000
Finished building target: gpio_demo.elf
 
Invoking: GNU ARM Cross Create Flash Image
arm-none-eabi-objcopy -O binary "gpio_demo.elf"  "gpio_demo.bin"
Finished building: gpio_demo.bin
 
Invoking: GNU ARM Cross Print Size
arm-none-eabi-size --format=berkeley "gpio_demo.elf"
   text	   data	    bss	    dec	    hex	filename
     88	      8	   2080	   2176	    880	gpio_demo.elf
Finished building: gpio_demo.siz
 

09:47:54 Build Finished (took 833ms)

Jaski I did not upload the elf file into Cortex M4, before that, with the all last step, Do you consider that the compilation process was good? If you think that the compilation process was good I will upload the elf file inside M4.

Waiting for your feedback. thanks.

BTW: The name project is wrong because I compile the hello world example, not gpio.

// Create a demo task which will print Hello world and echo user's input.
    xTaskCreate(HelloTask, "Print Task", configMINIMAL_STACK_SIZE,
                NULL, tskIDLE_PRIORITY+1, NULL);

Hi

Hi Jaski! Thanks again for your help, finally I could compile the “hello world example”,

These are good news. Perfect that the compilation was successful.

However the compile warning me, this is the output:
cannot find entry symbol Reset_Handler; defaulting to 000000001fff8000 gpio_demo C/C++ Problem

This is strange. I would check this and come back to you.

Jaski I did not upload the elf file into Cortex M4, before that, with the all last step, Do you consider that the compilation process was good? If you think that the compilation process was good I will upload the elf file inside M4.

Actually the compilation process finished with one warning, so you can upload the .elf file into M4.

Best regards, Jaski

Hi Jaski! Any news about

cannot find entry symbol Reset_Handler; defaulting to 000000001fff8000 gpio_demo C/C++ Problem

Thanks.

Hi @JesusP88

Could you check if the symbol Reset_Handler is defined somewhere in your Project or not? The best way is to do the grep -ri Reset_Hanlder command.

Best regards,
Jaski