richpainter wrote on Sunday, June 22, 2008:
In the mean time, I have looked closely at what MPLAB does and I think the heap problem is due to a deficiency in MPLAB in the way it includes/builds the libs. From the 5.0.2 perspective, even though only heap_1.c is in the MPLAB project (after I removed the project entries for heap_2.c and heap_3.c) the .o for them were still around. MPLAB was still getting all the heap modules in thus having the conflict with heap_3.c not getting the heap that it needed.
After seeing this I recall I had seen this some months back on another MPLAB project where I had 2 subdirectories with different version of a lib in them and switched the directory file names and it didn’t load the lib correctly just like this.
I always specify for my MPLAB project entries project relative file locations. I don’t know what is causing this bug but it is an insidious problem.
Now I can link 5.0.2. However, the tasks don’t seem to run correctly at all with 5.0.2. Even if I take all the sema create and take out that I had in it the tasks just dont run. If I swap 5.0.0 back in the tasks run OK.
This very well may be C30 3.10 and that I have hit upon something that allowed FreeRTOS to work for 5.0.0 but not 5.0.2 even with the -O0 and port.c/postasm_pic24.s change.
I read from others that C30 3.10 won’t work at all but I did have it running in a fashion before trying to use the sema.
You said you were successful with C30 3.10 so I kept using it.
I’m wondering now if I should go all the way back to C30 3.01 which I am using on another project that has not been moved to the new C30 3.10…
I am still confused about the fact that my 5.0.0 project includes all the heap modules in the rtos lib yet it doesn’t have this problem… but maybe that is why the sema does not work for 5.0.0…
There are so many variables to this it is very hard to isolate what the problem is. I have many, many years of RTOS experience but just started using FreeRTOS and I have not yet learned enough about its inner working to try and debug this kind of a problem, mostly since I’m under a deadline and don’t have time to do so.
If you still want me to send you my project then let me know and to what extent (the RTOS lib for sure, but Microchip TCPIP lib and my app?).
thanks!
rich