How to use RAMDISK as filesystem on NuttX

NuttX is evolving all the time and although I created a video tutorial at NuttX Channel explaining how to create a RAMDISK, that information is already outdated.

Let’s do it again using the current NuttX version (9.1)

First select the needed options at menuconfig:

Device Drivers  --->
    [*] RAM disk wrapper (mkrd)

Board Selection  --->
    [*] Enable boardctl() interface
    [*] Enable application space creation of RAM disks

File Systems --->
    [*] FAT file system

Compile it and run these commands when NuttX’s nsh show up on serial console:

NuttShell (NSH) NuttX-9.1.0
nsh> ?
help usage: help [-v] []
. cd echo hexdump mkrd pwd test usleep
[ cp exec kill mh rm time xd
? cmp exit ls mount rmdir true
basename dirname false mb mv set uname
break dd free mkdir mw sleep umount
cat df help mkfatfs ps source unset
Builtin Apps:
sh nsh

nsh> mkrd 64
nsh> ls /dev
ram0 <---

nsh> mkfatfs /dev/ram0

nsh> mount -t vfat /dev/ram0 /mnt

nsh> echo "This is a file in RAMDISK" > /mnt/file.txt
nsh> cat /mnt/file.txt
This is a file in RAMDISK

2 thoughts on “How to use RAMDISK as filesystem on NuttX

  1. Interesting. NuttX is maturing into significant capabilities. I can envision situations that could need for small file systems like this.

  2. Hi Celem, I think you missed the NuttX Online Workshop, there you could see that NuttX is very mature. In fact it has more features than even commercial RTOSes. Please take a look, the link for each presentation is at the pinned comment:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s