Micrium OS File System RAM Disk on EFM32GG11

The objective of this blog is to show you the steps necessary to add the Micrium OS File System to an EFM32GG11. I'll be focusing on RAM Disk as the storage media while we wait for an SD card example project to become available.

Baseline Project

Since the Gecko SDK currently ships without a stand-alone Micrium OS File System example, we will start with the 'micriumos_usbhmsc' project for the SLSTK3701A_EFM32GG11. The convenience of selecting this project as a baseline is due to the fact that the Micrium OS File System is present as a requirement from USB-Host Mass Storage Class, which is what that example demonstrates.

Start by connecting your SLSTK3701A_EFM32GG11 to the PC and launching Simplicity Studio, then click on File -> New -> Project...

Select Silicon Labs MCU Project and click Next >

Since you already have your board connected, it should all be auto-detected. Leave everything by default making sure that there's an SDK selected, then click Next >

Now select Example - Create a working example for the part. and click Next >

In the search bar, type "SLSTK3701A_micriumos_usbhmsc", then select it and click Next >

Pick a name for your project, in my case, I named the project "SLSTK3701A_micriumos_ramdisk". Make sure you select Copy contents so that we can edit the example files freely. After that, click Finish.

Try to build the project and flash it to make sure that it is functional, remember, this will be our baseline for what's coming next...

Configuration Files

We will now need to modify the project configuration files in order to include Micrium OS FS RAM Disk as part of our build.

For that, start by expanding the Includes section in the Project Explorer panel, then expand the configuration folder as shown in the image below. After that, double-click on rtos_description.h to open it in the editor.

As soon as you try to edit rtos_description.h, you'll be presented a Warning indicating that you are editing an SDK file. Click on Make a Copy so that we can edit this freely in our workspace without affecting other projects in the SDK.

Add the following #define in rtos_description.h to indicate Micrium OS that you want to use the File System RAM Disk implementation:

#define RTOS_MODULE_FS_STORAGE_RAM_DISK_AVAIL

Editing the Example Files

At this point, your application is able to create a RAM Disk using the Micrium OS File System. However, we want it to do some more. Let's now perform a simple file read and write. For that, copy the ex_fs_file_rd_wr.c and .h example files located at: