Error when creating a new project for HCS12P

karima7 wrote on Sunday, March 13, 2016:

Hello everyone,

I tried to create a project for the microcontroller HCS12P64 just to manipulate the tasks, since I found problems when compiling the demo project.
I have added the necessary files: source and headers as shown in the following link: http://www.freertos.org/Creating-a-new-FreeRTOS-project.html

But unfortunately when compiling with codeWarrior I get this error:
Error: C4437 / Error directive found: You need to define SELECTED_PORT here!
trcConfig.h line 80

Really I’m stuck in this stage, I don’t know what to do.
I need your help please.
Regards.

edwards3 wrote on Sunday, March 13, 2016:

That error is in FreeRTOS+Trace, which you don’t need to run FreeRTOS. Did you mean to include the trace code?

karima7 wrote on Monday, March 14, 2016:

I added the Trace files, since I integrate FreeRTOS and FreeRTOSConfig files that use the Trace.
I wonder if I can manipulate Tasks without referring to Trace? if it is possible how I can do it?
Here are the header files that I used :

  • croutine,
  • deprecated_definitions,
  • event_groups,
  • FreeRTOS,
  • list,
  • mpu_wrappers,
  • portable,
  • portmacro,
  • projdefs,
  • queue,
  • sephr,
  • StackMacros,
  • stdint,
  • task,
  • timers,
  • trcBase,
  • trcConfig,
  • trcHardwarePort,
  • trcKernel,
  • trcKernelHooks,
  • trcKernelPort,
  • trcTypes,
  • trcUser.
  • And trcConfig.

Thank you very much for your help!
Regards

rtel wrote on Monday, March 14, 2016:

It is always best to start with the simplest system and then build incrementally from there, so first get the code compiling without the trace files. You don’t need anything from the /FreeRTOS-Plus directory - your original post has a link to a page that tells you which include paths are required.

karima7 wrote on Monday, March 14, 2016:

I followed your recommendations, and I actually found that I can work with Tasks without using the Trace.
After creating a simple main code to manage tasks Here are the errors I had :

**Link Error : L1822: Symbol vAssertCalled in file …\Project_4_new_Data\Standard\ObjectCode\heap_1.c.o
is undefined

Link Error : L1822: Symbol portRESET_READY_PRIORITY in file …\Project_4_new_Data\Standard\ObjectCode\tasks.c.o
is undefined

**
Link Error : L1822: Symbol taskRECORD_READY_PRIORITY in file …\Project_4_new_Data\Standard\ObjectCode\tasks.c.o
is undefined**

Link Error : L1822: Symbol TERMIO_PutChar in file
C:\Program Files (x86)\Freescale\CWS12v5.1\lib\HC12c\lib\ansibi.lib is undefined

Link Error : L1822: Symbol vApplicationMallocFailedHook in file …\Project_4_new_Data\Standard\ObjectCode\heap_1.c.o
is undefined

Link Error : L1822: Symbol vConfigureTimerForRunTimeStats in file …\Project_4_new_Data\Standard\ObjectCode\tasks.c.o
is undefined

Link Error : L1822: Symbol TickTimer_SetFreqHz in file C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\port.c.o
is undefined

Link Error : L1822: Symbol TickTimer_Enable in file C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\port.c.o
is undefined

Link Error : Link failed

I greatly apologize for the inconvenience.

rtel wrote on Tuesday, March 15, 2016:

**Link Error : L1822: Symbol vAssertCalled in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\heap_1.c.o
is undefined

I suspect you have configASSERT() defined to call vAssertCalled() - if
you do that then your application must implement vAssertCalled().

http://www.freertos.org/a00110.html#configASSERT

Link Error : L1822: Symbol portRESET_READY_PRIORITY in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\tasks.c.o
is undefined

Searching for portRESET_READY_PRIORITY in tasks.c will show that, if
configUSE_PORT_OPTIMISED_TASK_SELECTION is set to 0 or undefined in
FreeRTOSConfig.h, then portRESET_READY_PRIORITY is not needed.

If that is not clear - set configUSE_PORT_OPTIMISED_TASK_SELECTION to 0.

Link Error : L1822: Symbol taskRECORD_READY_PRIORITY in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\tasks.c.o
is undefined*

Same as portRESET_READY_PRIORITY comment.

Link Error : L1822: Symbol TERMIO_PutChar in file C:\Program Files
(x86)\Freescale\CWS12v5.1\lib\HC12c\lib\ansibi.lib is undefined

This is a tools issue. Perhaps the library has been changed since the
demo was created (which was many years ago).

Link Error : L1822: Symbol vApplicationMallocFailedHook in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\heap_1.c.o
is undefined

Google vApplicationMallocFailedHook to find the documentation page for
this on the FreeRTOS.org website. [either set
configUSE_MALLOC_FAILED_HOOK to 0 or define the
vApplicationMallocFailedHook callback function]

