Releases: atomvm/AtomVM
v0.6.6
v0.6.6 release
Unfortunately, this release does not yet include support for OTP-28. We recommend using a supported version such as OTP-27 for the best experience with AtomVM v0.6.6.
That said, if you're eager to experiment, our main development branch inc ludes support for OTP-28. We strive to keep up with the latest OTP changes, so adventurous users are welcome to try it out—with the usual caution that comes with using a development branch.
If you're on macOS, be aware that both Homebrew and MacPorts now default to OTP-28. To install an earlier version, you can use:
brew install erlang@27Alternatively, consider using asdf or mise to manage multiple Erlang/OTP versions with ease.
Please, read the getting started guide for flashing instructions.
Added
- Added the ability to run beams from the CLI for Generic Unix platform (it was already possible with nodejs and emscripten)
- Added preliminary support for ESP32P4 (no networking support yet).
- Added memory info in
out_of_memorycrash logs to help developers fix memory issues. - Added documentation and function specs for uart driver
- Added
uart:read/2with a timeout parameter. - Missing
erlang:is_function/2BIF - Added
erlang:is_record/2 - Added ability to set per-interface
dhcp_hostnameon Pico W if present in config.
Fixed
- Fixed specifications of nifs from
esp_adcmodule - ESP32: fix
gpio:init/1on GPIO >= 32 - Adding missing check, passing a non numeric argument to a function expecting a floating point might lead to a crash in certain situations.
- Fixed several bugs in
http_server(#1366) - Fixed generic_unix
socket_driverto return{gen_tcp, closed}when socket is closed on Linux
instead of{gen_tcp, {recv, 104}} - Fixed a memory leak where modules were not properly destroyed when the global context is destroyd
- alisp: fix support to variables that are not binaries or integers.
- Fixed destruction of ssl-related resources
- Fixed corruption when dealing with specific situations that involve more than 16 x registers when certain VM instructions are used.
- Fixed ESP32 GPIO interrupt trigger
none - Fixed an issue where a timeout would occur immediately in a race condition
- Fixed SPI close command
- Added missing lock on socket structure
- Fixed a race condition affecting multi-core MCUs where a timeout would not be properly cleared
- Fixed a double free when esp32 uart driver was closed, yielding an assert abort
- Fixed compilation with latest debian gcc-arm-none-eabi
- Fixed
network:stop/0on ESP32 so the network can be started again - Fixed a memory corruption caused by
binary:split/2,3 - Fixed deadlock in socket code
- Fixed bug in opcode implementation (
select_val): when selecting a value among many others a shallow comparison was performed, so it was working just for plain values such as atoms and small integers - Fixed support for setting esp32 boot_path in NVS.
- Fixed race conditions in network:start/stop.
- Fixed crash calling network:sta_rssi(), when network not up.
- Fixed error handling when calling
minandmaxwith code compiled before OTP-26: there was a bug when handling errors from BIFs used as NIFs (when called withCALL_EXTand similar opcodes) - Fixed matching of binaries on unaligned boundaries for code compiled with older versions of OTP
- Added missing out of memory handling in binary_to_atom
- Fixed call to funs such as fun erlang:'not'/1, that make use of BIFs
- Fixed potential crashes or memory leaks caused by a mistake in calculation of reference counts and a race condition in otp_socket code
- Fixed an out of memory issue by forcing GC to copy data from message fragments
- Fixed a bug where calling repeatedly
process_infoon a stopped process could cause an out of memory error - Fixed possible concurrency problems in ESP32 UART driver
- Fixed concurrency and memory leak related to links and monitors
- Fixed issues with parsing of line references for stack traces
- Fixed memory corruption issue with
erlang:make_tuple/2 - Fix potential use after free with code generated from OTP <= 24
- Fix
is_function/2guard - Fixed segfault when calling
lists:reverse/1(#1600) - Fixed nif_atomvm_posix_read GC bug
- Fixed
erlang:is_number/1function, now returns true also for floats - Fixed unlink protocol and add support for
link/1on ports - Do not abort when an out of memory happens while loading a literal value
- Fixed potential memory corruption when handling integer immediates that are stored as boxed integer (this never happens with integers < 28 bits)
- Correctly set Pico-W unique dhcp hostname when using the default, previously all rp2040 devices used the same "PicoW" dhcp hostname, causing collisions when multiple rp2040 are on the same network. (See issue #1094)
Changed
- ESP32 UART driver no longer aborts because of badargs in configuration, instead raising an error
- ESP32:
v0.6.6uses esp-idf v5.4.1 for pre-built images andv5.4.xis the suggested release also for custom builds
v0.6.5
v0.6.5 release
Please, read the getting started guide for flashing instructions.
Important note: this version uses a different partitioning layout for ESP32 Elixir images (and dedicated images) that have room for additional Elixir modules. Make sure to use updated tooling and offsets.
Known Issues
i2c:write_byteson ESP32 seems not working, usei2c:write_byteinstead.
Added
- ESP32: add a new Elixir release "flavor" with a bigger boot.avm partition that has room for
Elixir standard library modules - ESP32:
--bootoption to mkimage.sh tool - Add
erlang:atom_to_binary/1that is equivalent toerlang:atom_to_binary(Atom, utf8) - Support for Elixir
String.Charsprotocol, now functions such asEnum.joinare able to take
also non string parameters (e.g.Enum.join([1, 2], ",") - Support for Elixir
Enum.at/3 - Add support for
is_bitstring/1construct which is used in Elixir protocols runtime. - Add support to Elixir
Enumerableprotocol also forEnum.all?,Enum.any?,Enum.each,
Enum.filter,Enum.flat_map,Enum.reject,Enum.chunk_byandEnum.chunk_while - Support for
maps:merge_with/3 - Support for
lists:last/1andlists:mapfoldl/3 - Add support to Elixir for
Process.send/2Process.send_after/3/4andProcess.cancel_timer/1 - Add support for
handle_continuecallback ingen_server - Support for Elixir
List.Charsprotocol - Support for
gen_server:start_monitor/3,4 - Support for
code:ensure_loaded/1 - Support for
io_lib:latin1_char_list/1 - Add support to Elixir for
Keyword.split/2 - Support for
binary:split/3andstring:find/2,3 - Support for large tuples (more than 255 elements) in external terms.
- Support for
io:put_chars/2 - Support for
lists:nthtail/2 - Support for Elixir
IO.chardata_to_string/1 - Support for Elixir
List.duplicate/2 - Support for
binary:copy/1,2 - Support for directory listing using POSIX APIs: (
atomvm:posix_opendir/1,
atomvm:posix_readdir/1,atomvm:posix_closedir/1). - ESP32: add support for
esp_adcADC driver, with Erlang and Elixir examples - Add handler for ESP32 network driver STA mode
beacon_timeout(event: 21), see issue
#1100 - Support for mounting/unmounting storage on ESP32 (such as SD or internal flash) using
esp:mount/4andesp:umount/1 - Support for
binary_to_integer/2 - Support for
binary:decode_hex/1andbinary:encode_hex/1,2 - Support for Elixir
Base.decode16/2andBase.encode16/2 - Make external term serialize functions available without using
externalterm_to_binaryso terms
can be written directly to a buffer. - Support for
erlang:list_to_integer/2 - Add
externalterm_to_term_copythat can be safely used from NIFs taking temporary buffers
Changed
- ESP32: Elixir library is not shipped anymore with
esp32boot.avm. Useelixir_esp32boot.avm
instead Enum.find_indexandEnum.find_valuesupport Enumerable and not just lists- Install AtomVM libraries source code and binaries for better dialyzer integration
- Made the
device_configproperties list inspi:open/1optional (defaults to[]), so you can use the function with only abus_config
Fixed
- ESP32: content of
boot.avmpartition is not truncated anymore - ESP32:
Fixed gpio:set_intto accept any pin, not only pin 2 - Fix memory corruption in
unicode:characters_to_binary - Fix handling of large literal indexes and large extended literal indexes
unicode:characters_to_list: fixed bogus out_of_memory error on some platforms such as ESP32- Fix crash in Elixir library when doing
inspect(:atom) - General inspect() compliance with Elixir behavior (but there are still some minor differences)
- Fix several uses of free on prevously released memory on ESP32, under certain error condition using
network:start/1, that would lead to a hard crash of the VM. - Fix a bug in ESP32 network driver where the low level driver was not being stopped and resoureces were not freed
whennetwork:stop/0was used, see issue #643 uart:open/1,2now works with uppercase peripheral names
v0.6.4
v0.6.4 release.
Please, read the getting started guide for flashing instructions.
Added
- Implement
gpio:init/1on esp32 to initialize pins for GPIO usage, which some pins
require depending on default function and bootloader code - Implement missing opcode 161 (raw_raise), that looks more likely to be generated with Elixir code
- Support for Elixir
Map.replace/3andMap.replace!/3 - Support for Elixir
Kernel.structandKernel.struct! - Support for Elixir
IO.iodata_to_binary/1 - Support for Elixir exceptions:
Exceptionmodule and the other error related modules such as
ArgumentError,UndefinedFunctionError, etc... - Support for Elixir
EnumerableandCollectableprotocol - Support for Elixir
Enumfunctions:split_with,join,map_join,into,reverse,
sliceandto_list - Support for Elixir
MapSetmodule - Support for Elixir
Rangemodule - Support for Elixir
Kernel.minandKernel.max - Support (as stub) for
erlang:error/3(that is required from Elixir code)
v0.6.3
v0.6.3 release.
Please, read the getting started guide for flashing instructions.
Added
- Simple http client, that can be used for different use case such as downloading OTA updates
- Elixir support for
Keyword.mergeKeyword.takeKeyword.pop(!)Keyword.keyword?Keyword.has_key?functions. - Support for ESP32-H2
- lists:keytake/3 implemented.
- Support for setting channel used by network driver wifi access point.
- Support for
maps:iterator/2and~kpwithio_lib:format/2that were introduced with OTP26. - Support for
erlang:apply/2 - Support for
lists:keystore/4 - Support for
erlang:size/1bif - Support for USB serial output on ESP32 (needs to be manually enabled)
- Support for
lists:filtermap/2 - Support for standard library
queuemodule - Support for
maps:from_keys/2NIF - Support for standard library
setsmodule
Changed
- ESP32 network driver messages for event 40 (home channel change events) are now suppressed, but the
details for the channel changes can be observed in the console log if "debug" level logging is enabled
in ESP-IDF Kconfig options. - Default size of ESP32 RTC slow memory from 4086 to 4096, except on ESP32-H2 where it's 3072
- Update
byte_size/1andbit_size/1to implement OTP27 match context reuse optimization OTP-18987.
Fixed
- Fix bug (with code compiled with OTP-21) with binary pattern matching: the fix introduced with
02411048was not completely right, and it was converting match context to bogus binaries. - Fix creation of multiple links for the same process and not removing link at trapped exits.
See issue #1193. - Fix error that is raised when a function is undefined
- Fix a bug that could yield crashes when functions are sent in messages
- Fix bug where failing guards would corrupt x0 and x1
- Fix a memory leak when raising out of memory error while executing PUT_MAP_ASSOC instruction
v0.6.2
v0.6.2 release.
Please, read the getting started guide for flashing instructions.
CHANGELOG
Added
- Support for DragonFly BSD (generic_unix platform).
- Added guards
is_evenandis_oddto theIntegermodule - Add a number of functions to proplists module, such as
delete/2,from/to_map/1, etc... - Add
esp:deep_sleep_enable_gpio_wakeup/2to allow wakeup from deep sleep for ESP32C3 and ESP32C6. - Obtain RSSI of the current connection with
network:sta_rssi/0on ESP32. - Pico-W support for
network:sta_rssi/0. - Add support to ESP32C2
Fixed
- Fix invalid read after free in ssl code, see also issue
#1115. - Fix semantic of
ssl:recv(Socket, 0)to return all available bytes, matching what OTP does. - Fix
binaryoption handling inssl:connect/3sobinarycan be used instead of
{binary, true}. - Fix scheduling of trapped process that were wrongly immediately rescheduled before being signaled.
- Fix
gen_tcpandssltypes. - Fix documentation and specification of
esp:sleep_enable_ext0_wakeup/2andesp:sleep_enable_ext1_wakeup/2.
Changed
- Stacktraces are included by default on Pico devices.
- Changed ssl default from
{active, false}to{active, true}in order to have same behavior as
OTP. Since active mode is not supported right now,activemust be explicitly set to false:
ssl:connect(..., ..., [{active, false}, ...]), otherwise it will crash.
v0.6.1
v0.6.1 release.
Please, read the getting started guide for flashing instructions.
CHANGELOG
Added
- Added experimental optimized GC mode that makes use of C realloc instead of copying data around, it can be enabled with
-DENABLE_REALLOC_GC=On.
Fixed
- Fix bug in
erlang:ref_to_list/1anderlang:display/1: the unique integer was truncated on some 32-bit architectures - Stop hardcoding
erl_evalas module name in both display and fun_to_list - Correctly display and convert to list funs such as
fun m:f/a - Fixed bug in STM32 cmake that could cause builds with multiple jobs to fail due to incorrect artifact dependency
- Fix crash on macOS due to missing call to
psa_crypto_initfor TLS 1.3 - Fix crypto test on rp2040
v0.6.0
First v0.6.x series stable release!
Please, read the getting started guide for flashing instructions.
This release introduces a lot of new features compared to v0.5.x: such as support for multiple cores, support for beam files compiled with OTP 26, OTP lower level socket API, resources and a richer standard library, etc...
It is very hard to make a complete list of changes, so I suggest to take a look to the changelog file.
Also special thanks to all the contributors for their amazing work, that made this release possible.
v0.6.0-rc.0
v0.6.0-rc.0 release.
Please, read the getting started guide for flashing instructions.
CHANGELOG
Added
BOOTLOADER_OFFSETfor all current Esp32 models.- Added API to send messages from FreeRTOS tasks or pthreads, typically to
easily support integration with Esp32 callbacks
Fixed
BOOTLOADER_OFFSETwas incorrect for Esp32-C6 and Esp32-S2.- Fixed a bug that would fail to set DHCP hostname in STA+AP mode on all ESP32 platforms.
- ESP32-S3: crash in network driver caused by a smaller stack size for scheduler threads, when
callingesp_wifi_init(). See also issue #1059. - Fixed Esp32 network driver on non-SMP builds
- ESP32: fixed bug in
gpio:stop/0andgpio:close/1that would cause the VM to crash.
v0.6.0-beta.1
v0.6.0-beta.1 release.
Please, read the getting started guide for flashing instructions.
CHANGELOG
Added
- Support for utf8 encoding to
*_to_atomandatom_to_*functions binary_to_atom/1andatom_to_binary/1that default to utf8 (they were introduced with OTP23)- Added Pico cmake option
AVM_WAIT_BOOTSEL_ON_EXIT(defaultON) to allow tools to use automatedBOOTSELmode after main application exits - Use UTF-8 encoding for atoms when using
erlang:term_to_binary/1, in conformance with OTP-26 - Pico: Wait for USB serial connection
cmakeconfiguration optionAVM_USB_WAIT_SECONDSadded with 20 second default. - Support for code that makes use of more than 16 live registers, such as functions with > 16
parameters and complex pattern matchings.
Fixed
- ESP32: fix i2c_driver_acquire and i2c_driver_release functions, that were working only once.
- Sending messages to registered processes using the
!operator now works. - Fixed bug in
OP_SENDthat would accept sending a message to any integer or term without raising an error. binary_to_termchecks atom encoding validity, and fix latin1 support (when non-ASCII chars are
used)- ESP32: fixed bug in
gpio:set_pin_mode/2andgpio:set_direction/3that would accept any atom for the mode parameter without an error. - ESP32: GPIO driver fix bug that would accept invalid
pulldirection, and silently setpulldirection tofloatingwithout issuing an error. - ESP32: fixed bug in gpio driver that would accept invalid pin numbers (either negative, or too large)
- RP2040: fixed bug in
gpio:set_pin_pull/2that would accept any parameter as a validpullmode. - Support to function with 10 or more parameters
- Very unlikely but possible corruption caused by generated code that uses 16 live registers
Changed
binary_to_atom/2validates utf8 strings*_to_atomandatom_to_*properly convert latin1 (not just ASCII) to utf8 and viceversa- ESP32: use esp-idf v5.1.3 for building release binaries
v0.6.0-beta.0
v0.6.0-beta.0 release.
Please, read the getting started guide for flashing instructions.
CHANGELOG
Added
- Added
esp:get_default_mac/0for retrieving the default MAC address on ESP32. - Added support for
picoandpocias an alternative tomosiandmisofor SPI - ESP32: Added support to SPI peripherals other than hspi and vspi
- Added
gpio:set_int/4, with the 4th parameter being the pid() or registered name of the process to receive interrupt messages - Added support for
lists:split/2 - Added ESP32 API for allowing coexistence of native and Erlang I2C drivers
Changed
- Shorten SPI config options, such as
sclk_io_num->sclk - Shorten I2C config options, such as
scl_io_num->scl - Shorten UART config options, such as
tx_pin->tx - Introduced support to non-integer peripheral names,
"i2c0","uart1"(instead of just0and 1, which now they are deprecated)- New atom table, which uses less memory, has improved performances and better code.
- SPI: when gpio number is not provided for
misoormosidefault to disabled - Change port call tuple format to the same format as gen_server, so casts can be supported too
Fixed
- Fix several missing memory allocation checks in libAtomVM.
- Fixed a possible memory leak in libAtomVM/module.c
module_destroy. - Fix possibile bug in random number generator on ESP32 and RPi2040
- Fixed interpretation of live for opcodes, thus altering GC semantics for nifs. See also UPDATING.