FreeRTOS for dspic33ep512MU810

cali2houston wrote on Monday, May 14, 2012:

There are some differences between dsPIC33FJ512GP710 and the dsPIC33EP512MU810 e.g. the way memory is handled. GP710 has tables with PSVPAG register and MU810 has pages with DSRPAG and DSWPAG.

In portasm_dsPIC.s and port.c can I simply replace PSVPAG with DSRPAG? Any other changes I should make to port the RTOS to the new chip?

nathanwiebe wrote on Monday, May 14, 2012:

In addition to changing PSVPAG to DSRPAG, you really should add an identical line for DSWPAG (and do this twice in port.c and twice in portasm_dsPIC.S).  Note that the PUSHes and POPs should be in reverse order after you add the line.  I’m not sure why these changes haven’t been added to the distribution yet.  It’s been several years since the first parts with the EDS came out (e.g. the PIC24FJ256DA210).  I suspect two new versions would be required: one for the PIC24 DA210 and PIC24 EP parts, and one for the 33F EP parts, which include the EDS and dsPIC core registers.

cali2houston wrote on Friday, May 25, 2012:

Thanks Nathan. I made the changes, but not sure if that worked or not. The demo app keeps halting and when I single step, I see that malloc ran out of space even at 5120 bytes. Doesn’t seem right. I even removed LCD tasks.

cali2houston wrote on Saturday, May 26, 2012:


I followed your advice and the instructions on starting from a clean project and now I am running two tasks which toggle LEDs at different rate on a MCLV board.

Would like to upload the project if others need it.

ptjmartins wrote on Monday, October 29, 2012:


I’m porting the FreeRTOS to a hardware platform made by my company that uses the pic24fj128gb206, with EDS.

I’m using the demo project for PIC24 included in FreeRTOS7.2.0. But the pic used on that demo is p24FJ128GA010, that does not have EDS.

I used this topic to make the necessary changes in order to port successfully to gb206 . 

It compiles ok, but the problem is that using the simulator I’m having a error saying: CORE-E0004: Trap due to unimplemented FLASH memory access, occurred from instruction at 0x001370

This happens after passing the line:

asm volatile( “return” );

on portBASE_TYPE xPortStartScheduler( void )

I’m sure that the previous line, portRESTORE_CONTEXT, is causing this issue, since is where I substituted PSVPAG for the other 2 registers, and for some reason, the PC gets corrupted after this restore context

What seems to be the problem ? I have inverted the order in which i push and pop registers DSWPAG and DSRPAG.

Can you post your port of FreeRTOS on pics that have EDS ?


damieneti wrote on Tuesday, August 27, 2013:

+1, if you could post the port would be really helpful. thanks.

damieneti wrote on Tuesday, August 27, 2013:


It might happen because  of a mishandled pointer. With the EP devices, the first address bit is not used for addressing. You can find more details here:

cali2houston wrote on Tuesday, August 27, 2013:

I am not able to post the code. It thinks I am posting spam!

damieneti wrote on Tuesday, August 27, 2013:

Would you mind to send a copy to my mailbox at damien.eti at gmail ?

rtel wrote on Wednesday, August 28, 2013:

Please post code to, then you can also post links here.