Software stacks embedded on microcontroller-based hardware typically provide rudimentary APIs programmed in C/C++, basic connectivity and, sometimes, a firmware update mechanism. Such coarse mechanisms contrast with widely used APIs and more advanced networked interaction expected from software stacks deployed on less resource-constrained hardware (microprocessor-based). In this paper, we aim to bridge this gap by designing treVM, a generic scheme to host high-level WebAssembly code capsules, bolted on a general-purpose Rust embedded software platform, able to run on a large variety of 32-bit microcontrollers. Not only can treVM capsules host highly customizable business logic, but capsules can also be securely updated on demand over the network, on devices already deployed in the field. We implement treVM in Rust, on top of Ariel OS, a general-purpose RTOS, and we publish the code as open source. Based on our implementation, we validate the feasibility of treVM on commonly available boards, and we report on extensive benchmarks we performed on heterogeneous hardware including Arm Cortex-M, RISC-V, and Xtensa microcontroller architectures. As such, treVM provides a promising new framework to secure continuous deployment of embedded software on low-power networked devices.
翻译:基于微控制器硬件的嵌入式软件栈通常提供以C/C++编写的基础API、基本连接功能,有时还包含固件更新机制。这种粗粒度方案与部署在资源限制较宽松(基于微处理器)硬件上的软件栈所采用的广泛API及先进网络交互形成鲜明对比。本文旨在通过设计treVM弥合这一鸿沟——该通用方案可在通用型Rust嵌入式软件平台上承载高级WebAssembly代码胶囊,并兼容多种32位微控制器。treVM胶囊不仅能承载高度可定制的业务逻辑,还可通过网络安全地按需更新已在现场部署的设备。我们基于Ariel OS(通用实时操作系统)使用Rust实现treVM,并将代码以开源形式发布。通过实际实现,我们在常见开发板上验证了treVM的可行性,并对包含Arm Cortex-M、RISC-V及Xtensa微控制器架构的异构硬件进行了全面基准测试。因此,treVM为低功耗网络化设备上嵌入式软件的持续安全部署提供了富有前景的新型框架。