Picolibc is an excellent C runtime library for small or embedded systems. However sometimes we want more than what can be offered in Picolibc. This is where Morelibc comes in. Morelibc is an add-on to Picolibc that provides more of the standard C/POSIX programming interface which developers are accustomed to. Specifically Morelibc provides:
- Multi-threaded concurrency through integration with FreeRTOS and including implementations of
select
andpoll
. - A virtual file system (VFS) providing a Unix-like directory structure, the ability to mount additional storage devices, and implement additional file system types.
- A simple driver model for implementing hardware-specific drivers for storage (block) and communication (character) devices.
- Dynamic linking support (i.e., DLLs or shared libraries) to allow libraries to be built, distributed, and installed without recompiling or reinstalling the firmware.
- Raspberry Pi RP2040 and RP2350
In theory, support can be added for any platform that supports Picolibc and FreeRTOS.
This project also contains a number of optional components for integrating popular embedded system libraries with the Morelibc core.
- FatFS: driver for FAT file system
- littlefs: driver for littlefs file system
- lwIP: socket programming interface (coming soon)
- TinyUSB: drivers for CDC (serial) and MSC (storage) devices (USB device-side only)
To build the minimal example:
morelibc/example$ cmake -B build
morelibc/example$ cmake --build build
This will download FreeRTOS and Pico SDK to be self-contained. An established project can use its existing copies of these projects, although particular versions may matter.
MicroPythonRT is an example of using Morelibc in a larger project.