# EFM32 Low Power RTOS Demo does not work in Simplicity Studio V4

**URL:** <https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236>\
**Category:** Kernel\
**Created:** [March 14, 2020, 3:47am UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236 "2020-03-14T03:47:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 14, 2020, 3:47am UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/1 "2020-03-14T03:47:36Z")

</div>

EFM32 Low Power RTOS Demo does not work in Simplicity Studio V4. Cannot do a clean, says no rules for Clean.  
Maybe because example was built with version v4.8.3. of GNU ARM. Examples by Silicon labs that work are built with v7.2.1.  
I have support for Gecko Giant, Pearl, Wonder included, but it seems to imply it cannot find a part matching the project?

---

<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:** [March 14, 2020, 3:54am UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/2 "2020-03-14T03:54:54Z")

</div>

I think this is because of an incompatibility in the ide version which is new than the version used to create the project. You would have to create a new project. Do you know how to do that? The same port files should work though.

---

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 17, 2020, 4:43am UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/3 "2020-03-17T04:43:36Z")

</div>

![image](https://d2v6vdsk2p900z.cloudfront.net/original/1X/4adc79c4df57269a1e1965fbe8388fbfc752e5e1.png)

I have a Wonder Gecko board. Using Simplicity Studio V4, I created a new Silicon labs MCU project : this requires i) choosing board (I chose, “Wonder Gecko Starter Kit” ii) requires choosing part, I chose EFM32WG990F256; iii) requires choosing SDK, I chose: Gecko SDK suite MCU 5.6.1 …

So now I have a project for this processor + board with the tool chain in SDK.  
After this I need to pull in the FreeRTOS Demo files into this project. Which files of the original FreeRTOSDemo go where?  
Could you please guide me a little more?

(By the way, in Simplicity 4, I tried to import the entire demo project into the IDE… Although the project got imported, but I had all kinds of error… so I am assuming that is not the route to go)

---

<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:** [March 17, 2020, 4:57am UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/4 "2020-03-17T04:57:13Z")

</div>

You mention you want to pull in the demo…but have you got the kernel source code in yet? Would recommend pulling in the source code and doing something really simple to check it is working before pulling in the demo code.

Have a look at the following: [https://www.freertos.org/Creating-a-new-FreeRTOS-project.html](https://www.freertos.org/Creating-a-new-FreeRTOS-project.html) for bringing in the source code. The port layer you need is FreeRTOS/Source/portable/GCC/ARM\_CM4F - the .c and .S file in that directory, plus ensure that directory is in the compilers include path.

If your development environment uses CMSIS names for the interrupt service routines you will need to add the following to FreeRTOSConfig.h in order to map the FreeRTOS interrupt service routine names to the CMSIS interrupt service routine names names:

```auto
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler

```

Otherwise you will need to install the FreeRTOS interrupt service routines vPortSVCHandler, xPortPendSVHandler and xPortSysTickHandler into the vector table manually.

Then if the project has a simple blinky demo you can run that, otherwise do something really simple such as create two tasks as follows at the same priority, start the scheduler, and check both counters increment:

```auto
volatile uint32_t ulCounter1 = 0, ulCounter2 = 0;

void vTask1( void *pvParameters )
{
    for( ;; )
    {
        ulCounter1++;
        taskYIELD(); // Checks the yield interrupt is working.
   }
}

void vTask2( void *pvParameters )
{
    for( ;; )
    {
        ulCounter2++;
   }
}

```

Counter 2 should count thousands of times more than counter 1 as task 1 yields to task 2 after each increment, whereas task 2 only yields to task 1 at a tick interrupt.

---

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 17, 2020, 4:34pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/5 "2020-03-17T16:34:34Z")

</div>

Thanks for the guidance (this will also help me to show some other folks that are working under IAR on the same processor, how to proceed)

Q1: I see only port.c and portmacro.h files under: FreeRTOS/Source/portable/GCC/ARM\_CM4F. There is no .S file in that directory.

Q2: Is it important to not having any of the other port files e.g. fro CM3, or for other compilers. Or is it OK to leave them in there (along with the correct group of GCC/ARM\_CM4F) ?

---

<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:** [March 17, 2020, 5:54pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/6 "2020-03-17T17:54:22Z")

</div>

