Kaluma: A Tiny JavaScript Runtime for RP2040 (Raspberry Pi Pico)
github.com
github.com
npm install -g @kaluma/cli
kaluma flash index.js
This installs kaluma, finds the connected device, uploads the code and runs it. Love this simplicity, sounds like it was made the right way. Is there any posts with benchmarks? Very interested about the timing limits of the event loop implementation such as setInterval(()=>{}, 1); and other cpu heavy stuff like math stuff and pin output change speed from javascript.Just to call out that it isn't a new engine, just a runtime on top of JerryScript (which isn't to diminish it, just to clarify).
In my mind brick also meant unrecoverably dead but it seems the meaning has now drifted to what I wrote above and to access the old meaning one needs to specify "permanently bricked".
As for how to mess up micropython: If you load a main.py that has an infinite loop (common on micro controllers because there is no os) then the board will get stuck in that loop as soon as power is applied and your computer can't get a word in because it's no longer listening. Now you can't upload a fixed main.py with a way to break out of the loop.
To fix you need to hold the button while powering on. This puts in in flash mode and you can reflash micropython. Or in my case, flash a different special firmware that blows away all the .py files I had on there because main.py was still there when I just reflashed micropython the first time.
I've never lost any code on the ESP, but on the Pico just as you're nearing deployment and want to test run at boot you run into the easy pitfall of having to delete all of your files to unbrick the thing. Luckily I hadn't written much by that point yet.
I'd assumed that it's because the ESP runs the repl backend and the user code on separate cores, but the Pico is also dual core which would mean it could do the same. Yet it does not. I'm more convinced that the implementation is just kinda bad instead.
Whether a loop is infinite or not doesn't depend on the presence of an OS. Were you thinking of "tight loop"? Now since Python is interpreted, the loop will never be all that tight, interrupts will still be handled. If you experienced that a ^C from the (USB attached) serial console didn't interrupt the program, that warrants further investigation methinks.
I did have trouble with reconnecting using MS Windows 10, but that's a Windows USB driver thing. No problems on Linux (Ubuntu 18.4).