PyBoard "over-the-air" firmware upgrade

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
anderi
Posts: 1
Joined: Wed Jun 20, 2018 1:41 pm

PyBoard "over-the-air" firmware upgrade

Post by anderi » Wed Jun 20, 2018 1:55 pm

Hi all,

I have an application that collects data and periodically transfers it to a application server through a GSM-modem (over TCP). Since I have connectivity I would like to have the ability to perform firmware upgrades over the air.

I thought about doing it something like this:
1) Connect to application server and request latest version information
2) If latest version is greater than the one executing, download a binary (i.e. firmware.bin) and store it to sdcard.
3) Perform a reset
4) At boot, check if there is a firmware.bin present on sdcard and write it to flash

While this process is simple, I'm looking for guidance on how to implement it. Preferrably it would be done in boot.py but I'm not sure this is feasible since it would require to lock the flash and prevent any access to it while updating, is this possible?

The other way, I guess, would be to put it somewhere in stm32_main.

Any input would be appreciated.

Regards,
Andreas

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: PyBoard "over-the-air" firmware upgrade

Post by dhylands » Wed Jun 20, 2018 5:24 pm

I suspect that to do this properly, you'd need to write a standalone C program which runs completely from RAM. You'd load it into memory and it would load and flash the file from the sdcard.

Post Reply