No description
Find a file
Jaremy J. Creechley c2c29c5aca
bump versions
2022-07-27 17:55:27 -07:00
.devcontainer import docker container setup 2022-04-12 01:38:00 -07:00
src breaking out exception wrapper to generic template 2022-06-28 00:51:24 +00:00
testresults reorg unit test 2022-06-17 00:39:10 +00:00
tests split up config settings unit test 2022-06-21 16:26:01 -07:00
utils/rpc Revert "Revert "adding support for ipv6 clients"" 2021-10-18 11:29:58 -07:00
.gitignore Initial commit 2021-09-24 17:54:15 -07:00
config.nims setup config opts 2022-06-16 21:07:36 +00:00
LICENSE Initial commit 2021-09-24 17:54:15 -07:00
nephyr.nimble bump versions 2022-07-27 17:55:27 -07:00
nims.cfg macro playround 2021-10-02 00:45:16 -07:00
README.md fix imports 2022-05-02 14:41:48 -07:00

Nephyr

Nim interface and library for Zephyr RTOS. Run Nim on any microcontroller Zephyr supports!

WIP! The API and package layout are still prone to large changes. That being said, it's possible to run Nim code on Zephyr and once it compiles it's appears very stable.

Setup

  1. Install Nim (recommend choosenim )
  • The Nim devel branch is currently required: choosenim devel --latest
  1. Install Zephyr
  • pip3 install west
  • west init -m https://github.com/EmbeddedNim/zephyr.git --mr nephyr-v2.7-branch-patched --narrow $HOME/zephyrproject/
  • note there's work to improve this usine nephyrcli but it's not ready for public use yet
  1. Recommended to install Nephyr using nimble develop as the library will be changing frequently:
  • git clone https://github.com/EmbeddedNim/nephyr.git
  • cd nephyr/
  • nimble develop

Layout

The library layout is broken into two main portions:

  • Nim apis under src/nephyr/
  • C Wrappers under src/zephyr/

Examples

See Nephyr Examples repo for examples.

Why

Zephyr is taking a great approach to modernize RTOS & embedded development. It has support from multiple MCU vendors (NXP, Nordic, TI, etc). In some areas it's still less mature than other RTOS options, however it's rapidly improving and already boasts support for most modern MCU's. It also includes a bootloader, device drivers, and first class CI and testing. The primary downside is the lack of documentation especially when combined with the complicated nature of a very configurable RTOS.

Nephyr's goal is to provide a stable high-level wrapper around Zephyr. However, the hardware APIs are being designed with being compatible with other RTOS'es. Eventually Nim could replace parts of Zephyr C stack with pure Nim solutions.

Status

Working

  • Zephyr networking via POSIX layer
  • Support for using Zephyr sockets & poll
  • Nim wrappers for the basics of Zephyr devices and device tree
  • Support for Firmware OTA updates using Nim
  • I2C works and tested with real devices
  • SPI raw api works, Nim SPI api is written but not verified
  • Basic set of boards working with Nephyr out-of-the-box + nrf52480, STM32-H7 "Disco Boards", Teensy 4 (WIP)

Ongoing

  • Documentation!
  • Significantly improve the Nim interface to the DTS system in Zephyr
  • Setup auto-installer for Zephyr
  • Setup CI builds with Zephyr
  • Setup CI run tests using QEMU