Its looking like Im going to need a coprocessor, something akin to the balena fin I suppose.
Ill probably start with just a usb device with dfu bootloader while prototyping, building the image for it in the docker script, then dfu ing the image on startup.
For prototyping the flash wear will be tolerable, but anyone seen a way to do a post install only action?
If I understand it correctly you’d like the firmware to update every time you deploy a release, so it will flash the firmware on first start of the container but not on subsequent starts. If you’re using balenaCloud you could use a tag in combination with the release ID; if the ID on the tag is different to the release ID, install the firmware and update the tag. On subsequent startups the tag would match the release ID already and the firmware wouldn’t install again. You can read and update the device tags via the API. Maybe some of my colleagues will chime in if they have any better ideas!
You could also keep track of the deployed release ID locally on the device, and know to flash the firmware again when the running release ID does not match that of the one you have saved. Maybe there’s a way you can keep track of the firmware version running on your coprocessor too, and simply check the version is current upon every start?
Those are great ideas thanks.