ENERGY-EFFICIENT TOOLING FOR THE LOW-POWER MCU ■
Micro-controllers (e.g., ESP32[1], STM32[2], Raspberry Pi Zero [3]) are cost-effective lightweight computers that are currently deployed across numerous application domains ranging from smart cities to smart hospitals, and even smart homes.
However, micro-controllers (MCUs) have limited hardware capabilities (e.g., memory capacity, execution power) that pose unprecedented challenges for software development. In particular, the scarce battery life of MCUs can cause up to 10 power failures per second [3], making it tremendously challenging to write applications as well as tooling support (e.g., testers and debuggers) that run on MCUs. As a result, MCU applications are mainly tested in simulated environments with emulators. This often results in bugs manifesting during production [4, 6], which could be caught in early development phases should appropriate tooling exist.
Co-Promotor: Elisa Gonzalez Boix elisa.gonzalez.boix@vub.be Advisor Carlos Rojas Castillo crojcas@vub.be
The goal of this thesis is to design and investigate an energy-efficient approach to the design of software tools for MCUs. In particular, the student will create a dynamic tool (e.g., tester, debugger) that can target MCUs and account for the limited MCU battery life.
We envision the student implementing the solution on top of the WARDuino Virtual Machine (VM) [5] which is a lightweight WebAssembly VM for MCUs. WebAssembly [8] is an instruction set that many high-level languages such as Rust, Scala, Go, and TypeScript can compile, thus making the tooling support potentially beneficial for any of such languages. The VM already features a tooling API [9, 10] that enables dynamic tooling to target MCUs. Moreover, a Visual Studio Code plugin exists [11] with debugging support for programs running on the VM written in Rust or TypeScript.
To accomplish the thesis objective, we foresee the following research activities:
- Literature study on application development for MCUs (e.g., as EP32, Raspberry Pi Zero) with WARDuino.
- Literature study on state-of-the-art dynamic tooling support for MCU [6].
- Literature study regarding MCU energy consumption [7].
- Build a dynamic tool on top of Wasmito tools API [12], e.g., monitoring.
- Measuring the impact of the tool and the tools API on the hardware parameters such as real power & energy consumption, execution time, and memory consumption.
- Adapt WARDuino tool API to expose information on energy efficiency from hardware parameters to tool builders and to offer operations to control energy usage, e.g., take offline services when the battery reaches a certain threshold.
- Evaluate the practicality of the tool with respect to metrics such as power & energy consumption, memory usage, runtime overhead, network usage, and so on. In particular, demonstrating the tool's low impact on energy usage is quintessential. If time allows, the student could evaluate other dynamic tools currently already built on Wasmito, e.g., test coverage, record-and-replay debugger.
- Students are expected to know C or C++, the implementation language of the WARDuino.Interest in microcontrollers is essential. Knowledge about TypeScript or Rust is a plus.
Framework of the Thesis ■
[1] https://www.espressif.com/en/products/socs/esp32
[2] https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html
[3] https://www.raspberrypi.com/products/raspberry-pi-zero/
[4] Ransford, B., Sorber, J., & Fu, K. (2011, March). Mementos: System support for long-running computation on RFID-scale devices. In Proceedings of the sixteenth international conference on Architectural support for programming languages and operating systems (pp. 159-170)
[5] W Gurdeep Singh, R., & Scholliers, C. (2019, October). WARDuino: a dynamic WebAssembly virtual machine for programming microcontrollers. In Proceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes (pp. 27-36). Doi: 10.1145/3357390.3361029
[6] Makhshari, A., & Mesbah, A. (2021, May). IoT bugs and development challenges. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE) (pp. 460-472). IEEE.
[7] Götz, M., Khriji, S., Chéour, R., Arief, W., & Kanoun, O. (2020). Benchmarking-Based investigation on energy efficiency of low-power microcontrollers. IEEE Transactions on Instrumentation and Measurement, 69(10), 7505-7512.
[8] Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. 2017. Bringing the web up to speed with WebAssembly. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). Association for Computing Machinery, New York, NY, USA, 185200. https://doi.org/10.1145/3062341.3062363
[9] Lauwaerts, T., Castillo Rojas, C., Singh, R. G., Marra, M., Scholliers, C., & Gonzalez Boix, E. (2022, September). Event-Based Out-of-Place Debugging. In Proceedings of the 19th International Conference on Managed Programming Languages and Runtimes (pp. 85-97).
[10] Castillo Rojas, C., Marra, M., Bauwens, J., & Boix, E. G. (2022). Out-of-things debugging: A live debugging approach for Internet of Things. arXiv preprint arXiv:2211.01679.
[11] https://github.com/TOPLLab/WARDuino-VSCode
[12] https://github.com/carllocos/wasmit0