-
• #2
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...
- You can use
require("heatshrink").compress
to compress the data as you write it - that should give you a bit extra - You can recompile the Espruino firmware with features that you don't need removed - it's as easy as removing the lines from the list at https://github.com/espruino/Espruino/blob/master/boards/PIXLJS.py#L32 and then modifying the
saved_code
entry at https://github.com/espruino/Espruino/blob/master/boards/PIXLJS.py#L73-L77 - 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
- You can use
-
• #3
I'll give the compression a try and see how much that helps before I head down either the custom firmware route or SD card route
Thanks!
Hi there,
I'm looking to store some data files on my pixljs (it's got 512 KB total flash - yay). However when I was doing some testing I found that the available flash storage is quite a bit lower. I ran the following code:
This ended up writing 33 files (so ~33KB of storage). I'm looking to store about 360KB of binary data files (though that seems to be doubtful at the moment).
Anyone have pointers on optimizations I can do to increase the flash storage? I rather liked not having to use an SD card and holding everything on the device. Additionally is there an easy way to identify when the local flash storage is full (I was looking through the API and didn't see any good methods of doing that).
Thanks in advance