Bundling script with custom Espruino build?

Posted on
  • Is there any way to bundle a script with the Espruino update file?

    Ideally without clearing the entire storage with each update.

  • You mean the DFU ZIP file? The Espruino command-line tools do allow you to create a hex file direct from the source code, and you can then merge that with the Espruino hex file and upload that.

    It's much easier to do the updates via SWD (using a physical connection) though - otherwise you'll have to sign the hex file and recreate the final DFU zip, which is a bit of a pain.

    If you just want to upload firmware to Pucks, check out the Programmer app for Bangle.js: https://banglejs.com/apps/?id=espruinopr­og

    You can run it on a watch, and the watch will automatically connect and upload code to any device it sees. That is probably faster (and easier to test) than the Bluetooth DFU method.

  • The script file for my project depends on a custom build of espruino, so I was wondering if there was a way I could just include the boot code with the espruino update itself and get both in one shot

    The puck.js Bluetooth update zip

  • you can include your own library with init code, see e.g one for microbit https://github.com/espruino/Espruino/blo­b/master/libs/microbit/jswrap_microbit.c­#L144 or banglejs https://github.com/espruino/Espruino/blo­b/master/libs/banglejs/jswrap_bangle.c#L­3202

    one can also include bits of javascript (see libs/js) and run it from init method

    This will however run on every boot, not once per DFU update. You could however create some marker file in the storage after first run so it is not run again.

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

Bundling script with custom Espruino build?

Posted by Avatar for DanTheMan827 @DanTheMan827