My scenario is that o do not have GPIO reach to enable DFU via hardware. So looking a softwares way to upgrade firmware using BLE.
I am using nrf51822 based fitness tracker, which has very old SDK 9/10 maybe with softdevice S110. I am planning to upgrade softdevice, bootloader to S130, as Esprunio supports S130 onwards.
Well, you have at least button there which is one GPIO for this. Anyway, yes it is possible, it depends on bootloader code, espruino bootloader by default requires holding some button but you can disable it in your own bootloader build. Typically this is done by setting some value in GPREGRET nrf register (which survives reset) and then performing soft reset. Then in bootloader you check this value and decide.
Requiring some interaction is there for safety so nobody can reflash your device remotely without confirmation. So if you disable this just beware and protect espruino console so it is not accessible to everyone.
The current way to switch to bootloader is a bit tricky with timing and there is no explicit method to switch to bootloader. I think better would be to allow switching to bootloader programatically but then there could be button confirmation before accepting the firmware (e.g. if you do not hold button while sending dfu zip it would fail). Safety would be same but you could invoke update procedure in deterministic way without user needing to hold button with precise timing while calling E.reboot()
I should also add that since you're using a nrf51822 there's really very little room available to fit in a bootloader and espruino - the micro:bit build overwrites the bootloader completely AFAIK to get a bit more space.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem