-
Notifications
You must be signed in to change notification settings - Fork 29
Home
Welcome to the OpenMRN wiki!
OpenMRN is a portable library implementing a protocol stack for model railroads. It follows the standards in development at OpenLCB, which have been adopted by the NMRA (National Model Railroad Association) under the name of NMRAnet. As transport layer this protocol stack currently uses CAN-bus and TCP/IP.
The OpenMRN source tree also provides a set of example ports and a couple of simple applications. The intention is that hardware and application developers use OpenMRN as a basic stack, and link their application-specific logic together with it to create their production software or firmware.
OpenMRN provides a basic runtime environment, including a hardware and OS abstraction layer that allows applications to be easily ported between dramatically different platforms (medium to upper-scale microcontrollers, Linux, MacOS, Windows). The abstraction layer mostly operates on POSIX principles, and OpenMRN implements a file interface using file descriptors and read-write-ioctl calls in an MCU environment.
OpenMRN is multi-threaded and uses a combination of collaborative and preemptive multitasking. Threading is part of the OS abstraction layer, which allows threaded application logic to be ported between different operating systems, including running threaded application code on microcontrollers. Current ports use FreeRTOS on MCUs.
OpenMRN is open-sourced under a very liberal XXX-style license. This allows you to use OpenMRN in a commercial application, including making changes to it and linking together with other (including proprietary) code under different licenses to form a final product. For details about licensing, please see the LICENSE file and the header comments available in every source file.
OpenMRN is currently ported to the following hardware and software environments:
- Linux
- MacOS
- Windows using MinGW
- FreeRTOS with 32-bit MCUs.
The FreeRTOS port is hardware-specific, and currently works on the following hardware:
- ARM Cortex-M3/M4, Texas Instruments Stellaris/Tiva LM4F120 and TM4C123 (from TI Stellaris/Tiva LaunchPad evaluation kits)
- ARM Cortex-M3, NXP LPC1768 (from mbed 1768 and LPCXpresso 1768)
- ARM Cortex-M3, ST Microelectronics's STM32F103 (from LeafLabs Maple and Olimexuino STM32)
- ARM Cortex-M0, NXP LPC11C24 (from LPCXpresso 11Cxx; limited functionality due to small flash)
- ARM7TDMI, NXP LPC2368 (from FEZ Panda II)
- MIPS4K, Microchip's PIC32MX (from Olimex DuinoMite Mega)
The OpenMRN stack in its current form for a simple node should fit comfortably into microcontrollers with 128 kbytes of flash and 20 kbytes of ram. Under these limits one might need moderate to significant effort in optimizing the compiling and linking process, removing features (for flash space savings), or optimizing the threading usage and runtime buffers (for RAM savings). The smallest MCU that has ever run OpenMRN had 32kB of flash and 8 kB of RAM, but these specs did not fit a standards-compliant stack anymore.
More complex tasks (e.g. a command station) might need more code and data space. For development we also recommend more RAM and flash (for debugging features and to allow not caring for compiler and linker optimizations at initial stages).
No-one has ever tried to port OpenMRN to 16 or 8-bit MCUs.