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

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?

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.

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)

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 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:

#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:

volatile uint32_t ulCounter1 = 0, ulCounter2 = 0;

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

void vTask2( void *pvParameters )
    for( ;; )

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.

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) ?

That’s correct - GCC/ARM_CM4F does not contain any .S file.

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.


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?

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.

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 :slight_smile:

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!

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.

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.

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 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.