Demo code stuck at programming

swer wrote on Tuesday, August 24, 2010:


I work on RTOSDemo-Example 14. It works pretty fine without changing anything.
When I try to change the
ulReceivedNumber &= 0x03; 
ulReceivedNumber += 0x01;
xQueueSendToBackFromISR( xStringQueue, &ulReceivedNumber , &xHigherPriorityTaskWoken );

in the vSW1_ISR_Handler section, it builds ok but, freeze at the programming part while programming the memory.

After that whole mplab craches. I couldn’t figure out what the problem is…

I use pic32mx360F512L (starter kit) removing the line of   " #pragma config FSRSSEL = PRIORITY_7"

This error wasn’t the only one , I have encountered different ones also…

Thanks in advance…

rtel wrote on Tuesday, August 24, 2010:

From your question I am presuming you are talking about the demos that come with the PIC32 version of the FreeRTOS eBook.

The MPLAB projects are configured to run on the PIC32MX795F512L-80I/PT (which as a new generation part definitely does need the #pragma config FSRSSEL = PRIORITY_7 for it to be stable).  Unfortunately I have never tried them on the PIC32MX360F512L, but I do know that the 360 part has 32K of RAM while the 795 part has 128K of RAM.  The demo itself only uses a tiny amount of RAM, but I suppose the debugger might make assumptions as to which parts of the data space it can use itself, so my first question is, did you re-target the project correctly for this different part?  There could also be differences in the flash programming I suppose (but don’t know).

It is strange that such a small change would cause a problem though.


swer wrote on Tuesday, August 24, 2010:

Thanks for you reply;

Yes I work on the ones come with the Freertos ebook.

I haven’t changed anything about RAM parts.Just simple removed #pragma config FSRSSEL = PRIORITY_7 line…
Might be because of ram problem , But I am not sure how to fix this …

Any help will be appreciated.

davedoors wrote on Tuesday, August 24, 2010:

I haven’t changed anything about RAM parts

Sounds like your memory map is very wrong then. Look in the IDE for a project setting that selects the part being used, that might then automatically correct he memory map. Alternatively, look in the files that are included as part of the project to see if there is a linker script. Finally, some projects will have a MCU specific header file included that sets all the configuration options. Look at the top of FreeRTOSConfig.h to see if there is such a header file.

swer wrote on Thursday, August 26, 2010:

Hello again;

Richartbarry said that one of its entries he didn’t write a linker script file for freertos.
and there is no script file included in the project. which means mplab uses the default script file its own.

but only question i came up;
why we need to retarget the memory??
I have chosen the new processor i use and remove the required line… (#pragma …… )
and mplab uses the default linker script and predefined processor-specific object file which contains sfr definitions. (procdefs.ld)

So I think i am not clear on this ??  Can you please help me a little more ??

Thanks again…