# Demo code stuck at programming

**URL:** <https://forums.freertos.org/t/demo-code-stuck-at-programming/1078>\
**Category:** Kernel\
**Created:** [August 24, 2010, 7:41am UTC](https://forums.freertos.org/t/demo-code-stuck-at-programming/1078 "2010-08-24T07:41:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 24, 2010, 7:41am UTC](https://forums.freertos.org/t/demo-code-stuck-at-programming/1078/1 "2010-08-24T07:41:50Z")

</div>

**[swer](https://sourceforge.net/u/swer/)** wrote on [Tuesday, August 24, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/303379c7/#879d):

Hello;

I work on RTOSDemo-Example 14. It works pretty fine without changing anything.  
However,  
When I try to change the  
ulReceivedNumber &= 0x03;&nbsp;  
to&nbsp;  
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&nbsp;&nbsp; " #pragma config FSRSSEL = PRIORITY\_7"

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

Thanks in advance…

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 24, 2010, 8:43am UTC](https://forums.freertos.org/t/demo-code-stuck-at-programming/1078/2 "2010-08-24T08:43:46Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, August 24, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/303379c7/#d104):

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).&nbsp; 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.&nbsp; 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?&nbsp; 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.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 24, 2010, 9:18am UTC](https://forums.freertos.org/t/demo-code-stuck-at-programming/1078/3 "2010-08-24T09:18:55Z")

</div>

**[swer](https://sourceforge.net/u/swer/)** wrote on [Tuesday, August 24, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/303379c7/#8cd6):

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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 24, 2010, 10:23am UTC](https://forums.freertos.org/t/demo-code-stuck-at-programming/1078/4 "2010-08-24T10:23:48Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Tuesday, August 24, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/303379c7/#bae6):

> 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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 26, 2010, 12:45pm UTC](https://forums.freertos.org/t/demo-code-stuck-at-programming/1078/5 "2010-08-26T12:45:24Z")

</div>

**[swer](https://sourceforge.net/u/swer/)** wrote on [Thursday, August 26, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/303379c7/#358d):

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 ??&nbsp; Can you please help me a little more ??

Thanks again…