Link Error : L1822: Symbol vConfigureTimerForRunTimeStats in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\tasks.c.o
is undefined

Again, Google finds the answer right away
http://www.freertos.org/rtos-run-time-stats.html

Link Error : L1822: Symbol TickTimer_SetFreqHz in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\port.c.o
is undefined

This looks like a library function being called from the RTOS port layer

  • if it cannot be found then either the libraries have been changed
    since the port was written (it is an OLD port!) or it is related to the
    fact that the library could not be found (a few comments above).

Link Error : L1822: Symbol TickTimer_Enable in file
C:\Users\Toshiba\Desktop\Project_4_new\Project_4_new_Data\Standard\ObjectCode\port.c.o
is undefined

Same comment as for TickTimer_SetFreqHz.

karima7 wrote on Tuesday, March 15, 2016:

Thank you for your return.
I followed your recommendations, but nothing changed.Especially that the configurations were established by default.
if you can take a look at the project I would be really grateful.
Please find the project under the following link.
https://drive.google.com/file/d/0B5H5iHY-04JYQTVBMUtiNG1PUnM/view?usp=sharing
Regards.

rtel wrote on Tuesday, March 15, 2016:

I see you still have configASSERT() defined such that it will try
calling vAssertCalled(), but vAssertCalled() does not seem to be
implemented anywhere, and the configUSE_MALLOC_FAILED_HOOK is still 1
but vApplicationMallocFailedHook() is not defined - I didn’t look any
further. Did you change anything?

karima7 wrote on Tuesday, March 15, 2016:

yes I changed the settings, and I totally deleted configASSERT from FreeRTOS after compiling, 3 errors are generated which indicates that the compilation failed
that’s why I sent you the complete source project without modification.

karima7 wrote on Wednesday, March 16, 2016:

Hello,

I’ve realized that I was changing the settings under FreeRTOS not FreeRTOSConfig, especially for the set to 0,
Now I just have 2 errors related to port file that I could not resolve, especially that I have no problem with the libraries.

Link Error : L1822: Symbol TickTimer_SetFreqHz in file C:\Users\FAAR Industry\Desktop\Project_4_new3\Project_4_new_Data\Standard\ObjectCode\port.c.o
is undefined

Link Error : L1822: Symbol TickTimer_Enable in file C:\Users\FAAR Industry\Desktop\Project_4_new3\Project_4_new_Data\Standard\ObjectCode\port.c.o
is undefined

Link Error : Link failed

if you can take a look at the project after editing I would be really grateful.
Please find the project under the following link.

https://drive.google.com/open?id=0B5H5iHY-04JYWmRCUTJabjJFbkE

Thank you for your help.

rtel wrote on Wednesday, March 16, 2016:

These two functions are not provided by FreeRTOS, but are calls to a
library function - either the library is not being included in the
project or the names of the functions have changed.

rtel wrote on Wednesday, March 16, 2016:

Googling brings up this file, which says it is created by the ‘tool’:

http://www.eej.ulst.ac.uk/~ian/modules/EEE527/files/downloads/FreeRTOSV8.2.3/FreeRTOS/Demo/HCS12_CodeWarrior_small/CODE/TickTimer.C

karima7 wrote on Sunday, March 20, 2016:

Hello,
I tried to integrate TickTimer.C file that you recommended, but that creates other errors, so I tried the alternative solution, of modifying the file port.c with another one.
finally I got the following error:

**Link Error : L1102: Out of allocation space in segment RAM at address 0x3105
**
Link Error : Link failed

Another question if it is possible : Can we port the kernel of FreeRTOS on the HCS12P64 microcontroller which has 64KB cache memory and 4KB of RAM?

Thanks for your help.

rtel wrote on Sunday, March 20, 2016:

On 20/03/2016 00:10, Karima AISSAOUI wrote:

Hello,
I tried to integrate TickTimer.C file that you recommended, but that
creates other errors, so I tried the alternative solution, of modifying
the file port.c with another one.
finally I got the following error:

*Link Error : L1102: Out of allocation space in segment RAM at address
0x3105
*
Link Error : Link failed

I suspect you have just declared a heap that is too big for the part you
are trying to use. See
http://www.freertos.org/a00110.html#configTOTAL_HEAP_SIZE

Another question if it is possible : Can we port the kernel of FreeRTOS
on the HCS12P64 microcontroller which has 64KB cache memory and 4KB of RAM?

64KB cache memory? I presume you mean 64KB for flash memory - and if
that is the case, then yes, definitely. http://www.freertos.org/FAQMem.html

As for 4K of RAM, then yes also, but it will restrict the number of
tasks you can create as each task requires its own stack, and each stack
needs RAM. It looks like the [very old] demo in the download is using
less than 2K.

Regards.

karima7 wrote on Sunday, March 20, 2016:

Thank you very much for these interesting answers.
I must inform you that I used the heap_1 file, the lightest and the simplest file among the heap files, since I haven’t a complicated program.