QuickJS is a small JavaScript Engine that supports POSIX Functions. Can we run QuickJS on Apache NuttX RTOS? And Blink the LED in 4 lines of JavaScript?
const ULEDIOC_SETALL = 0x1d03;
const fd = os.open("/dev/userleds", os.O_WRONLY);
os.ioctl(fd, ULEDIOC_SETALL, 1);
os.ioctl(fd, ULEDIOC_SETALL, 0);
In this article we…
(1) Run QuickJS on NuttX with Ox64 BL808 RISC-V SBC
(2) Blink the LED by adding the ioctl() function
(3) Reconfigure the NuttX App Stack (because it’s too tiny)
(4) Analyse the Memory Footprint of QuickJS (Code + Data + Heap Size)
(5) Test QuickJS in the Web Browser with NuttX Emulator (and a Simulated LED)
QuickJS is perfect for Iterative, Interactive Experiments on NuttX! Check out the article:
https://lupyuen.codeberg.page/articles/quickjs.html
Lup