Here's how we compile #BL602 #RustLang Firmware into #WebAssembly
https://lupyuen.github.io/articles/rustsim?3#build-bl602-firmware-for-webassembly
Let's take this #BL602 #RustLang Blinky Firmware ... And make it run in a Web Browser with #WebAssembly
https://lupyuen.github.io/articles/rustsim?2#rust-firmware-for-bl602
Running #BL602 #RustLang Firmware in a Web Browser with #WebAssembly ... All shall be explained in this article
If we set a GPIO Pin Output without configuring the GPIO for Output ... Our #BL602 #WebAssembly Simulator halts with a helpful message
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-simulator/src/lib.rs#L105-L136
How our #BL602 Simulator in #WebAssembly checks the GPIO Pin Config ... When setting the GPIO Pin Output
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-simulator/src/lib.rs#L105-L136
If #BL602 IoT SDK wasn't called correctly ... Our BL602 Simulator could show a helpful message 🤔
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-simulator/src/lib.rs#L85-L109
Wow I've created over 1,000 pics for my articles 🤔
https://github.com/lupyuen/lupyuen.github.io/tree/master/images
Here are the #RustLang Stubs that intercept calls to #BL602 IoT SDK ... And emit the JSON Stream of Events
https://github.com/lupyuen/bl602-simulator/blob/main/bl602-simulator/src/lib.rs#L85-L135
Here's how we compose a JSON Stream of #BL602 Simulation Events in #RustLang
https://gist.github.com/lupyuen/cec1a423062556263a7ba02971862001
Composing JSON in C looks messy ... Let's convert to #RustLang
https://github.com/lupyuen/bl602-simulator/blob/main/wasm/wasm.c
What drives the #BL602 #RustLang Simulator in #WebAssembly? A JSON Stream of Simulation Events!
https://lupyuen.github.io/articles/wasm#simulate-bl602-hardware
#BL602 #RustLang Firmware runs OK with #WebAssembly ... When we reused the WebAssembly Stubs from uLisp yay! 🎉
To compile #BL602 #RustLang Firmware into #WebAssembly ... 1️⃣ Change "no_std" to "libc" 2️⃣ Exclude the Panic Handler
https://github.com/lupyuen/bl602-simulator/blob/main/sdk_app_rust_gpio/rust/src/lib.rs
Can we Simulate #BL602 #RustLang Firmware in a Web Browser with #WebAssembly? ... So we can make a PineDio Stack Simulator? 🤔
TYWE2S seems to be an RTOS + Form Factor for ESP8285 🤔
https://developer.tuya.com/en/docs/iot/wifie2smodule?id=K9605u79tgxug
IoT Techie and Educator / Apache NuttX PMC