New features for improved memory usage

Posted on
Page
of 2
Prev
/ 2
  • Very nice feature, many thanks, the memory saving is huge. Now, how much memory per bytes of code do we need ? My esp8622 says out of memory above 10000 bytes of code.

    The discussion on the problem running this feature on ESP8266 is solved here : http://forum.espruino.com/conversations/307523/

  • It's worth noting that since this post there's also 1v93, with E.setFlags({pretokenise:1}).

    While it can't be used with code stored in flash, for the functions stored in RAM it'll make a really big difference

    http://forum.espruino.com/conversations/307447

  • Is there a way to use this feature and send modules "as functions" to flash one by one instead of all at once ?

    The reason I ask is because I get an "out of memory" when sending more than 10k of cumulated modules this way, which is appreciably more than before this feature. When I set "upload as function" and "save on send", in the console I see all modules are sent at once in one line of "setBootCode(code)". Is it possible to call setBootCode multiple times without erasing previous code saved in flash?

    I already found how to do something similar on esp822 using Flash module and setMemoryArea() in the other available flash areas (see this post :http://forum.espruino.com/conversations/290975/), but not in the area used by setBootCode. That would be useful for the other boards without additional flash memory.

  • So this is for ESP8266? On ESP8266 512k builds you only have 12KB flash memory anyway, so it wouldn't gain you a lot! You can always just write a bunch of data somewhere else in flash and then just save some bootloader code like eval(E.memoryArea( addr, len ))): http://www.espruino.com/Reference#l_E_memoryArea

    At the moment there isn't anything, but you could potentially write to the saved memory area yourself. It's only a two uint32s with 2 lengths in, then the data, then a 'magic byte' at the end:

    https://raw.githubusercontent.com/espruino/Espruino/09cdeafc4447b16c6f1758e0e2c7119a6e60543a/targets/esp32/docs/SaveAndLoad.md

    Potentially E.setBootCode could be modified and the IDE could split data up and write it separately though.

  • Thanks gordon for the clarification. Yes, I use an ESP8266, I didn't realize it was so little available there. And thanks for the pointer, i will look into reading/writing myself in these areas.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

New features for improved memory usage

Posted by Avatar for Gordon @Gordon

Actions