I am trying to compile a bare bone project with the FreeRTOS files for a ATSAMD51J20A processor, Atmel Studio 7.0 and GCC compiler and getting the following errors:
The part you are using has a floating point unit, so the correct port to
use is FreeRTOS/Source/portable/GCC/ARM_CM4F. However your command line
is not telling the compiler there is a floating point unit, so it is
balking at the floating point instructions. I suggest having Atmel
Studio create a project for that part to see the command line options it
uses - somewhere it will tell GCC which FPU the chip has - then add that
command line option to your project too.
I created a project using ATmel Studio 7.0 with ATSAMD51J20A withous any FreeRTOS files that compile without error. When I bring in the FreeRTOS files with port.c from ARM_CM4F, I get these errors. I checked all the command lines options for the compiler, assemble and Linker and they are the same. It appears that the problem is with xPortPendSVHandler() in line 470 & 497.
Don’t really know how to fix this.
Thanks,
Charles
https://imgur.com/P3SOreX is the image that shows the important
information, and indeed shows that the command line is not specifying
the part has a floating point unit.
The relevant options are: -mfpu=fpv4-sp-d16 -mfloat-abi=softfp although
these might not be quite right for your MCU - depending on the type of
FPU unit it has.
Please paste the errors into a post for prosperity (for people with
similar problems in the future to be able to see) rather than link to
temporary external sites.
Not too sure what the best way to show a screen shot. Here it is below…Thanks
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(738,1): error: undefined reference to __SRAM_segment_start__' C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(738,1): error: undefined reference to SRAM_segment_end’
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(738,1): error: undefined reference to __privileged_data_start__' C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(738,1): error: undefined reference to privileged_data_end’
FreeRTOS/port.o: In function xPortStartScheduler': C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(418,1): error: undefined reference to FLASH_segment_start’
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(418,1): error: undefined reference to __FLASH_segment_end__' C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(418,1): error: undefined reference to privileged_functions_end’
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(418,1): error: undefined reference to __privileged_data_start__' C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(418,1): error: undefined reference to privileged_data_end’
FreeRTOS/tasks.o: In function xTaskCreate': C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(814,1): error: undefined reference to pvPortMalloc’
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(814,1): error: undefined reference to vPortFree' FreeRTOS/tasks.o: In function xTaskCreateRestricted’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(724,1): error: undefined reference to pvPortMalloc' FreeRTOS/tasks.o: In function xTaskIncrementTick’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(2593,1): error: undefined reference to vApplicationTickHook' FreeRTOS/tasks.o: In function vTaskSwitchContext’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(2896,1): error: undefined reference to vApplicationStackOverflowHook' FreeRTOS/tasks.o: In function prvIdleTask’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(3266,1): error: undefined reference to vApplicationIdleHook' FreeRTOS/timers.o: In function xTimerCreate’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\timers.c(303,1): error: undefined reference to pvPortMalloc' FreeRTOS/timers.o: In function prvProcessReceivedCommands’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\timers.c(695,1): error: undefined reference to vPortFree' FreeRTOS/queue.o: In function vQueueDelete’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\queue.c(1958,1): error: undefined reference to vPortFree' FreeRTOS/queue.o: In function xQueueGenericCreate’:
C:\Users\cguggenheim\Documents\Atmel Studio\7.0\FT4X32\FT4X32\FreeRTOS\queue.c(403,1): error: undefined reference to `pvPortMalloc’
collect2.exe(0,0): error: ld returned 1 exit status
make: *** [FT4X32.elf] Error 1
The command exited with code 2.
Done executing task “RunCompilerTask” – FAILED.
Done building target “CoreBuild” in project “FT4X32.cproj” – FAILED.
Done building project “FT4X32.cproj” – FAILED.
C:\Users\cguggenheim\Documents\Atmel
Studio\7.0\FT4X32\FT4X32\FreeRTOS\port.c(738,1): error: undefined
reference to |SRAM_segment_start’
This, and similar errors, looks like you are building FreeRTOS MPU -
which is the version of FreeRTOS that supports both privileged and
unprivileged tasks. Was that intentional (it’s not normal).
This, and similar errors, looks like the file
FreeRTOS/Source/portable/MemMang/heap_x.c is missing from your build:
Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(2896,1): error: undefined
reference to |vApplicationStackOverflowHook’ FreeRTOS/tasks.o: In
function|prvIdleTask’:
C:\Users\cguggenheim\Documents\Atmel
Studio\7.0\FT4X32\FT4X32\FreeRTOS\tasks.c(3266,1): error: undefined
reference to |vApplicationIdleHook’ FreeRTOS/timers.o: In
function|xTimerCreate’:
These look like you have FreeRTOSConfig.h set to use hook (callback)
functions, but have not provided the implementations of those functions.
Any function that includes “Application” in the name is expected to be
provided by the application writer: