Problems with compiling *pxPortInitialiseStac

simfr wrote on Monday, September 15, 2008:

Hi!

I am trying to adjust the PPC405 port of FreeRTOS to the Freescale MPC5516 microcontroller. I am using Codewarrior IDE v5.9.0.

When trying to build the project, there always occours a "declaration syntax error" because of:

portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack,         pdTASK_CODE pxCode, void *pvParameters )

It seems that it is not possible because of the "portSTACK_TYPE", which is defined in portmacro.h as unsigned long.

In the function "pxPortInitialiseStack" itself I use someting like:

*pxTopOfStack = 0xDEADBEEF;
    pxTopOfStack–;

This also causes an error message "undefined identifier".

I am not very familiar with the CodeWarrior IDE. Can somebody help me?

Thank you very much in advance.

Regards, simfr

davedoors wrote on Monday, September 15, 2008:

Each port has its own portmacro.h file and each project must ensure it includes the correct one.  Look in source/include/portable.h to see how this is done. Normally you define a macro in the project to tell the compiler which portmacro.h to include. The alternative is to simply ensure the correct include path is within your project.

simfr wrote on Monday, September 15, 2008:

Thank you very much for your answer, Dave.

But unforunately this is not the problem. If I substitute portSTACK_TYPE with "unsigned long" in port.c to let the function look as follows, the same error messages "declaration syntax error" and "undefined identifier ´pxTopOfStack´ occur:

unsigned long *pxPortInitialiseStack( unsigned long *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )

portmacro.h is already included, too.

Am I not allowed to use the type unsigned long in this case?

Regards, simfr

davedoors wrote on Monday, September 15, 2008:

unsigned long should not be a problem. Are you certain it is not pdTASK_CODE that is causing the problem?

simfr wrote on Monday, September 15, 2008:

I already checked that.

pdTASK_CODE is defined in projdefs.h as:

typedef void (*pdTASK_CODE)( void * );

Even if I include projdefs.h explicitly in port.c the same error messages occur. Is this the right typedef for pdTASK_CODE?

davedoors wrote on Monday, September 15, 2008:

Nothing wrong with the definition. You have a strange one. Could you be editing the wrong file?

simfr wrote on Monday, September 15, 2008:

Thats nearly impossible. I made a project build in the codewarrior IDE and edit the files straight from there. Do you think it´s more problem of the FreeRTOS port or the compiler?