Page 1 of 1

PIC24FJ1024GB610 + FeeRTOS

Posted: 13 Aug 2018 20:51
by ganleydt
Hi
I would like to use FreeRTOS with the PIC24FJ1024GB610. I've downloaded the examples from Libstock and created a new project using this files. The project complies Ok but when I try to debug it there is some strange behaviour. When portRESTORE_CONTEXT() is called from xPortStartScheduler() both DSWPAG and DSRPAG are set to 0 so the processor resets and starts executing from the beginning again.

In order to get the code to compile I have had to modify the portRESTORE_CONTEXT maco so that for non EADS version as shown below.

Code: Select all

   #ifdef __HAS_EDS__
    asm POP DSWPAG;
    asm POP DSRPAG;
    #else
    //Modification as suggested in https://www.freertos.org/FreeRTOS_Support_Forum_Archive/November_2010/freertos_PSVPAG_error_PIC24FJ256DA210_3939736.html
    //asm POP PSVPAG;
    asm POP DSWPAG;
    asm POP DSRPAG;

    #endif /* __HAS_EDS__ */

I have assumed that mikroC does not support EDS, is this correct? and is there a solution to this problem ?


Looking at the device datasheet(p75) it seem the problem is that my code is trying to set a destination address above 8000h and hence generating an address error.


Many Thanks

Re: PIC24FJ1024GB610 + FeeRTOS

Posted: 21 Aug 2018 08:09
by petar.suknjaja
Hi,
Sorry for delayed response,
You are correct, the EDS is not supported,
and regarding the solution, I need to consult the documentation.
Kind regards,
Petar