Error compiling Port.c on Eclipse

Hardware - Toradex Aster Board with i.MX7 SOM.
IDE - Eclipse

I am using Eclipse IDE for compiling examples given by FreeRTOS.
Example chosen is imx7_colibri_m4/demo_apps/blinking_imx_demo
I have done all the necessary setting in the Eclipse so as to add the
include paths yet the following error occurs,
recipe for target ‘sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o’ failed

Please help me resolve the problem.

Are you using a managed build or your own makefile?

means something is wrong with the makefile (managed or otherwise).

1 Like

Thank you @RealtimeRik for replying promptly!

I am using a managed build only. What would you recommend to solve the error?

You haven’t really given enough information (although someone else may have had a similar issue). If there any more information about the failure?

Try and do a clean and then refresh and see if it helps?

Are other files building OK in the project?

I tried cleaning and refreshing the whole project and even tried out changing some header file paths.

Currently the single port.c is facing compiling issues. All other files are OK!

I am adding these errors for information.

S/Source/portable/RVDS/ARM_CM4F/port.c
Invoking: GNU ARM Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -g -DCPU_MCIMX7D_M4 -DARM_MATH_CM4 -D__DEBUG -I/home/yadnesh/eclipse-workspace/led_blinking/sources -I/home/yadnesh/eclipse-workspace/led_blinking/sources/rtos/FreeRTOS/Source/include -I/home/yadnesh/eclipse-workspace/led_blinking/sources/rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F -I/home/yadnesh/eclipse-workspace/led_blinking/sources/examples/imx7_colibri_m4 -I/home/yadnesh/eclipse-workspace/led_blinking/sources/platform/CMSIS/Include -I/home/yadnesh/eclipse-workspace/led_blinking/sources/platform/devices -I/home/yadnesh/eclipse-workspace/led_blinking/sources/platform/devices/MCIMX7D/startup -I/home/yadnesh/eclipse-workspace/led_blinking/sources/platform/devices/MCIMX7D/include -I/home/yadnesh/eclipse-workspace/led_blinking/sources/platform/utilities/inc -I/home/yadnesh/eclipse-workspace/led_blinking/sources/platform/drivers/inc -isystem/home/yadnesh/eclipse-workspace/led_blinking/sources/rtos/FreeRTOS/Source/include -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:84:3: error: #error This port can only be used when the project options are configured to enable hardware floating point support.
84 | #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:218:7: error: expected ‘(’ before ‘void’
218 | __asm void vPortSVCHandler( void )
| ^~~~
| (
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:229:10: error: stray ‘#’ in program
229 | mov r0, #0
| ^
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:262:14: error: stray ‘#’ in program
262 | orr r1, r1, #( 0xf << 20 )
| ^
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:352:11: error: stray ‘#’ in program
352 | tst r14, #0x10
| ^
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:363:10: error: stray ‘#’ in program
363 | mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY
| ^
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:366: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
366 | mov r0, #0
| ^
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:379:11: error: stray ‘#’ in program
379 | tst r14, #0x10
| ^
…/sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c:573:10: error: stray ‘#’ in program
573 | mov r1, #configMAX_SYSCALL_INTERRUPT_PRIORITY
| ^
make: *** [sources/rtos/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.o] Error 1
“make all” terminated with exit code 2. Build might be incomplete.

15:34:54 Build Failed. 11 errors, 0 warnings. (took 373ms)

Why are you using the RVDS Cortex-M4 port? You should be using the GCC port.

With GCC Port it shows errors in heap_x.c programs.

You must use the GCC port otherwise it won’t work. Also you should only include 1 of the heap_x.c files in the build. I normally use heap_4.c. Either remove the other files or exclude them from the build.

1 Like

This has solved the problem! Loads of thanks to you. I used heap_4.c file only.
Thank you :slight_smile:

1 Like