Typically, reprogramming a microcontroller requires placing it in the reset state, flashing the code, and then restarting it. It is usually necessary to turn off the chip completely. However, [bor0] has built a virtual machine running on esp32 to allow dynamic program updates.
This code is inspired by chip-8, a relatively old interpreter with some game applications. [bor0] has created a virtual machine simulating chip-8, and its purpose has been adjusted here. The drawing instructions related to the game have been deleted and replaced with the instructions controlling the IO pin. The register has also been changed to 16 bits to increase flexibility and headroom.
For most people, this may not be an immediate application, but it’s a different way to use and program esp32, which is good.
As we all know, esp32 is also a powerful chip. It is a great 8-bit startup simulator. Please express your thoughts on the killer application of esp32 virtual machine in the comments!
[thanks for satansett’s tips!]