Giter Club home page Giter Club logo

atomvm_lib's Introduction

AtomVM

Brings Erlang, Elixir and other functional languages to really small systems.

AtomVM implements from scratch a minimal Erlang VM that supports a subset of ErlangVM features and that is able to run unmodified BEAM binaries on really small systems like MCUs.

Supported Platforms

AtomVM aims to be easily portable to new platforms with a minimum effort, so additional platforms might be supported in a near future.

Getting Started

There is much more information, including a more complete "Getting Started Guide", extensive documentation, examples, detailed build instructions, and contact information available on the AtomVM project website.

Don't forget to check out the examples repository to help get you started on your next IoT project.

Please, use v0.6.x releases, main branch is for development purposes and it might be unstable.

Dependencies

Required for building:

Documentation and Coverage:

  • gcov and lcov are optionally required to generate coverage report (make coverage).
  • For documentation build requirements consult the Documentation README.

Step-by-Step Build Instructions (generic unix platform)

$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./src/AtomVM ./examples/erlang/hello_world.avm

Run tests within build directory with:

$ ./tests/test-erlang
$ ./tests/test-enif
$ ./tests/test-mailbox
$ ./tests/test-structs
$ ./src/AtomVM ./tests/libs/estdlib/test_estdlib.avm
$ ./src/AtomVM ./tests/libs/eavmlib/test_eavmlib.avm
$ ./src/AtomVM ./tests/libs/alisp/test_alisp.avm

Complete Build Instructions are available in the documentation for Generic UNIX (Linux, MacOS, FreeBSD, DragonFly), ESP32, STM32, Raspberry Pi Pico (rp2040), and WASM (NodeJS/Web).

Project Status

Build and Test

AtomVM is still in its early stages, but it can run simple applications similar to those available in examples and tests.

AtomVM might crash with a similar message:

Undecoded opcode: 15
Aborted (core dumped)

This basically means that an instruction has not been implemented yet, or that an outdated version has been used. Please, make sure to always run AtomVM using latest version.

Known Limitations

This project is a work in progress, so there are several known limitations, that will prevent to run unmodified software, some of them are:

  • There is a minimal standard library, so several standard functions are missing.
  • Several instructions are not yet implemented.

All of these limitations are going to be fixed in a reasonable amount of time.

About This Project

This project has been created by Davide Bettio, and now is developed from a growing number of contributors.

How to Contribute

Any kind of contribution is welcome, you can either contribute to this repository by improving the virtual machine, the core libraries or the documentation or by contributing to any of the organization repositories.

License

This project is under the terms of the Apache 2.0 license.

atomvm_lib's People

Contributors

arpunk avatar fadushin avatar petermm avatar pguyot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

atomvm_lib's Issues

bme280_example crash

I have a bme280 sensor and I am trying to flash and run the bme280 example. I have added and compiled the components according to these instructions, https://github.com/atomvm/atomvm_lib/blob/master/markdown/components.md and flashed the new VM to the esp32. I am able to run blink and other examples from the top level directory. I run: rebar3 esp32_flash -p /dev/ttyUSB0 -b 115200 in the example directory and it successfully flashes the avm. when I connect to the device and monitor it I get this:

โžœ esp32 git:(master) โœ— make monitor
Toolchain path: /home/alexander/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
Compiler version: 5.2.0
Python requirements from /home/alexander/esp/esp-idf/requirements.txt are satisfied.
MONITOR
--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6620
load:0x40078000,len:11020
ho 0 tail 12 room 4
load:0x40080400,len:6668
entry 0x40080778
I (70) boot: Chip Revision: 1
I (34) boot: ESP-IDF v3.2.5-1-g110d230e36-dirty 2nd stage bootloader
I (34) boot: compile time 13:41:48
I (34) boot: Enabling RNG early entropy source...
I (40) boot: SPI Speed : 40MHz
I (44) boot: SPI Mode : DIO
I (48) boot: SPI Flash Size : 4MB
I (53) boot: Partition Table:
I (56) boot: ## Label Usage Type ST Offset Length
I (63) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (71) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (78) boot: 2 factory factory app 00 00 00010000 001c0000
I (86) boot: 3 lib.avm RF data 01 01 001d0000 00040000
I (93) boot: 4 main.avm RF data 01 01 00210000 00100000
I (101) boot: End of partition table
I (105) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1fa88 (129672) map
I (160) esp_image: segment 1: paddr=0x0002fab0 vaddr=0x3ffb0000 size=0x00560 ( 1376) load
I (160) esp_image: segment 2: paddr=0x00030018 vaddr=0x400d0018 size=0xa96bc (693948) map
0x400d0018: _stext at ??:?

