# FreeRTOS on Atmel SAMB11

**URL:** <https://forums.freertos.org/t/freertos-on-atmel-samb11/6026>\
**Category:** Kernel\
**Created:** [June 28, 2016, 1:50pm UTC](https://forums.freertos.org/t/freertos-on-atmel-samb11/6026 "2016-06-28T13:50:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 28, 2016, 1:50pm UTC](https://forums.freertos.org/t/freertos-on-atmel-samb11/6026/1 "2016-06-28T13:50:10Z")

</div>

**[kev1](https://sourceforge.net/u/kev1/)** wrote on [Tuesday, June 28, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/52a0c9a8/#b613):

Hello !

I’m quite new to FreeRTOS and I would like to use it on an Atmel SAMB11 SoC (arm cortex M0), and more precisely on an Samb11Xplained board. For now I used provided example for SAMD21 SoC.

My first question is the following: does FreeRTOS port depends on the SoC (e.g. SAMB11) or only the processor (arm cortex M0) ? My understanding leads me to the second one.

Next, what are the steps to adapt an example to my board ?

Currently, I’m able to compile FreeRTOS sources in my project. I’ve first created only one task, and after starting the scheduler, the task was processing correctly (even though I observed that it doesn’t work if timer use is enabled in FreeRTOSConfig.h).  
I am now trying to create two tasks and check that they both process. The problem is that only one task is executed. I suspect an issue with the systick timer but I don’t know how to fix it.

Thanks for your help !

---

<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 28, 2016, 1:59pm UTC](https://forums.freertos.org/t/freertos-on-atmel-samb11/6026/2 "2016-06-28T13:59:33Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, June 28, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/52a0c9a8/#b613/04c1):

> My first question is the following: does FreeRTOS port depends on the  
> SoC (e.g. SAMB11) or only the processor (arm cortex M0) ? My  
> understanding leads me to the second one.

Then you are correct :o) FreeRTOS does not rely on anything outside of  
the Cortex-M core unless you are going to write a port specific low  
power tickless mode, in which case you need a clock source which is  
external to the core.

> Next, what are the steps to adapt an example to my board ?

The following links might help:

> **[Creating a new RTOS project](https://www.freertos.org/Creating-a-new-FreeRTOS-project.html)**
>
> Create and use an RTOS project

> **[FreeRTOS - Porting a FreeRTOS demo to a different hardware platform](https://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html)**
>
> FreeRTOS is a portable, open source, mini Real Time kernel. A free RTOS for small embedded systems

In your case adapting the SAMD20 demo might be your best option.

> Currently, I’m able to compile FreeRTOS sources in my project. I’ve  
> first created only one task, and after starting the scheduler, the  
> task was processing correctly (even though I observed that it doesn’t  
> work if timer use is enabled in FreeRTOSConfig.h). I am now trying to  
> create two tasks and check that they both process. The problem is  
> that only one task is executed. I suspect an issue with the systick  
> timer but I don’t know how to fix it.

Have you installed the interrupt handlers? See the “special note for  
ARM Cortex-M users” in bullet point #1 on this page of the FAQ:

> **[FreeRTOS - Open Source RTOS Kernel for small embedded systems](https://www.freertos.org/FAQHelp.html)**
>
> FreeRTOS is a portable, open source, mini Real Time kernel. A free RTOS for small embedded systems

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 28, 2016, 3:01pm UTC](https://forums.freertos.org/t/freertos-on-atmel-samb11/6026/3 "2016-06-28T15:01:27Z")

</div>

**[kev1](https://sourceforge.net/u/kev1/)** wrote on [Tuesday, June 28, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/52a0c9a8/#3741):

Thank you for your fast answer !

> In your case adapting the SAMD20 demo might be your best option.

Ok I will test this demo.

> Have you installed the interrupt handlers? See the “special note for  
> ARM Cortex-M users” in bullet point #1 on this page of the FAQ:  
> [FreeRTOS - Open Source RTOS Kernel for small embedded systems](http://www.freertos.org/FAQHelp.html)

Effectively I have seen this point. I tried different configurations without any success for now. Maybe I misunderstood how to set correctly these interrupt handlers.  
Does the board clock configuration have an importance for FreeRTOS ? For example, basic code of SAMD20 in atmel studio have a specific function that configures the clock, but SAMB11 doesn’t seem to have one.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 1, 2016, 2:53pm UTC](https://forums.freertos.org/t/freertos-on-atmel-samb11/6026/4 "2016-07-01T14:53:05Z")

</div>

**[kev1](https://sourceforge.net/u/kev1/)** wrote on [Friday, July 01, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/52a0c9a8/#edce):

I finally get FreeRTOS working on the soc. I used atmel api which allows to register isr like this:

```auto
system_register_isr(RAM_ISR_TABLE_SYSTICK_INDEX, (uint32_t)xPortSysTickHandler);
system_register_isr(RAM_ISR_TABLE_PENDSV_INDEX, (uint32_t)xPortPendSVHandler);
system_register_isr(RAM_ISR_TABLE_SVC_INDEX, (uint32_t)vPortSVCHandler);

```

I initially thought it was already done somewhere, with `SysTick_Handler` handler…  
With that configuration, I am able to execute two simple tasks concurrently.

BUT, atmel bluetooth sdk states that SAMB11 soc includes a proprietary RTOS which supports multiple tasks: Idle task, firmware task responsible for bluetooth functionnality, and application task (user application). So I guess FreeRTOS is not really compatible with this soc…
