Quality RTOS & Embedded Software

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




Loading

compiling error

Posted by Nobody/Anonymous on September 18, 2006
Hi All,
I just started with FreeRTOS.
please may someone tell me why i receive "error(128):Function argument incomplatible with its declaretion " when compiling this:


int main(void)
{
/* Create the sample tasks. */
xTaskCreate( Task1, "Task1", configMINIMAL_STACK_SIZE, (void *)10, tskIDLE_PRIORITY + 1, NULL);

vTaskStartScheduler();

return 0;
}


void Task1( void *pvParameters )
{
int x = (int)pvParameters;

for( ;; )
{
// Task code goes here.
}

}

RE: compiling error

Posted by Nobody/Anonymous on September 18, 2006
Assuming the error is for the xTaskCreate() call - have you a prototype for the function Task1 before main()?

RE: compiling error

Posted by Nobody/Anonymous on September 18, 2006
Thank you for you response,
Yes, the prototype is on "task.h", included just above main.
The error refers to the pcName argument.

signed portBASE_TYPE xTaskCreate(
pdTASK_CODE pvTaskCode,
const signed portCHAR * const pcName,
//const portCHAR * const pcName,
unsigned portSHORT usStackDepth,
void *pvParameters,
unsigned portBASE_TYPE uxPriority,
xTaskHandle *pvCreatedTask
);

Israel

RE: compiling error

Posted by Nobody/Anonymous on September 18, 2006
Not sure if we are talking at cross purposes here. I was referring to a prototype for Task1 function, not the inclusion of task.h. It seems this is not the problem anyway if the error is on the pcName parameter.

You could try casting it to const * const.

Which compiler for which chip are you using? Some compilers default char * to signed char *, and some to unsigned char * which is why FreeRTOS has to cast everything explicitly to remove the warnings.

RE: compiling error

Posted by Nobody/Anonymous on September 18, 2006
I'm trying to port to an old z80 board wit a IAR compiler, and this is the definition of types on portmacro.h


/* Type definitions. */
#define portCHARchar
#define portFLOATfloat
#define portDOUBLEdouble
#define portLONGlong
#define portSHORTshort
#define portSTACK_TYPEunsigned int
#define portBASE_TYPEint

RE: compiling error

Posted by Nobody/Anonymous on September 18, 2006
I'll study the compiler manual and see if i can find something related to this.

Thank you

Israel


[ 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