Embedded Storage on the snickerdoodle

This is a continuation of the snickerdoodle adventure, following last week’s successful “hello world” , using Micrium’s µC/OS RTOS. In this series of articles, I’m exploring the capabilities of the snickerdoodle as a development platform for high performance real-time operating systems.

This time, I will be running an embedded file system on the snickerdoodle module, enabling non-volatile storage capabilities. The bare snickerdoodle module includes an SD card cage in addition to an on-board NOR flash. While it is possible to use the NOR flash, this post will focus on the SD card, which offers more versatility for development and prototyping.

Vivado, SDK and BSP integration

A very nice feature of the Vivado Design Suite is the integration between Vivado, the SDK, and the software BSP. This means that peripheral configuration can be communicated to the underlying BSP. If properly implemented, peripherals can be configured for an operating system with very little developer intervention. Similar to the previous kernel-only example, Micrium provides a tutorial on how to use their embedded file system within the Xilinx SDK.

Using the SD Card with the µC/OS BSP

First things first: Since I’m still using U-Boot, the SDIO frequency must be adjusted to match the U-Boot configuration. In this case, 50Mhz instead of 100Mhz.

Zynq SDIO clock configuration
Zynq SDIO clock configuration

Having made that small modification, in the SDK, we can add the ucos_fs library in order to include the file system core files. If you are creating a new demonstration project, choosing the file system demo project will automatically add the ucos_fs library to the BSP.

SDK file system library configuration
SDK file system library configuration

After adding the FS library, it’s now possible to select an SDIO interface to initialize. In the case of the snickerdoodle, two of them are available. ps7_sd_0 is the card cage on the module, while ps7_sd_1 is exposed through the connectors.

SD Card interface selection
SD Card interface selection

Building and running the project…

FS demonstration terminal output
FS demonstration terminal output

We now have, with a few simple steps, added file storage on the snickerdoodle. For now, the rest of the peripherals, including USB and Ethernet, will have to wait until I receive the piSmasher SBC baseboard.

Questions or comments?

Do not hesitate to contact us at blog@jblopen.com. Your questions, comments and, suggestions are appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *