Hey everyone,
i’m trying to Port FreeRTOS to a 8051 Softcore Controller (https://github.com/jaruiz/light52) but when i compile the File
tasks.c (https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/tasks.c#l1011) i receive the following error
$ sdcc –debug -o obj/ -DLIGHT52 -Isrc/FreeRTOS/include -Isrc/config -I../include -Isrc/FreeRTOS/portable/SDCC/light52 -c src/FreeRTOS/tasks.c
src/FreeRTOS/tasks.c:1011: error 47: indirections to different types assignment
from type ‘struct TaskControlBlockt generic* fixed’
to type ‘struct TaskControlBlockt generic* int fixed’
src/FreeRTOS/tasks.c:1954: error 78: incompatible types
from type ‘struct TaskControlBlockt generic* near* fixed’
to type ‘struct TaskControlBlockt generic* int generic* const fixed’
How do I have to cast these types ?
best regards
Michael
Types assignment in FreeRTOS
Types assignment in FreeRTOS
In the last release (10.0.1) these types were void *. In the head
revision of SVN they are no longer void * but ‘type safe’ – each type is
different. Are you using the latest release (downloaded as a zip or exe
file) or checking the files out of SVN?
Types assignment in FreeRTOS
Hey Richard,
yes, i cheched out the trunk via SVN.
I can try a different version on monday and see if that’s compiling.
Thanks for your help, have a nice weekend.
Michael
Types assignment in FreeRTOS
Hmm, the version in SVN has been tested with several compilers with no
issues. Could this be an issue with SDCC? I last attempted to use
typesafe handles some years back and had to back out the changes due to
a debugger issue. I believe the code is all perfectly valid C, and
quite old C too, nothing that relies on a later version of the standard.
Types assignment in FreeRTOS
Hey Richard,
I changed to version 10.0.0 today but I’m still getting these errors.
So I tried different Versions of SDCC. Last week I had Vesion 3.5.0 from Ubuntu Repository installed.
Version 3.6.0 and 3.7.0 gives me additional errors:
src/FreeRTOS/tasks.c:558: error 226: no type specifier for ‘prvInitialiseNewTask parameter 6’
src/FreeRTOS/tasks.c:738: error 226: no type specifier for ‘xTaskCreate parameter 6’
src/FreeRTOS/tasks.c:831: error 226: no type specifier for ‘prvInitialiseNewTask parameter 6’
parameter 6 is always “TaskHandle_t * const pxCreatedTask”
I tried to analyse the TaskHandlet structure and TCBt structure but they seem to be equal as far as I can see. I guess I have to see how SDCC interprets them.
What other 8051 compilers did you use ?
Best regards
Michael
Types assignment in FreeRTOS
SDCC is the only one I have used – but it was a VERY long time ago, so
no doubt an obsolete version of the compiler. V10.0.0 is very well
exercised with many compilers, and uses the void* handles instead of the
typesafe handles.
Types assignment in FreeRTOS
SDCC seems to by complaning about the “const” if I change “TaskHandlet * const pxCreatedTask” to “TaskHandlet * pxCreatedTask” for each funktion i get over this point.
Why did you define it as const, since it gets set during the Initialization ?