Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Compiling FreeRTOS 9.0.0 for Atmel SAMD20

Posted by josaed on June 23, 2017

Hi,

I have a problem when compiling FreeRTOS for an Atmel SAMD20 microcontroller. I've modified the SetupTimerInterrupt with the attribute weak in the port.c file. ~~~ static void vPortSetupTimerInterrupt( void );

attribute(( weak )) void vPortSetupTimerInterrupt( void ) { /* Configure SysTick to interrupt at the requested rate. / *(portNVICSYSTICKVAL) = 0; / Load the SysTick Counter Value */ *(portNVICSYSTICKLOAD) = ( configCPUCLOCKHZ / configTICKRATEHZ ) - 1UL; *(portNVICSYSTICKCTRL) = portNVICSYSTICKCLK | portNVICSYSTICKINT | portNVICSYSTICKENABLE; } ~~~ In other file of my source code I have the actual implementation. ~~~ void vPortSetupTimerInterrupt(void) { // Struct for configuring TC struct tcconfig tcconf; // Set up configuration values tcgetconfigdefaults(&tcconf); tcconf.countersize = TCCOUNTERSIZE32BIT; tcconf.runinstandby = true; tcconf.clockprescaler = TCCLOCKPRESCALERDIV1; tcconf.wavegeneration = TCWAVEGENERATIONMATCH_FREQ;

// Initialize the TC
tc_init(&tc, TICK_TC, &tcconf);

// Register and enable callback for freeRTOS tick handler
tc_register_callback(&tc, (tc_callback_t) xPortSysTickHandler, TC_CALLBACK_CC_CHANNEL0);
tc_enable_callback(&tc, TC_CALLBACK_CC_CHANNEL0);

// Set top value equal to one os tick
tc_set_top_value(&tc, TIMER_RELOAD_VALUE_ONE_TICK);

// Enable the timer
tc_enable(&tc);

} ~~~ The output of the compiler is the following: ~~~ Building file: ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.c Invoking: ARM/GNU C Compiler : 6.2.1 In file included from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/include/FreeRTOS.h:98:0, from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.c:75: C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcconfigFreeRTOSConfig.h(120,49): warning: redundant redeclaration of 'PendSVHandler' [-Wredundant-decls] #define xPortPendSVHandler PendSVHandler ^ C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcASFthirdpartyfreertosfreertos-9.0.0SourceportableGCCARMCM0port.c(116,6): info: in expansion of macro 'xPortPendSVHandler' void xPortPendSVHandler( void ) attribute (( naked )); ^~~~~~~~~~~~~~~~~~ In file included from ../src/ASF/sam0/utils/cmsis/samd20/include/samd20.h:76:0, from ../src/ASF/sam0/utils/headerfiles/io.h:58, from ../src/ASF/sam0/utils/compiler.h:65, from ../src/ASF/sam0/drivers/system/clock/gclk.h:55, from ../src/config/FreeRTOSConfig.h:52, from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/include/FreeRTOS.h:98, from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.c:75: C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcASFsam0utilscmsissamd20includesamd20g18.h(184,6): info: previous declaration of 'PendSVHandler' was here void PendSVHandler ( void ); ^~~~~~~~~~~~~~ In file included from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/include/FreeRTOS.h:98:0, from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.c:75: C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcconfigFreeRTOSConfig.h(119,49): warning: redundant redeclaration of 'SVCHandler' [-Wredundant-decls] #define vPortSVCHandler SVCHandler ^ C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcASFthirdpartyfreertosfreertos-9.0.0SourceportableGCCARMCM0port.c(118,6): info: in expansion of macro 'vPortSVCHandler' void vPortSVCHandler( void ); ^~~~~~~~~~~~~~~ "C:Program Files (x86)AtmelStudio7.0toolchainarmarm-gnu-toolchainbinarm-none-eabi-gcc.exe" -x c -mthumb -DSAMD20G18 -DDEBUG -DTCASYNC=true -DSAMD20G18 -DBOARD=USERBOARD -DARMMATHCM0PLUS=true -DFREERTOS -DI2CMASTERCALLBACKMODE=true -DSYSTICKMODE -I"../src/ASF/common/boards" -I"../src/ASF/sam0/utils" -I"../src/ASF/sam0/utils/headerfiles" -I"../src/ASF/sam0/utils/preprocessor" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/common/utils" -I"../src/ASF/sam0/utils/cmsis/samd20/include" -I"../src/ASF/sam0/utils/cmsis/samd20/source" -I"../src/ASF/sam0/drivers/system" -I"../src/ASF/sam0/drivers/system/clock/clocksamd20" -I"../src/ASF/sam0/drivers/system/clock" -I"../src/ASF/sam0/drivers/system/interrupt" -I"../src/ASF/sam0/drivers/system/interrupt/systeminterruptsamd20" -I"../src/ASF/sam0/drivers/system/pinmux" -I"../src/ASF/sam0/drivers/system/power" -I"../src/ASF/sam0/drivers/system/power/powersamdrh" -I"../src/ASF/sam0/drivers/system/reset" -I"../src/ASF/sam0/drivers/system/reset/resetsamdrh" -I"../src/ASF/common2/boards/userboard" -I"../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/include" -I"../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0" -I"../src" -I"../src/config" -I"../src/ASF/sam0/drivers/sercom" -I"../src/ASF/sam0/drivers/sercom/i2c" -I"../src/ASF/sam0/drivers/sercom/i2c/i2csamd20" -I"../src/ASF/sam0/drivers/port" -I"../src/ASF/sam0/drivers/tc" -I"../src/ASF/sam0/drivers/tc/tcsamdrh" -I"../src/AED/APPtasks" -I"../src/AED/i2c" -I"../src/AED/Callbacks" -I"../src/AED/GPIO" -I"../src/AED/FMCstatemachine" -I"../src/AED/Linkedlist" -O0 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m0plus -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -MD -MP -MF "src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.d" -MT"src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.d" -MT"src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.o" -o "src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.o" "../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.c" C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestDebugMakefile(444,1): error: recipe for target 'src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.o' failed In file included from ../src/ASF/sam0/utils/cmsis/samd20/include/samd20.h:76:0, from ../src/ASF/sam0/utils/headerfiles/io.h:58, from ../src/ASF/sam0/utils/compiler.h:65, from ../src/ASF/sam0/drivers/system/clock/gclk.h:55, from ../src/config/FreeRTOSConfig.h:52, from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/include/FreeRTOS.h:98, from ../src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARMCM0/port.c:75: C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcASFsam0utilscmsissamd20includesamd20g18.h(183,6): info: previous declaration of 'SVCHandler' was here void SVCHandler ( void ); ^~~~~~~~~~~ C:Usersjose.gonzalezDesktopdocuments4MicrocontrollerAtmelworkspaceUCFPGAboardFreeRTOSTempSMtestsrcASFthirdpartyfreertosfreertos-9.0.0SourceportableGCCARMCM0port.c(371,1): error: in functionandvariablevisibility, at ipa-visibility.c:596 } ^ Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html for instructions. make: *** [src/ASF/thirdparty/freertos/freertos-9.0.0/Source/portable/GCC/ARM_CM0/port.o] Error 1 make: *** Waiting for unfinished jobs.... ~~~ I have other project with FreeRTOS v8.0.1. and it works. Unfortunately I need the new version, Any help would be welcome.

Thanks in advance, Jose


Compiling FreeRTOS 9.0.0 for Atmel SAMD20

Posted by rtel on June 24, 2017

I can see the compiler seems to crash and think it has a bug, but I can't see what the error it is reporting in the source code is (only warnings).


Compiling FreeRTOS 9.0.0 for Atmel SAMD20

Posted by heinbali01 on June 24, 2017

Just 2 guesses: what does the compiler do when you comment-out the original vPortSetupTimerInterrupt() function? And what if you leave out -Wredundant-decls ( an option that gave me head-aches ) ?


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner