A generic OCaml virtual machine for running OCaml programs on resource-constrained microcontrollers like AVR and PIC32.
OMicroB is an OCaml virtual machine designed to execute OCaml programs on microcontroller boards with very limited resources, such as those with only 2.5 KB of RAM. It enables functional programming on embedded devices by performing static analysis to minimize the final executable size. The project includes a generic VM core that can be ported to various architectures and tools for simulation and device flashing.
Embedded systems developers and OCaml programmers who want to write high-level functional code for resource-constrained microcontrollers like AVR (e.g., Atmega32u4) and PIC32.
Developers choose OMicroB to bring the safety and expressiveness of OCaml to embedded systems, offering a unique solution for functional programming on severely limited hardware with integrated optimization, simulation, and flashing tools.
An OCaml generic virtual machine for microcontrollers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Targets microcontrollers with only 2.5 KB RAM, enabling OCaml programs on severely constrained devices like the Atmega32u4, as highlighted in the README.
Performs multiple optimization passes to minimize executable size, crucial for resource-limited environments, with evidence from the static analysis described in the project features.
Includes a circuit simulator for testing on a computer, such as simulating an Arduboy device for games, saving hardware costs during development.
Supports AVR and PIC32 microcontrollers, allowing adaptation to different hardware platforms, though limited to these architectures.
Provides commands like 'omicrob -flash' to compile and flash hex files directly to hardware, simplifying the deployment process as shown in the usage examples.
Requires OPAM2, specific compilers like avr-gcc and xc32, and manual configuration in the *configure* file, which can be error-prone and time-consuming.
Currently only supports AVR and PIC32, missing popular platforms like ARM Cortex-M, restricting its applicability in broader embedded contexts.
Dependent on OCaml >=4.07 due to bytecode changes, limiting compatibility with older OCaml projects or tools, as noted in the requirements.
OCaml is less common in embedded systems, resulting in fewer libraries and community resources compared to C/C++ alternatives, making support and troubleshooting harder.