FreeRTOS on Microchip dsPIC33CK

I have downloaded FreeRTOSv202212.01 and I have just got started with the dsPIC_MPLAB demo for the dsPIC33F. I have also got MPLAB v6.2 and the compiler which I use for the demo is xc-16 v2.10

I imported the project into MPLAB but found it did not build out-of-the-box. The book Mastering the FreeRTOS Kernel says add a comment to the forum if you needed to change anything. So, I added #include <xc.h> to FreeRTOS.h to make the errors go away. (The errors were something to do with an undefined reference to Nop).

What I’m actually aiming at, is a port of FreeRTOS to the dsPIC33CK128MP505 and the xc-dsc compiler v3.10. That doesn’t work straight away either - and someone else has already written a comment on this forum. The file port.c does not check for macro dsPIC33C and neither does portasm_dspic.S.

Can I just add a check for these macros in my versions of FreeRTOS? I ask because those comments on this forum were written several years ago and dsPIC33C is still not checked in those two files. Will I run into problems later on? Or do I need a new port.c and portasm_dspic.S? Can I use the later xc-dsc compiler?

Many thanks

Where are the two files you refer to? Are they in a pull request within github?

Please do update your own copy, then report back if this works. If so, it would be great to get a pull request to bring your changes into the mainline. Thanks.

1 Like

Hi Richard,

I am having trouble pushing my code to a new branch dsPIC33CK_port to FreeRTOS-Kernel using both https and SSH. Do I need special access rights in order to push code? I can log into gitHub online without trouble and clone FreeRTOS.

Many Thanks

You cannot push to the main repo. Please fork and then push to your fork.

Hi FreeRTOS. I have pushed suggested code to dsPIC33CK port #1095 and created a pull request. However, what I have done is not a tested solution, rather a question and request for more information.

I would like to know whether I am on the right track.

It seems other people have been trying to port FreeRTOS to dsPIC33C, but it does not seem to be easy. Comments in the source code state that dsPIC33CK is not supported, however a similar comments in these forums suggest that a port does exist. However, links to such ports have lead me nowhere.