I (410) esp_image: segment 3: paddr=0x000d96dc vaddr=0x3ffb0560 size=0x03a84 ( 14980) load
I (416) esp_image: segment 4: paddr=0x000dd168 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at /home/alexander/esp/esp-idf/components/freertos/xtensa_vectors.S:1779

I (417) esp_image: segment 5: paddr=0x000dd570 vaddr=0x40080400 size=0x17858 ( 96344) load
I (465) esp_image: segment 6: paddr=0x000f4dd0 vaddr=0x400c0000 size=0x00064 ( 100) load
I (466) esp_image: segment 7: paddr=0x000f4e3c vaddr=0x50000000 size=0x00004 ( 4) load
I (486) boot: Loaded app from partition at offset 0x10000
I (486) boot: Disabling RNG early entropy source...
I (487) cpu_start: Pro cpu up.
I (490) cpu_start: Starting app cpu, entry point is 0x4008132c
0x4008132c: start_cpu1_default at /home/alexander/esp/esp-idf/components/esp32/cpu_start.c:452

I (0) cpu_start: App cpu up.
I (501) heap_init: Initializing. RAM available for dynamic allocation:
I (508) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (514) heap_init: At 3FFB9FE8 len 00026018 (152 KiB): DRAM
I (520) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (526) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (533) heap_init: At 40097C58 len 000083A8 (32 KiB): IRAM
I (539) cpu_start: Pro cpu start user code
I (222) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.

###########################################################

   ###    ########  #######  ##     ## ##     ## ##     ## 
  ## ##      ##    ##     ## ###   ### ##     ## ###   ### 
 ##   ##     ##    ##     ## #### #### ##     ## #### #### 
##     ##    ##    ##     ## ## ### ## ##     ## ## ### ## 
#########    ##    ##     ## ##     ##  ##   ##  ##     ## 
##     ##    ##    ##     ## ##     ##   ## ##   ##     ## 
##     ##    ##     #######  ##     ##    ###    ##     ## 

###########################################################

I (323) AtomVM: Starting AtomVM revision 0.6.0-dev+git.fc5778c
I (323) AtomVM: Loaded BEAM partition main.avm at address 0x210000 (size=1048576 bytes)
I (383) AtomVM: Found startup beam bme280_example.beam
I (383) AtomVM: Loaded BEAM partition lib.avm at address 0x1d0000 (size=262144 bytes)
I (383) AtomVM: Starting bme280_example.beam...

CRASH

pid: <0.1.0>
cp: #CP<module: 0, label: 2, offset: 28>

x[0]: error
x[1]: {badmatch,{error,{bad_return_value,{badmatch,error}}}}

Stack

#CP<module: 0, label: 16, offset: 0>

Registers

x[0]: error
x[1]: {badmatch,{error,{bad_return_value,{badmatch,error}}}}
x[2]: []
x[3]: []
x[4]: []
x[5]: []
x[6]: []
x[7]: []
x[8]: []
x[9]: []
x[10]: []
x[11]: []
x[12]: []
x[13]: []
x[14]: []
x[15]: []

Mailbox

End Of Crash Report
AtomVM finished with return value: error
I (503) AtomVM: AtomVM application terminated. Going to sleep forever ...

Am I missing something here?

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.