Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists