A significant amount of flash memory is needed for the JavaScript interpreter and Bluetooth stack. Realistically that means around 40kB is available - for your code and any data. As far as I recall even if you got rid of Espruino completely that'll only free up around 350k - the Bluetooth stack takes the rest all by itself.
To remove all files, just do require("Storage").eraseAll() and that'll reformat the storage which will free up as much memory as possible.
Use an SD card or external flash memory (I2c/SPI/OneWire)
But realistically you're not going to write 360kB of data onto Pixl.js as-is, however if it's easily compressable there's some possibility you could get close with a customised firmware
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
A significant amount of flash memory is needed for the JavaScript interpreter and Bluetooth stack. Realistically that means around 40kB is available - for your code and any data. As far as I recall even if you got rid of Espruino completely that'll only free up around 350k - the Bluetooth stack takes the rest all by itself.
To remove all files, just do
require("Storage").eraseAll()
and that'll reformat the storage which will free up as much memory as possible.storage.getFree()
will tell you how much is available.You have a few options...
require("heatshrink").compress
to compress the data as you write it - that should give you a bit extrasaved_code
entry at https://github.com/espruino/Espruino/blob/master/boards/PIXLJS.py#L73-L77But realistically you're not going to write 360kB of data onto Pixl.js as-is, however if it's easily compressable there's some possibility you could get close with a customised firmware