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

FreeRTOS SAM7 Port

Posted by Adrian Carpenter on March 1, 2008
Hi,

There is something which catches me out nearly everytime I update my FreeRTOS.

The vesion of the lib_SAM7S256.h is not compatible with the latest ones from Atmel.

In port.c where the rtos tick is installed, the following function call is used:

AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vNonPreemptiveTick );

The convention in the current atmel header file is:

__inline unsigned int AT91F_AIC_ConfigureIt (
AT91PS_AIC pAic, // \arg pointer to the AIC registers
unsigned int irq_id, // \arg interrupt number to initialize
unsigned int priority, // \arg priority to give to the interrupt
unsigned int src_type, // \arg activation and sense of activation
void (*newHandler) () ) // \arg address of the interrupt handler

Where the AIC peripheral is passed in as well.

Is there any chance that you can update the library version in the distribution so that it uses the library functions that are compatible with the current atmel standard.

What happens is that everytime I drop in a new FreeRTOS release into my source tree I end up wondering why it crashes and then I remember that I have to go in and modify the port.c file so that it passes the correct parameters to the configure call.

Thanks

Adrian

RE: FreeRTOS SAM7 Port

Posted by Richard on March 3, 2008
Is this using GCC? I seem to recall in GCC the macro was altered and placed in the application code (rather than using the one in the header) as the headers are written for IAR and are not to easy to include in GCC builds due to their inline statements.

Regards.

RE: FreeRTOS SAM7 Port

Posted by Adrian Carpenter on March 3, 2008
Yes, GCC.

The headers certainly compile fine now without alteration under gcc, not sure about older versions.

I've just downloaded the latest freertos and dropped in the latest atmel header that I have here and modified port.c and it compiles fine.

Well, actually under gcc 4.1.0 I get some warnings:

ompiling C (ARM-only): FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c
arm-elf-gcc -c -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2 -DROM_RUN -DSAM7_GCC -DTHUMB_INTERWORK -DVECTORS_IN_RAM -I. -Ihardware/include -IFreeRTOS/Source/include -I/Common/include -IFreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S -O0 -Wall -fomit-frame-pointer -Wcast-align -Wimplicit -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.lst -MD -MP -MF .dep/portISR.o.d -Wnested-externs -std=gnu99 FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c -o FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.o
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function ‘vPortISRStartFirstTask’:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:87: warning: nested extern declaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:87: warning: nested extern declaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:87: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function ‘SWI_Handler’:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: nested extern declaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:87: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: nested extern declaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: nested extern declaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: nested extern declaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function ‘vPreemptiveTick’:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: nested extern declaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: nested extern declaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:162: warning: nested extern declaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:162: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:162: warning: nested extern declaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:162: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: At top level:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:174: warning: redundant redeclaration of ‘vPortDisableInterruptsFromThumb’
FreeRTOS/Source/include/../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h:218: warning: previous declaration of ‘vPortDisableInterruptsFromThumb’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:175: warning: redundant redeclaration of ‘vPortEnableInterruptsFromThumb’
FreeRTOS/Source/include/../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h:219: warning: previous declaration of ‘vPortEnableInterruptsFromThumb’ was here


But these are due to a change in the freertos code that nests some external declarations that wern't like that in previous versions.

best regards

Adrian


RE: FreeRTOS SAM7 Port

Posted by Richard on March 3, 2008
? I have never seen these warnings before.

Regards.

RE: FreeRTOS SAM7 Port

Posted by Adrian Carpenter on March 3, 2008
Ahh wait, I have a warning turned on:

-Wnested-externs

That'll probably explain that!

Adrian

RE: FreeRTOS SAM7 Port

Posted by Adrian Carpenter on March 3, 2008
Humn...turning that off still didn't fix those warnings:

Compiling C (ARM-only): FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c
arm-elf-gcc -c -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2 -DROM_RUN -DSAM7_GCC -DTHUMB_INTERWORK -DVECTORS_IN_RAM -I. -Ihardware/include -IFreeRTOS/Source/include -I/Common/include -IFreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S -O0 -Wall -fomit-frame-pointer -Wcast-align -Wimplicit -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.lst -MD -MP -MF .dep/portISR.o.d -std=gnu99 FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c -o FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.o
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function ‘vPortISRStartFirstTask’:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:87: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function ‘SWI_Handler’:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:87: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:107: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function ‘vPreemptiveTick’:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:113: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:162: warning: redundant redeclaration of ‘pxCurrentTCB’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:151: warning: previous declaration of ‘pxCurrentTCB’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:162: warning: redundant redeclaration of ‘ulCriticalNesting’
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:69: warning: previous definition of ‘ulCriticalNesting’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: At top level:
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:174: warning: redundant redeclaration of ‘vPortDisableInterruptsFromThumb’
FreeRTOS/Source/include/../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h:218: warning: previous declaration of ‘vPortDisableInterruptsFromThumb’ was here
FreeRTOS/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:175: warning: redundant redeclaration of ‘vPortEnableInterruptsFromThumb’
FreeRTOS/Source/include/../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h:219: warning: previous declaration of ‘vPortEnableInterruptsFromThumb’ was here


Adrian

RE: FreeRTOS SAM7 Port

Posted by Adrian Carpenter on March 3, 2008
Ok..Sorry for the traffic here!

-Wredundant-decls

It was that warning what was generating the warnings....

Adrian


[ 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