µ-layer for Pico]OS

Pico]OS itself contains two layers: pico for essential operating system primitives like tasks and nano for higher-level things like dynamic memory allocation and console io. Built on those layers, this library contains a free FAT filesystem implementation from elm-chan.org and other miscellaneous stuff.

Library can be configured with UOSCFG_* defines in uoscfg.h.

In addition to FAT filesystem following utility routines are provided:

void uosInit(void);

Must be called before posInit or nosInit to initialize library. Currently initializes a hardware timer used by uosSpinUSecs.

void uosSpinUSecs(uint16_t);

Sleep (spin) for specificed number of microseconds. Uses hardware timer (actual timer unit used depends on hardware, see source code for details).

void uosBootDiag(void);

Displays copyright notices, RAM usage information and task & event count limit information to console. I usually call this at the beginning of main task. This function assumes that symbols from GCC linker are available so don’t expect it to work with all Pico]OS ports. Pico]OS must be compiled with NOSCFG_FEATURE_CONOUT.

void uosResourceDiag(void);

Displays a diagnostic message to console about currently running tasks and how muck stack space they have used. Number of event objects (semaphores / mutexes) is also displayed. This function works only with my cortex-m, msp430 and lpc2xxx ports currently as it assumes that stack is initialized with special marker data. Pico]OS must be compiled with NOSCFG_FEATURE_CONOUT and POSCFG_FEATURE_DEBUGHELP.

FAT filesystem requires the various disk_xxx functions are provided by calling program for accessing physical disk (for example memory card). I have Olimex MSP430-4619LCD board for testing FAT with SD card, but I haven’t had time to try it yet.

Source code is available at Github.

Ari Suutari

Father of three 🙂
{ Electronics | Music | Computer | Motorbike } hobbyist.
Factory IT professional.
FreeBSD since day one.

Facebook LinkedIn