# Problem moving from pic32MX360 to pic32MX575

**URL:** <https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379>\
**Category:** Kernel\
**Created:** [December 4, 2010, 8:31am UTC](https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379 "2010-12-04T08:31:42Z")\
**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:** [December 4, 2010, 8:31am UTC](https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379/1 "2010-12-04T08:31:42Z")

</div>

**[steveb75](https://sourceforge.net/u/steveb75/)** wrote on [Saturday, December 04, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/9850902e/#afc3):

Hi All.

Have put together several tasks, some tasks using UART/DMA/Interrupts and is running fine using the pic32 starter kit with pic32MX360F512L.

Having problems trying to run the exact same code using pickit-3 with pic32MX575F512L.&nbsp; The \_general\_exception\_handler  
is called regardless of what I try.&nbsp; For example I have removed all tasks but 1 and the task is simplified to just spin in a loop.&nbsp; When starting the code, after a few seconds I hit a breakpoint set in the \_general\_exception\_handler.

If removing all tasks, Queues, Sem declarations/definitons and just calling prvSetupHardware() to init clocks, disable interrupts etc, followed by vTaskStartScheduler(), same thing happens.

If I remove vTaskStartScheduler() and just spin in a loop e.g while (TRUE) { i++; }, it seems happy i.e. don’t hit the breakpoint in \_general\_exception\_handler().&nbsp; Note this all in main() and the correct device is selected under the IDEs Configure-\>Select Device tab…

I have looked at the exception codes but can’t determine anything from it:-  
Status&nbsp; = 0x103  
Cause = 0x8080041C  
According to the M4K software user guide, the exception code (41C =\> 28 based on the bit mapping) is a reserved value….

A friend who is also using the same pickit-3/pic32MX575F512L setup is running similar/standalone code (i.e. without freeRTOS) and has no problems.

One other observation is during initial debugging I noticed the time to step over code/functions seemed very slow when compared to using the pic starter kit/pic32MX360F512L.&nbsp; Not sure if this is just normal behaviour of the pickit-3 but I would expect the hardware config to be the same for both platforms along with the response/speed.

Any help/advice would greatly appreciated.

Regards,  
Steve

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 4, 2010, 8:42am UTC](https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379/2 "2010-12-04T08:42:51Z")

</div>

**[steveb75](https://sourceforge.net/u/steveb75/)** wrote on [Saturday, December 04, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/9850902e/#ffd1):

Correction to above:

The exception code is 0x1C not 0x41C and equates to 7 not 28.

Exception type is DBE: Bus error exception (data reference: load or store)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 4, 2010, 12:11pm UTC](https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379/3 "2010-12-04T12:11:47Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Saturday, December 04, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/9850902e/#2826):

I don’t know if this is the solution to your problem, but is something to check. It has tripped people before.

The newer PIC32 devices need different pragma definitions (fuse bit settings maybe, from memory of older PICs?). If you look at the pragmas at the top of main.c for the demo in FreeRTOS\Demo\PIC32MX\_MPLAB of the official download you will see this

#pragma config FPLLMUL = MUL\_20, FPLLIDIV = DIV\_2, FPLLODIV = DIV\_1, FWDTEN = OFF  
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV\_2

In the book examples, which use a different and newer PIC32 device, you will see this

#pragma config FPLLODIV = DIV\_1, FPLLMUL = MUL\_20, FPLLIDIV = DIV\_2  
#pragma config FWDTEN = OFF, FPBDIV = DIV\_2, POSCMOD = XT, FNOSC = PRIPLL, CP = OFF  
#pragma config FSRSSEL = PRIORITY\_7

The FSRSSEL setting does not exist in the early PIC32 chips, but is essential in the newer ones.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 4, 2010, 6:06pm UTC](https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379/4 "2010-12-04T18:06:12Z")

</div>

**[steveb75](https://sourceforge.net/u/steveb75/)** wrote on [Saturday, December 04, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/9850902e/#d0f2):

Nice one Dave!

Seems to be working fine now after adding FSRSSEL = PRIORITY\_7.&nbsp; Do you happen to know where this is defined? I’d like to find out what it does… Can’t seem to locate it in the reference manual(s).

Stepping over instructions/functions still seems quite slow but will revisit later.

Thanks again!

Cheers,  
Steve

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 9, 2011, 5:41pm UTC](https://forums.freertos.org/t/problem-moving-from-pic32mx360-to-pic32mx575/3379/5 "2011-06-09T17:41:10Z")

</div>

**[pistole89](https://sourceforge.net/u/pistole89/)** wrote on [Thursday, June 09, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/9850902e/#fc43):

Hi Steve,

I also have the same problem. I used PIC32 Starter kit (PIC32MX360F512L)  
However, when I add #pragma config FSRSSEL = PRIORITY\_7  
It cannot be built.

my compiler is c32 v1.05 , MPLAB IDE v8.60

Which compiler do you use ?

I will really appreciate your help.  
Thanks
