Task name missing

jgmartinez wrote on Wednesday, January 07, 2009:

Enviroment MPLAB 8.15a
Compiler C18 V3.21

I’m new with FreeRTOS and I’m interested in PIC 18 HW. So I tried with MCC18 and PIC 18F452 port.
I have noticed task name is missing in tskTCB.

File taks.c line 1674. strncpy do not copies from rom to ram, so replacing by strncpypgm2ram it works. Have anyone detected this behaviour?.

JP.

picmeup wrote on Thursday, January 08, 2009:

You can set the length to 1 in the freertosconfig file to save space as it is not useful.

jgmartinez wrote on Thursday, January 08, 2009:

You’re right, but task name is useful for debugging process. So this feture is interesting to make work.

I don’t know if old C18 worked OK with strncpy and latest verssion do not or it was a “mistake” from the begining. In such case it would be good idea to modify the source code to solve this problem with C18 compiler.

I have noticed some other “mistakes” like this. I wanted to check if anyone has detected them and if were detected yet, is there a reason to maintain them?. I’m surprised.

mikej42 wrote on Monday, January 12, 2009:

Hello JG
You are quite right that the earlier version of the compiler did not correctly identify mistakes in parameter types of this sort, and one version checked them, but got it wrong!
If a parameter refers to ROM space (const rom), the version strncpypgm2ram must be used so the correct memory space is accessed. As you have noticed the incorrect call may not be detected, and the resulting code will not work!
A final gotcha is that the default memory model for the project is small code, while the libraries are compiled with large code model which can alos cause problems.

I have developed code for the PIC18 quite extensively, but so far have only used FreeRTOS with ARM chips (so far).