Skip to content

RTEMS support - #2392

Draft
petermm wants to merge 9 commits into
atomvm:release-0.7from
petermm:rtems
Draft

RTEMS support#2392
petermm wants to merge 9 commits into
atomvm:release-0.7from
petermm:rtems

Conversation

@petermm

@petermm petermm commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Cross-compile AtomVM as an RTEMS application, embed a host-packed
AVM, and boot on SIS. This is the first non-Unix RTOS target besides
the MCU ports, so applications cannot load .avm files from disk.

Keep SMP, JIT, and sockets off until a later BSP has libbsd. CI
caches the sparc/erc32 toolchain and checks {atomvm_rtems_boot,rtems}.

Signed-off-by: Peter M <petermm@gmail.com>
Keep a single RTEMS platform and add the arm/imx7 BSP as a second bring-up target. QEMU -kernel of an ELF leaves r2=0, so the helper raw-loads a patched Linux imx7d-sdb DTB and sets the U-Boot FDT pointer via gdb.

CI builds both erc32 and imx7. The imx7 DTB is compiled from a sparse checkout of Linux v6.1, including include/uapi/linux for linux-event-codes.h, avoiding unsupported armhf apt indexes on Noble amd64 runners.

Signed-off-by: Peter M <petermm@gmail.com>
@petermm
petermm changed the base branch from main to release-0.7 September 4, 2026 17:07
@petermm
petermm force-pushed the rtems branch 4 times, most recently from b0a1d11 to cef0e0f Compare September 5, 2026 12:15
Implement the RTEMS peripheral HAL modules and native NIF collections. Wire them into the platform build and atomvmlib archive, document the supported i.MX7 and erc32 behavior, and exercise NIF registration during boot tests.

Signed-off-by: Peter M <petermm@gmail.com>
Link rtems-libbsd on arm/imx7, initialize ffec0 with DHCP, and enable
BSD socket NIFs with poll-based select. CI covers DHCP, DNS, TCP, a
guest echo server, hostfwd on port 8080, and erc32 enotsup.

Signed-off-by: Peter M <petermm@gmail.com>
Signed-off-by: Peter M <petermm@gmail.com>
Signed-off-by: Peter M <petermm@gmail.com>
Add a GRiSP 2 board profile using the existing RTEMS 6.2 arm/imx7 BSP
and LibBSD toolchain. Package a bootloader-ready image with a validated
device tree, pinned DTB sources and hardware smoke tests.

Load app.avm from the SD card's FAT partition at boot so applications can
be replaced without rebuilding the firmware. Bound file size and discovery
time, validate AVM/BEAM container bounds, and fall back to the embedded
application when the replacement cannot be loaded. Keep runtime failures
visible and use capability names for shared storage and driver code.

Complete atom/module table and import teardown, including partially built
modules, so failed startup releases memory before fallback. Check failed
NIF lookups before accessing their descriptors.

Extend the existing imx7 CI job with board artifacts and host regression
tests. Document image installation, application replacement and DTB rebuilds.

Validation:
- Native core tests and the full Erlang test suite passed.
- Loader and 256 KiB fallback tests passed under ASan/UBSan; fallback was
  checked with SMP on and off and detects the original teardown leak.
- Native boot, image packaging, DTB override and workflow lint checks passed.
- Full RTEMS cross-build and physical board validation remain pending.

Signed-off-by: Peter M <petermm@gmail.com>
Signed-off-by: Peter M <petermm@gmail.com>
Upload a commit-qualified ZIP with boot files at its top level and name
the debug executable with an .elf extension. Include the barebox boot
entry needed to discover the image and device tree, source/build links,
and the device-tree sources and license notices.

Document SD installation, serial verification, replacing app.avm, and
installing the earlier CI artifact layout. Include the guide in the ZIP.

Validation: exercised the workflow packaging step against firmware from
CI run 33965512962; checked binary identity, U-Boot checksums, boot-entry
paths and ZIP integrity. Actionlint, REUSE lint (1510 files), and
git diff --check pass. Physical board boot remains unverified.

Signed-off-by: Peter M <petermm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant