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

Errors compiling on Ubuntu Linux

Posted by Art C on June 23, 2008
Anyone care to comment on what the original intent was here?

In file included from ....... /Source/include/FreeRTOS.h:66,
from main.c:10:
......... /Source/include/portable.h:252: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

252: portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );

......... /Source/include/portable.h:265: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘xPortStartScheduler’

265: portBASE_TYPE xPortStartScheduler( void );

In file included from main.c:10:
......... /Source/include/FreeRTOS.h:71: error: expected declaration specifiers or ‘...’ before ‘*’ token
......... /Source/include/FreeRTOS.h:71: warning: type defaults to ‘int’ in declaration of ‘portBASE_TYPE’
......... /Source/include/FreeRTOS.h:71: error: ‘portBASE_TYPE’ declared as function returning a function

71: typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );


The files in question all come from FreeRTOS v5.0.2, processor type AVRMega323, originally for WinAVR GCC.

New environment is Ubuntu Linux v8.04 latest stable, gcc-avr v 1:4.2.2-1, built on Code::Blocks v8.02 IDE.

Include directories are defined in Code::Blocks, not the makefile (which gets ignored / over-ridden by the IDE).

btw, no attempt has been made to use the distribution directory structure - it's just too messy!

RE: Errors compiling on Ubuntu Linux

Posted by Richard on June 23, 2008
Did you define GCC_MEGA_AVR? As per the provided makefile, -DGCC_MEGA_AVR. If using Linux you may find some include files have incorrect capitalization.

>btw, no attempt has been made to use the distribution directory
>structure - it's just too messy!

If you can come up with an alternative that allows 17 different architectures (plus their many derivatives) to all build the same code, while keeping all hardware specific code separate, and keeping any application specific code clear of the core source code - then I'm all ears :0)

Regards.

RE: Errors compiling on Ubuntu Linux

Posted by Dave on June 23, 2008
did you see http://www.freertos.org/a00017.html ?

RE: Errors compiling on Ubuntu Linux

Posted by Art C on June 24, 2008
Fixed thanks, Richard.

Using my test area:
I didn't have GCC_MEGA_AVR defined so added it, tried again.
No diff, so I had a 'fiddle' with the makefile to confirm my suspicion that it couldn't be using the makefile at all.
Tracked down and changed that option in C::B, tried again and all appeared good.
Apparently the default compiler / linker options in C::B are close enough that it nearly works!
Removing -D GCC_MEGA_AVR doesn't upset anything, I've yet to track down why but I suspect gcc-avr 4.2.2 doesn't require it. Doesn't appear to do any harm either way so it can stay in.

Now using the demo area:
OK, create a new C::B project in the demo directory, using both supplied demo makefile and main.c files and try again.
Created exactly the same output files as in the test area so the world is good again.

Next, I will have to put in the time to build some test apps to try on the hardware but I'm satisfied that it is functional.


The only modification to the demo makefile (so far!) is at line 384 where

clean: begin clean_list finished end

needed to be changed to

cleanall: begin clean_list finished end

as C::B expects to find 'cleanall' and I haven't found any way of changing that.
Of course, it would be equally valid to simply add the 'cleanall' line as 'clean' would be ignored by C::B and 'cleanall' would be ignored by WinAVR.

Conclusion:
FreeRTOS appears to build fine on Ubuntu 8.04 and gcc-avr 4.2.2 and using Code::Blocks v8.02 provides a nice IDE.
Maintenance of the application requires a small change to the makefile.

No errors found so far for case in filenames etc but I'll tell you if / when I hit one.

No criticism re the directory structure, for what you have to deal with it's probably the best I've ever seen.
At one point I wasn't sure that errors weren't occurring because of the sloppy Windows traits inherited with WinAVR and it just made it hard until I'd got a handle on the real problem!


[ 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