I have prototype of the resource constrained-device (8-bit MCU with no-OS firmware), interacting with a web server. I wonder are there any solutions, frameworks or cloud services for updating my device firmware from the web. From my research there is Microsoft IoT Hub, but I am afraid it does not suits for such resource-constrained devices. There is one more solution, I found - mbed Cloud portal, but I am not sure how it works. Can anyone help me via any advice, maybe there are some best practices for implementing firmware upgrade over the air for embedded devices in secure and robust way?
I'll be answering only this part, as I know of no 'out of the box' system for an unknown firwmare.
maybe there are some best practices for implementing firmware upgrade over the air for embedded devices in secure and robust way?
In term of practice, what I would do is as follow:
1) Have a very minimal boot loader, something as dumb as possible only responsible to load the firmware with the following constraints:
- Ability to record last boot success/failure (to rollback to a working version in case of failure)
- Some kind of emergency process to accept a new firmware in case of catastrophic failure (optional, could be avoided if a "bricked" device is allowable)
2) Set your storage to have two "boot banks" of reasonable size to handle future evolution and firmware growth.
3) Checksum the firmware image after download to ensure it is correct before burning, checksum the bank of destination after burning to again ensure it won't fail booting for a missing bit somewhere.
The overlooked point is usually the checksum of the downloaded image before and after burning, resulting in corrupted system written on the device. Using two banks and alternating usually ease the update process.
mbed cloud does offer full firmware update functionality, but I think you'd have trouble porting it to your platform if you're running without an OS. I don't think the source is open today, so you can't even use it for reference. I'm also not sure what the criteria are for getting access right now.
You need to think about the features you need - is this a large scale deployment where you need to be able to do staged firmware roll-outs, do you care about signing the firmware, or is your platform completely open to anyone with physical access? How much do you care about being able to recover a bricked device without JTAG?
Realistically, features like OTA updates are probably something that drive your OS and device selection - once you factor in development costs.
Check out OTA which is abbreviation of Over The Air. Arduino has that property.
You can make update with Arduino IDE, Web Browser or HTTP Server.
Arduino IDE option is intended primarily for software development phase. The two other options would be more useful after deployment, to provide module with application updates manually with a web browser or automatically using a http server.
You might take a look at Particle (IoT). I'm not sure they support Arduino, but they do offer some cheap embedded boards themselves.