Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atomvm/AtomVM
Tiny Erlang VM
https://github.com/atomvm/AtomVM
c elixir embedded erlang esp32 hacktoberfest stm32
Last synced: about 1 month ago
JSON representation
Tiny Erlang VM
- Host: GitHub
- URL: https://github.com/atomvm/AtomVM
- Owner: atomvm
- License: apache-2.0
- Created: 2017-11-05T11:54:05.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T21:48:56.000Z (about 2 months ago)
- Last Synced: 2024-05-02T01:12:04.888Z (about 2 months ago)
- Topics: c, elixir, embedded, erlang, esp32, hacktoberfest, stm32
- Language: C
- Homepage:
- Size: 7.45 MB
- Stars: 1,392
- Watchers: 57
- Forks: 92
- Open Issues: 76
-
Metadata Files:
- Readme: README.ESP32.Md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Lists
- awesome-elixir - AtomVM - AtomVM allows to run Elixir/Erlang code on embedded devices such as ESP32 and STM32 microcontrollers. (Miscellaneous)
- beamtoolbox - [ex
- awesome-ccamel - atomvm/AtomVM - Tiny Erlang VM (C)
README
Requirements
============AtomVM has been tested with the version 4 releases of the Espressif esp-idf SDK.
Building AtomVM for ESP32
=========================* activate the esp-idf build environment:
```
cd ${HOME}/esp/esp-idf (or the path to your esp-idf root directory)
. ./export.sh
```* build:
```
cd src/platforms/esp32/ # include the base path to your AtomVM clone i.e.: ${HOME}/AtomVM/src/...
idf.py set-target esp32 # or esp32c3, esp32s2, esp32s3
idf.py menuconfig
idf.py build
```* flash:
```
./build/mkimage.sh
./build/flashimage.sh
```Running BEAM code on ESP32
==========================* BEAM module must be stripped before using PackBEAM:
> Note: The executable is created in the AtomVM/build/tools/packbeam directory.```
./PackBEAM packed.avm module.beam
```* Packed BEAM module should be written to dedicated BEAM partition:
```
$IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x210000 packed.avm
```Running Hello World
===================This example will print a Hello World message.
```
# Flash the hello_world.avm to the device
$ $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x210000 build/examples/erlang/hello_world.avm$ cd src/platforms/esp32
# Open the serial monitor
$ idf.py monitor
```Running Blink Example
=====================This example will switch on and off a led connected to GPIO 2 every second.
Flash blink example using following commands:
```
# Flash the blink.avm to the device
$ $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x210000 build/examples/erlang/esp32/blink.avm
```