Quality RTOS & Embedded Software

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




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) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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