You are reading a single comment by @enaon and its replies. Click here to read the full conversation.
  • Hi, I did something stupid, I have a .bootrst file that disables BT on startup, so the "hold the button" failsafe is not working, I am locked out.

    Is there a way to erase flash storage using dfu upload?

    solved I took the flash pages down to 20, flashed the image, it caused a storage erase due to corruption, victory :)

  • Is there a way to erase flash storage using dfu upload?

    not sure there is a way out of box but you could make custom build that ignores .bootrst file, then delete the file, then flash normal build, if you have linux it is not that hard to checkout Espruino from github and rebuild from source.

    You just change this line https://github.com/espruino/Espruino/blo­b/2e0502cbb721c72fcae6807ac85edd9900b60a­40/src/jsflash.c#L21 to something else.

    Maybe even binary patching the bin from existing zip would work if you recreate the zip via nrfutil again. The nrfutil line for building the package is

    nrfutil pkg generate espruino_2v15.5_banglejs2.zip --application espruino_2v15.5_banglejs2_app.hex --application-version 0xff --hw-version 52 --sd-req 0xa9,0xae,0xb6 --key-file targets/nrf5x_dfu/dfu_private_key.pem
    

    so you could unpack the bin, patch the string inside and replace the --application parameter with the bin

    Well, actually it was quicker to do it than to describe it, attached is the zip that searches for something else instead of .bootrst (replaced oo in name with zeroes)

About

Avatar for enaon @enaon started