Compiler errors with ATSAMD51J20A and FreeRTOS

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: https://imgur.com/7QNwXGx Here are my compiler settings: https://imgur.com/dGvFUdy I tried to use the port from ARMCM3, ARMCM3MPU, ARMCM4MPU and ARMCM4F without success. Any ideas? Thanks, Charles

Compiler errors with ATSAMD51J20A and FreeRTOS

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.

Compiler errors with ATSAMD51J20A and FreeRTOS

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

Compiler errors with ATSAMD51J20A and FreeRTOS

Here are my command line option: https://imgur.com/h2tesSC https://imgur.com/P3SOreX https://imgur.com/xwf222m

Compiler errors with ATSAMD51J20A and FreeRTOS

One more link: https://imgur.com/nX3joVm

Compiler errors with ATSAMD51J20A and FreeRTOS

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. See this thread: https://www.freertos.org/FreeRTOSSupportForumArchive/December2012/freertosSTM32F4GCCcompilationproblems_6404907.html 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.

Compiler errors with ATSAMD51J20A and FreeRTOS

I added -mfpu=fpv4-sp-d16 and -mfloat-abi=softfp but now I am getting some link errors with port.c ,task.c, timer.c and queue.c Here are the errors: https://imgur.com/Bc6Mo3M

Compiler errors with ATSAMD51J20A and FreeRTOS

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.

Compiler errors with ATSAMD51J20A and FreeRTOS

Not too sure what the best way to show a screen shot. Here it is below…Thanks C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(738,1): error: undefined reference to __SRAM_segment_start__' C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(738,1): error: undefined reference toSRAMsegmentend‘ C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(738,1): error: undefined reference to __privileged_data_start__' C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(738,1): error: undefined reference toprivilegeddataend‘ FreeRTOS/port.o: In function xPortStartScheduler': C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(418,1): error: undefined reference toFLASHsegmentstart‘ C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(418,1): error: undefined reference to __FLASH_segment_end__' C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(418,1): error: undefined reference toprivilegedfunctionsend‘ C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(418,1): error: undefined reference to __privileged_data_start__' C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(418,1): error: undefined reference toprivilegeddataend‘ FreeRTOS/tasks.o: In function xTaskCreate': C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.c(814,1): error: undefined reference topvPortMalloc’ C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.c(814,1): error: undefined reference to vPortFree' FreeRTOS/tasks.o: In functionxTaskCreateRestricted’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.c(724,1): error: undefined reference to pvPortMalloc' FreeRTOS/tasks.o: In functionxTaskIncrementTick’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.c(2593,1): error: undefined reference to vApplicationTickHook' FreeRTOS/tasks.o: In functionvTaskSwitchContext’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.c(2896,1): error: undefined reference to vApplicationStackOverflowHook' FreeRTOS/tasks.o: In functionprvIdleTask’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.c(3266,1): error: undefined reference to vApplicationIdleHook' FreeRTOS/timers.o: In functionxTimerCreate’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStimers.c(303,1): error: undefined reference to pvPortMalloc' FreeRTOS/timers.o: In functionprvProcessReceivedCommands’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStimers.c(695,1): error: undefined reference to vPortFree' FreeRTOS/queue.o: In functionvQueueDelete’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSqueue.c(1958,1): error: undefined reference to vPortFree' FreeRTOS/queue.o: In functionxQueueGenericCreate’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSqueue.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. Build FAILED. ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Compiler errors with ATSAMD51J20A and FreeRTOS

C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOSport.c(738,1): error: undefined reference to |SRAMsegmentstart
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).
Studio7.0FT4X32FT4X32FreeRTOStasks.c(814,1): error: undefined reference to|pvPortMalloc’
This, and similar errors, looks like the file FreeRTOS/Source/portable/MemMang/heap_x.c is missing from your build: https://www.freertos.org/a00111.html https://www.freertos.org/Creating-a-new-FreeRTOS-project.html
Studio7.0FT4X32FT4X32FreeRTOStasks.c(2896,1): error: undefined reference to |vApplicationStackOverflowHook’ FreeRTOS/tasks.o: In function|prvIdleTask’: C:UserscguggenheimDocumentsAtmel Studio7.0FT4X32FT4X32FreeRTOStasks.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: https://www.freertos.org/a00016.html

Compiler errors with ATSAMD51J20A and FreeRTOS

I am just trying to get the simplest plain vanilla application with FreeRTOS and the ATSAMD51 chip.

Compiler errors with ATSAMD51J20A and FreeRTOS

In which case it looks like you are using the wrong port layer files. If this is a Cortex-M3 or a Cortex-M4 without a floating point unit then use the files in FreeRTOS/Source/portable/GCC/ARM_CM3 If this is a Cortex-M4 with a floating point then use the port files from FreeRTOS/Source/portable/GCC/ARM_CM4F If this is an M0 or M0+ use the files in FreeRTOS/Source/portable/GCC/ARM_CM0