Skip to content

arc/sandbox.hpp

VM, JIT, WASM AOT, hypervisor, PMS/TEE planning, hotpatch, chaos, and sandbox policy hooks.

Fit

  • Use it when a reader wants one coherent entry point for a domain or a subset build wants a profile root.
  • Do not start here when one source file only needs a narrow peripheral or codec header.
  • Verification focus: confirm the profile does not drag domain roots into small substrate builds unless that is intentional.

Arc Contract

  • Header: arc/sandbox.hpp
  • Module group: Profile Modules
  • CMake feature: sandbox
  • Closest example: .

Declare arc_requires(main_requires core sandbox) in the component that includes this header.

CMake And Include

cmake
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/arc-deps.cmake)

arc_requires(main_requires core sandbox)

idf_component_register(
    SRCS "app_main.cpp"
    REQUIRES ${main_requires}
)
cpp
#include "arc/sandbox.hpp"

Source Landmarks

Source landmarks: arc/hypervisor.hpp, arc/hotswap.hpp, arc/jit.hpp, arc/pms.hpp, arc/tee.hpp, arc/vm.hpp, arc/wasm_aot.hpp.

Start From Zero

  • Start from the closest example or the root project listed below.
  • Load the ESP-IDF environment with . ./env.sh.
  • Add the include and CMake feature only in the component that owns this lane.
  • Keep board topology, buffers, and ownership in one visible owner type.
  • Move from build proof to hardware proof only after the wiring or runtime dependency is known.

Owner Skeleton

cpp
namespace app {
void boot()
{
    // Put board policy, buffer ownership, and failure handling here.
    // Keep Core 1 hot work separate from Core 0 service work.
}
}

extern "C" void app_main()
{
    app::boot();
}

Step-By-Step Check

  1. Decide whether this module owns silicon, memory, protocol bytes, or policy only.
  2. Name the owner type once, close to the board topology.
  3. Allocate any DMA or shared buffers before the hardware starts.
  4. Initialize with the recoverable path while bringing up the board.
  5. Switch to the fail-fast path only after the topology is treated as fixed.
  6. Log from Core 0 after the hot path has handed off a compact event or snapshot.

Build Or Example

The root project is the smallest place to try this module.

sh
. ./env.sh
idf.py build
idf.py -p /dev/ttyACM0 flash monitor

Runtime Check

The build command proves the dependency path. Runtime proof still needs the actual board condition that matches this module: attached device, loopback, radio peer, flash partition, sleep wake source, or captured serial/network output. Do not turn the example command into a performance or hardware claim without that evidence.

Next Reading

ESP32-S3 first. ESP-IDF native. Static ownership by default.