zeptoforth is a portable subroutine-threaded / native code inlining Forth for Cortex-M0+/M4/M7 microcontrollers which includes a preemptively multitasking RTOS designed to be able to compile to and run from both flash and RAM (the kernel of course exists in flash).
The library of code coming with zeptoforth includes support for the following:
- Lambda expressions
- VALUEs, 2VALUEs, and lexically-scoped local variables compatible with DO LOOPs
- Closures
- Double-cell and fixed-point arithmetic, including the usual mathematical functions
- SysTick
- Interrupt-driven serial IO drivers
- A simple GPIO abstraction layer that is maximally uniform across supported platforms
- GPIO and, where applicable, EXTI drivers
- Arbitrary UART support, beyond the console alone
- ADC support
- SPI support
- SDHC/SDXC card support
- FAT32 filesystem and MBR partition table on SDHC/SDXC cards support
- Support for loading code from files in FAT32 filesystems
- Rebooting via Control-C at the console, or Reboot in zeptocom.js
- Attention key commands via Control-T at the console, or Attention in zeptocom.js; currently the only attention key commands are 'z', which sends an exception to the main task, and 't', which, when the task monitor is active, displays information on all running task
- An optional task monitor (note that starting creates a task dedicated to it)
- Preemptive multitasking
- Action scheduling including synchronous messaging between actions on single tasks
- A disassembler
- Moving the exception vector table into RAM so it can be arbitrarily set
- Task notifications
- Semaphores
- Locks
- Signalling exceptions on other tasks
- Message-oriented channels
- Message-oriented rendezvous channels (aka "fchannels")
- Message-oriented synchronous bidirectional reply channels (aka "rchannels")
- Message-oriented ISR-friendly channels (aka "schannels")
- Byte-oriented streams
- Software alarms
- Console redirection
- Object-orientation
- Maps, including counted string and integer-keyed maps
- Temporary buffers
- An allocator
- Memory pools
- Task pools
- Action pools (for the single-task event scheduler)
- A line editor
- LED drivers
- Random number generator drivers (except on STM32F411 "Black Pill" boards)
- Pseudorandom number generation support (using the TinyMT32 PRNG)
- Best-effort fault recovery
- swdcom support for non-UART-based terminal support
On the Raspberry Pi Pico (and other compatible RP2040 boards) it also supports the following:
- An optional USB CDC console
- Programmable input/output (PIO)
- I2C, in both master and slave modes
- PWM, including both input and output
- Hardware timers
- Realtime clocks
- Multicore execution; note that this can be combined with multitasking on each core and multitasking constructs can be shared by both cores
Note that the random number generator is not supported on the RP2040.
On the STM32F746 DISCOVERY board and the Raspberry Pi Pico (and other compatible RP2040 boards) it also supports the following:
- Quad SPI Flash memory
- A block interface
- A block editor
There is also optional support for
- Bitmaps
- I2C SSD1306-based displays (currently these are only usable on the Raspberry Pi Pico (and compatible boards) as I2C has only been implemented for it as of yet
- Monospace bitmap fonts; note that a simple ASCII monospace bitmap font is included
Can You create a working device with screen, keyboard, network (irda) and usb?
for example working time on one charge a month