low level flash access

Posted on
  • Hello,

    Is it possible to write to unused persistent storage?
    According to http://www.espruino.com/STM32F1Flash the Puck doesn't use address 468992 to 479232 (10kB)

    but STM32F1Flash.js or poke calls are not able to write to these addresses.
    Do I miss something?

  • The puck is not an STM processor but a Nordic NRF 52. So I am not sure if what is written there applies to the puck at all...

  • @pk910 you can use module FlashEEPROM on Puck.js too.

    // Tested on Puck.js
    var f = new (require("FlashEEPROM"))();
    f.write(0, 'Hello Flash.');
    /* console log
      "flash": function () { [native code] },
      "addr": 471040, "endAddr": 475136 }
    Hello Flash.
  • As @MaBe says you can just use that module - or you can go lower-level and use the flash module: http://www.espruino.com/Reference#Flash

    With the flash module you need to be a bit more careful as you can damage the interpreter - however I have tried to restrict access so that you can't destroy the bootloader and 'brick' your Puck

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

low level flash access

Posted by Avatar for pk910 @pk910