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

MPLAB C18 Compiler gives error in portable.h

Posted by Dale Puls on March 19, 2008
I'm new to FreeRTOS.

I have downloaded V4.7.2 and receive a "C:\FreeRTOS 4.7.2\Source\include\portable.h:235:Error: syntax error" when I attempt to compile the OS. The syntax error points to "portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );" in the portable.h file. I have searched the entire 4.7.2 download and cannot find pxPortInitialiseStack declared anywhere. (The target is a PIC18)

What I am missing?

RE: MPLAB C18 Compiler gives error in portable.h

Posted by PICmeup on March 19, 2008
It complains that portSTACK_TYPE is not known and this is often because MPLAB_PIC18F_PORT is no defined.

When you opened the demo did you open a project or workspace. You need to open the workspace. Also when you open the workspace do you see three projects in the workspace? If not then you need to set MPLAB to allow multiple projects in one workspace.

Set to allow multiple projects, then open the WORKSPACE [not project] in a clean unzip of freertos.

pxPortInitialisestack is defined in port of MPLAB port.

RE: MPLAB C18 Compiler gives error in portable.h

Posted by Dale Puls on March 19, 2008
Here's a little more detail:
The unzipped FreeRTOS will compile properly (yes I have all three projects visible in the workspace).
I've reduced my first new task (test.c) to a single line of #include "task.h"
The build options for test.c show MPLAB_PIC18F_PORT in the "Macro Definitions" box. When I compile the project with my single-line test.c added, I receive the compiler error in portable.h

RE: MPLAB C18 Compiler gives error in portable.h

Posted by Richard on March 20, 2008
> Here's a little more detail:
> The unzipped FreeRTOS will compile properly (yes I have all
> three projects visible
> in the workspace).

So the demo application as downloaded compiles without problems...


> I've reduced my first new task (test.c) to a single line of
> #include "task.h"
> The build options for test.c show MPLAB_PIC18F_PORT in the
> "Macro Definitions"
> box. When I compile the project with my single-line test.c
> added, I receive
> the compiler error in portable.h


Ok - try

#include "FreeRTOS.h"
#include "task.h"

I think that should fix the problem.

FreeRTOS.h is required and brings in the port layer stuff in the correct order so you don't get the warning about portBASE_TYPE.

Regards.

RE: MPLAB C18 Compiler gives error in portable.h

Posted by Dale Puls on March 20, 2008
Thanks Richard,
Adding the #include "FreeRTOS.h" cured the 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