> [@](#):
>
> Q1: I see only port.c and portmacro.h files under: FreeRTOS/Source/portable/GCC/ARM\_CM4F. There is no .S file in that directory.

That’s correct - GCC/ARM\_CM4F does not contain any .S file.

> [@](#):
>
> Q2: Is it important to not having any of the other port files e.g. fro CM3, or for other compilers. Or is it OK to leave them in there (along with the correct group of GCC/ARM\_CM4F) ?

It is okay to have additional port files in there as long as you make sure that your project does not compile them. If you do compile more than one port files, you will get “multiple definitions” linker error.

Thanks.

---

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 24, 2020, 9:21pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/7 "2020-03-24T21:21:51Z")

</div>

OK Thanks for that. I have the FreeRTOS running with three tasks at the same priority level; forced in a sequence by using three binary semaphores (just to make sure tasks switching was happening as I expected). Now I want to run the RTOS in Tickless mode.  
I created a similar project for IAR/ARM\_CM3 port files. Next step:  
My understanding is that I can use files as follows: from the FreeRTOS directory structure:  
copy FreeRTOSConfig.h and replace with it the ProjName/Source/FreeRTOSConfig.h  
copy low\_power\_tick\_management\_RTC.c to FreeRTOS/Source/portable/IAR/ARM\_CM3  
For running the low power demo:  
copy main\_low\_power.c to ProjName/Source  
On building, the setupTimerInterrupt and SuppressTicksAndSleep will override the generic functions; and I will be able to run the low power demo. As well as use the changes to run my main application in Tickless mode… Is that correct or I am missing something in my understanding?

---

<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:** [March 24, 2020, 10:15pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/8 "2020-03-24T22:15:52Z")

</div>

Sounds right, assuming the hardware timers and software libraries are the same for your project as the project from which you are getting the files. Personally i would not put low\_power\_tick\_management\_RTC.c in FreeRTOS/Source/portable/IAR/ARM\_CM3, but keep it in a project specific directory, as it is specific to the chip rather than specific to the Cortex-M3 core.

---

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 25, 2020, 4:41pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/9 "2020-03-25T16:41:25Z")

</div>

I have Giant Gecko microcontroller EFM32GG395F1024 (CM3) being developed under IAR. I pulled portable files from FreeRTOS/Source/Portable/IAR/ARM-CM3. For the low power files, I went to \FreeRTOS\Demo\CORTEX\_EFM32\_Giant\_Gecko\_Simplicity\_Studio. (I am hoping this will get me pretty close if not exactly right).

Good point about the location of low\_power\_tick\_management\_RTC.c. I could create a subfolder under ARM\_CM3/ for this processor or put the file in existing EFWL folder that has a lot of processor specific stuff. Either case, I will ensure this location is in the compiler path. What do you think? (both points). Really appreciate your guidance on all the steps 🙂

---

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 30, 2020, 8:55pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/10 "2020-03-30T20:55:49Z")

</div>

The FreeRTOS\Demo\CORTEX\_EFM32\_Giant\_Gecko\_Simplicity\_Studio has the file main\_low\_power.c that needs bsp.h file, but I cannot find any in the entire FreeRTOS directory. There a few r\_BSP.h files that Renaises are exclusively for use by their customers. I cannot build the main\_low\_power.c file without this .h file. Could you help? 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:** [March 30, 2020, 9:50pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/11 "2020-03-30T21:50:28Z")

</div>

Looking at the project file I see include paths such as “studio:/sdk/Device/SiliconLabs/EFM32GG/Include/” - those paths are not in the FreeRTOS download so it looks like you need to install something from Silicon Labs too. Maybe a board support package, or their drivers. Perhaps these come with Simplicity Studio. We know there are some build issues due to updates in the Simplicity Studio tools since the demo was created but I don’t think this is an issue anybody has raised before.

---

<div class="post-metadata">

**Author:** ![teklike](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@teklike](https://forums.freertos.org/u/teklike)\
**Post date:** [March 30, 2020, 10:00pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/12 "2020-03-30T22:00:57Z")

</div>

I was pulling these files from the DEMO folder of FreeRTOS. Specifically in my case: C:\Tools\FreeRTOS\_12112019\FreeRTOSv10.2.1\_191129\FreeRTOS\Demo\CORTEX\_EFM32\_Giant\_Gecko\_Simplicity\_Studio\Low\_Power\_Demo.  
One level higher is a folder that has the .c files for the bsp but it seems you guys did not put in the bsp.h file anywhere in the package (at least not where I can find using search routines). Just looking at the package that you are providing under FreeRTOS… any suggestions where I can go look for this header file. This is the last step for me to build the low power demo. Once I complete this, others can use it.

---

<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:** [March 30, 2020, 10:31pm UTC](https://forums.freertos.org/t/efm32-low-power-rtos-demo-does-not-work-in-simplicity-studio-v4/9236/13 "2020-03-30T22:31:27Z")

</div>

As per my previous comment - just from looking at the include paths in the project is appears as if the bsp is coming from a Silicon Labs directory, not a FreeRTOS directory. Also I note the " Building and executing the demo application" section of [the instructions page](https://www.freertos.org/EFM32-Giant-Gecko-Pearl-Gecko-tickless-RTOS-demo.html) says “Ensure you have Giant and/or Pearl Gecko starter kit support included in your Simplicity Studio installation” - so I think that is the part you are missing.
