rtel wrote on Monday, April 30, 2012:
First I’ve tried the demo project which unfortunately doesn’t compile.
I assure you that, when used with the compiler/IDE it was created with, it does compile.
It sound impossible to compile as this demo intended for Coldfire V1 seems to refer to some MSP430 header files
Umm, not it doesn’t, but I can see why you might come to that conclusion.
I have just spent x hours downloading and installing the extraordinarily massive Eclipse version of the CodeWarrior tools, and was pleased to see it includes an import wizard. I was even more pleased when I saw that it appeared to import the classic IDE project without error. I was less pleased when I realised it only thought it had imported it. When I tried to build it I get the error:
“the file msp430.h cannot be opened”.
It says that, because it is not including the correct version of portmacro.h.
Now, looking at the include paths I see that “${CW_Project}\…\…\Source\portable\CodeWarrior\ColdFire_V1” is mentioned, and that is indeed where the correct version of portmacro.h lives, so why it is attempting to use the one from the Source\portable\GCC\msp430 one is a mystery, especially as the project explorer even shows the correct file being used, and right clicking on the header file in the include directive also takes you to the correct place. I think there is some strange dependency scanner issue in the tools (not unusual with Eclipse).
So, I deleted every other copy of portmacro.h (there is one per port), and tried compiling again. Now it is generating an error because it can’t find a file that is part of the PIC18 port - so that seems like a good point to give up, but I’m in the mood for a challenge, so…
I deleted all the files related to every other port, created a new workspace, and imported the classic project one more time, and hey presto - it built without any errors or warnings this time. I have no idea if it runs, but it builds.
So, go back to the original, unmodified, V1 project as found in the FreeRTOS download. Then, in the FreeRTOS\source\portable directory, delete every directory other than the following:
FreeRTOS\portable\MemMang
FreeRTOS\portable\CodeWarrior\ColdFire_V1
Then, delete heap_1.c and heap_2.c from FreeRTOS\portable\MemMang, make sure your Ecplise workspace is completely clean of any trace of the first attempt at importing the project (preferably use a new workspace), and finally use the CodeWarrior import wizard to import the original .mcp file again, and you should be all set.
Now when compiling, it gives errors regarding fucntions
- vApplicationTickHook
- vApplicationStackOverflowHook
from task.c which are not refered.
In task.c their prototype is declared as extern.
Look up hook functions in the documentation. You either need to configure FreeRTOSConfig.h not to look for these functions, or you need to define them.
don’t understand the basic idea behind having a kernel supposed to be portable, with calls to functions declared in a demo project in main.c
These are application definable hook functions (or callback functions, if you prefer). They are not part of the kernel, but allow the application writer to add code into certain kernel events, if they want to.
Regards.