Coder Social home page Coder Social logo

carllocos / warduino Goto Github PK

View Code? Open in Web Editor NEW

This project forked from topllab/warduino

0.0 0.0 0.0 4.6 MB

A dynamic WebAssembly VM for embedded systems

Home Page: https://conf.researchr.org/details/mplr-2019/mplr-2019-papers/3/WARDuino-A-Dynamic-WebAssembly-Virtual-Machine-for-Programming-Microcontrollers

License: Mozilla Public License 2.0

Shell 0.19% JavaScript 0.54% C++ 87.38% Python 0.35% C 4.56% TypeScript 4.93% Makefile 0.76% CMake 1.29%

warduino's Introduction

WARDuino

Wasm virtual machine for ESP32 / Arduino

About

This project is released under the Mozilla Public License 2.0, and is being developed as part of an active research project at the University of Ghent's TOPL Lab.

  • The WARDuino virtual machine is a WebAssembly runtime for microcontrollers, which runs both under the Arduino and ESP-IDF toolchains.
  • The WARDuino virtual machine features an extensive debugger with novel techniques such as out-of-place debugging.
  • The virtual machine allows developers to implement their own primitives in C++, which are callable from Wasm.
  • The WARDuino project also includes a VS Code extension to use both the remote debugging and the out-of-place debugging facilities offered by the virtual machine.

Note: WARDuino is not 1.0, since this is an active research project. Expect possible bugs or performance issues.

Build and Development Instructions

Supported platforms: Linux (Ubuntu), macOS, ESP-IDF, Arduino

The project uses CMake. Quick install looks like this:

git clone --recursive [email protected]:TOPLLab/WARDuino.git
cd WARDuino
mkdir build-emu
cd build-emu
cmake .. -D BUILD_EMULATOR=ON
make

This will build the command-line tool (emulator), which has been tested on both linux and macOS.

The WARDuino VM can be compiled with both the Arduino and ESP-IDF toolchains, and has been extensively tested on different ESP8266 and ESP32 microcontrollers.

Build for ESP-IDF

warning: primitive support for IDF is under construction

Before you can compile and flash with ESP-IDF, you must install and enable the toolchain. You also need to disable the watchdog timer:

  1. Go to the root folder of the WARDuino repo
  2. run idf.py menuconfig
  3. Under Component config โ†’ ESP System Settings disable the following options:
    • Interrupt watchdog
    • Initialize Task Watchdog Timer on startup
  4. Save and quit the menu

Make sure the ESP-IDF tools are enabled, otherwise these steps will not work.

To install the WARDuino with the ESP-IDF toolchain perform the following steps starting from the project root folder:

mkdir build
cd build
cmake .. -D BUILD_ESP=ON
make flash

Or simply run idf.py flash.

Build for Arduino

First, install the arduino-cli. You will also need python3 with the pyserial pacakge.

Second, create the config file:

arduino-cli config init

If you need additional boards, such as the esp32 boards, you can add them in the generated config file. More information on how to install the esp32 boards can be found here. (note: WARDuino requires at least version 2.0.2 of the esp32 board manager when using esp32 devices)

Thirdly, make sure you install the PubSubClient and Adafruit NeoPixel library. (used for MQTT and pixel primitives)

arduino-cli lib install "PubSubClient" # for MQTT
arduino-cli lib install "Adafruit NeoPixel" # for some primitives

To build for Arduino with WIFI support you need to also install the following third-party libraries. (You might need to set enable_unsafe_install to true in your arduino config)

arduino-cli lib install FreeRTOS
arduino-cli lib install --git-url https://github.com/me-no-dev/AsyncTCP.git

If you haven't done so already, clone (or symlink) this repository to ~/Arduino/libraries to make WARDuino availible to Arduino.

After this initial installation steps you can start using WARDuino with the Arduino toolchain. You can upload the example file as follows, starting from the project root:

cd platforms/Arduino
make compile
make flash

Build for Emulator

WARDuino can also be build as a command-line tool for a desktop environment. The purpose of this CLI is to allow developers to test WARDuino applications without the need to buy a microcontroller. The CLI is also used to run the various unit and specification tests for WARDuino.

To install the CLI perform the following steps starting from the project root folder:

mkdir build-emu
cd build-emu
cmake .. -D BUILD_EMULATOR=ON
make

WebAssembly Specification tests

cd tests/latch
npm run spectest

Technical support and feedback

For a feature request or bug report, create a GitHub issue.

LICENCE

WARDuino by Robbert Gurdeep Singh, Tom Lauwaerts, Christophe Scholliers and Joel Martin is licensed under a MPL-2.0 License. This is a derivative work of kanaka/wac by Joel Martin.

If you need to cite WARDuino in your research, use:

@inproceedings{WARDuino2019,
 author = {Gurdeep Singh, Robbert and Scholliers, Christophe},
 title = {WARDuino: A Dynamic WebAssembly Virtual Machine for Programming Microcontrollers},
 booktitle = {Proceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes},
 series = {MPLR 2019},
 year = {2019},
 isbn = {978-1-4503-6977-0},
 location = {Athens, Greece},
 pages = {27--36},
 numpages = {10},
 url = {http://doi.acm.org/10.1145/3357390.3361029},
 doi = {10.1145/3357390.3361029},
 acmid = {3361029},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {Arduino, Live Code Updates, Virtual Machine, WebAssembly},
}

warduino's People

Contributors

tolauwae avatar carllocos avatar beardhatcode avatar chscholl avatar dependabot[bot] avatar

warduino's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.