# FreeRTOS on Pico 2350

**URL:** <https://forums.freertos.org/t/freertos-on-pico-2350/21305>\
**Category:** Kernel\
**Tags:** tutorial\
**Created:** [September 2, 2024, 5:31pm UTC](https://forums.freertos.org/t/freertos-on-pico-2350/21305 "2024-09-02T17:31:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabor-budai](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/gabor-budai/32/4896_2.png) [@gabor-budai](https://forums.freertos.org/u/gabor-budai)\
**Post date:** [September 2, 2024, 5:31pm UTC](https://forums.freertos.org/t/freertos-on-pico-2350/21305/1 "2024-09-02T17:31:39Z")

</div>

Hello,  
I’ve modified the RP2040 port to make FreeRTOS usable with the RP2350 until official support is available. You can find the repository at github’com\gabor-budai\FreeRTOS\_PICO2350. (‘=’.‘;’'=‘/’; that’s my first topic, I had to find a workaround 🙂)

For simplicity, I’ve included the changes that were made to `portmacro.h` below:

```c
static inline void vPortRecursiveLock( uint32_t ulLockNum, spin_lock_t * pxSpinLock, BaseType_t uxAcquire )
{
    // recursion logic...

    if( uxAcquire )
    {
        //if( __builtin_expect( !*pxSpinLock, 0 ) )
        if ( __builtin_expect(!spin_try_lock_unsafe(pxSpinLock), 0 ) )
        {
            // recursion logic (if aquired, returns)
            // return;

            spin_lock_unsafe_blocking(pxSpinLock);
            //while( __builtin_expect( !*pxSpinLock, 0 ) ) {}
        }

        //__mem_fence_acquire(); // lock does this.
        // recursion logic
    }
    else
    {
        // recursion logic (release if recursion count is 0)
        spin_unlock_unsafe(pxSpinLock);
        //__mem_fence_release(); // unlock does this.
        //*pxSpinLock = 1;
        
    }
}

```

---

<div class="post-metadata">

**Author:** ![akanez](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@akanez](https://forums.freertos.org/u/akanez)\
**Post date:** [September 3, 2024, 5:10am UTC](https://forums.freertos.org/t/freertos-on-pico-2350/21305/2 "2024-09-03T05:10:06Z")

</div>

Welcome to the FreeRTOS community forums, @gabor-budai! Thanks for contributing. Our team will review your repo and provide feedback or comments soon.

---

<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:** [September 3, 2024, 5:19am UTC](https://forums.freertos.org/t/freertos-on-pico-2350/21305/3 "2024-09-03T05:19:29Z")

</div>

> [@gabor-budai](#):
>
> FreeRTOS usable with the RP2350

It seems that the pico SDK supports FreeRTOS. Were you not able to use that?

---

<div class="post-metadata">

**Author:** ![gabor-budai](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/gabor-budai/32/4896_2.png) [@gabor-budai](https://forums.freertos.org/u/gabor-budai)\
**Post date:** [September 3, 2024, 10:36am UTC](https://forums.freertos.org/t/freertos-on-pico-2350/21305/4 "2024-09-03T10:36:23Z")

</div>

Initially, I noticed that the official FreeRTOS-Kernel repo didn’t have a port for the RP2350, so I tried to figure out what I needed to do to make it runnable.

Then, I found the Raspberry Pi team’s fork, where the RP2350 port is already implemented. I updated the repo accordingly. This information might be useful for others who are also not very familiar with the Pico.

---

<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:** [September 3, 2024, 10:45am UTC](https://forums.freertos.org/t/freertos-on-pico-2350/21305/5 "2024-09-03T10:45:39Z")

</div>

> [@gabor-budai](#):
>
> This information might be useful for others who are also not very familiar with the Pico.

Thank you for sharing the information!
