programming update (8/23/26): added a workflow closer to mallow revision 1.4’s
i added an sd card slot to the flash spi line for uploading lua files easier. before, it was just a small const char* script = "print(\"hi\")"; expression. it works, but it gets messy for long scripts. now, a main.lua file can be stored on the sd card and flashed to memory with ease.
rant about the sd card and sending lua files to flash
one thing that’s cool about the sd card system is that once it’s mounted, you can use plain old fopen expressions like you would on a computer. to load the lua file onto flash memory, i used fseek to get the length of the file. i then used that length to malloc that file size + 1 byte for the string null terminator. then it sends the fseek pointer back to the start of the file, iterates through each character, and loads that into a buffer. the buffer is sent to flash with my flash_write_script function from last time (just check my github page. you’ll see it at programs/08_23_26.)
something that is worth mentioning that i forgot about is that multiple devices can have the same spi line, just different CS pins. there’s 3 hosts for the esp32 s3: SPI1_HOST for internal ram and SPI2/SPI3_HOST for external devices.
another thing i love about this sd card is that i can just easily edit the main.lua file on the sd card and pop it back into the card slot. it’s way easier than reflashing the esp32 s3 just to get a new rectangle on the screen.
tomorrow im gonna work on trying to make a makeshift file system for loading up image files into flash and displaying them on screen via lua.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.