Quality RTOS & Embedded Software

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




Loading

Incompatibility types when compiling...

Posted by Nobody/Anonymous on December 28, 2006
Hi verybody,
I'm trying to compile FreeRTOS for PIC18F devices using SDCC but with no success. I'm testing a simple example I got from somewhere. The code mainly does nothig but when compiling I get this error:

main.c:43: error 78: incompatible types
from type 'void generic* '
to type 'void generic* generic* '

The error refers to the first parameter in this function:

xTaskCreate( vTestTask, "Hello", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );

This function is defined:

signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask ); // Defined in task.h

and pdTASK_CODE is defined as: typedef void (*pdTASK_CODE)( void * ); // Defined in projdefs.h

My task is defined as:

static void vTestTask( void *pvParameters ); // Dummy task which does nothing.

What is wrong here? Why are they incompatible?

If I make this in the main code before calling the funcion to create a task:
pdTASK_CODE ptr;
ptr = vTestTask;

I get no errors at that point, but if I use ptr as first parameter to the function I get the same error as before. I do not understand anything...

Thanks in advance

RE: Incompatibility types when compiling...

Posted by Nobody/Anonymous on December 28, 2006
This code does not appear to contain any errors and works fine with other compilers - even SDCC for 8051. I think it must be a problem with the PIC18 version of the compiler. Here is my output using SDCC for 8051.

sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ParTest/ParTest.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent serial/serial.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../Common/Full/flash.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../Common/Full/print.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../Common/Minimal/integer.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../Common/Minimal/PollQ.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../Common/Minimal/comtest.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../Common/Full/semtest.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../../Source/tasks.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../../Source/queue.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../../Source/list.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../../Source/portable/MemMang/heap_1.c
sdcc -c --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ../../Source/portable/SDCC/Cygnal/port.c
sdcc --model-large -I. -I../Common/include -I../include -I../../Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --stac
k-auto --no-peep --int-long-reent --float-reent main.c ParTest/ParTest.rel serial/serial.rel ../Common/Full/flash.rel ../Common/Full/print.r
el ../Common/Minimal/integer.rel ../Common/Minimal/PollQ.rel ../Common/Minimal/comtest.rel ../Common/Full/semtest.rel ../../Source/tasks.rel
../../Source/queue.rel ../../Source/list.rel ../../Source/portable/MemMang/heap_1.rel ../../Source/portable/SDCC/Cygnal/port.rel


You could download the free version of the MPLAB C18 compiler and use that instead.

RE: Incompatibility types when compiling...

Posted by Nobody/Anonymous on December 28, 2006
Thanks for your reply.

I thought that I was turning into mad reviewing the code to locate an error because I'm pretty sure that it's all right.
I guess I miss something that makes the compiler work properly because I know that somebody has made FreeRTOS and SDCC work together for PIC18F platform so I'll keep trying it.
I'm working under Linux so that is the reason why I'd like to use SDCC instead of Microchip's compiler, which only works under Windows. Anyway, I'm trying to develope this for a home made project so I can waste more time for making things run...

Thanks again...

RE: Incompatibility types when compiling...

Posted by jezule on December 28, 2006
The last parameter of the function cannot be NULL... I've spent a lot of time trying to solve a problem that did not exist at all...

RE: Incompatibility types when compiling...

Posted by Jeff Smith on December 29, 2006
jezule, what do you mean?

I use NULL more often than not. This is how it is handled:

> if( ( void * ) pxCreatedTask != NULL )
> {
> /* Pass the TCB out - in an anonymous way. The calling function/
> task can use this as a handle to delete the task later if
> required.*/
> *pxCreatedTask = ( xTaskHandle ) pxNewTCB;
> }

So if NULL, it is ignored (which is find since you must not have cared if you used NULL)


[ 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