# FreeRTOS on Microchip dsPIC33CK

**URL:** <https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686>\
**Category:** Kernel\
**Created:** [June 12, 2024, 8:31am UTC](https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686 "2024-06-12T08:31:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeWringer](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@CodeWringer](https://forums.freertos.org/u/CodeWringer)\
**Post date:** [June 12, 2024, 8:31am UTC](https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686/1 "2024-06-12T08:31:53Z")

</div>

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

---

<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:** [June 12, 2024, 11:56pm UTC](https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686/2 "2024-06-12T23:56:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CodeWringer](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@CodeWringer](https://forums.freertos.org/u/CodeWringer)\
**Post date:** [June 18, 2024, 10:37am UTC](https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686/3 "2024-06-18T10:37:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [June 18, 2024, 11:45am UTC](https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686/4 "2024-06-18T11:45:53Z")

</div>

> [@CodeWringer](#):
>
> I am having trouble pushing my code to a new branch dsPIC33CK\_port to FreeRTOS-Kernel using both https and SSH

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

---

<div class="post-metadata">

**Author:** ![CodeWringer](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@CodeWringer](https://forums.freertos.org/u/CodeWringer)\
**Post date:** [June 24, 2024, 1:01pm UTC](https://forums.freertos.org/t/freertos-on-microchip-dspic33ck/20686/5 "2024-06-24T13:01:42Z")

</div>

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.
