OTA for micropython #17
-
Being a complete novice on operations at this level I am not sure what I am flashing. In our case, we want to update (replace) the micropython firmware. Our application is built into the micropython firmware as we needed to do a lot of additional work to support client side Bluetooth pairing and service discovery persistence. We also convert BT device measurements to FHIR and upload them. The final Micropython firmware is about 1065 KB. Is this the right project to accomplish an OTA of this firmware? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, I've never used MicroPython myself but I'm assuming when you talk about the MicroPython firmware in this context, you mean the code that implements MicroPython itself, rather than any Python application. As you are building the firmware yourself, I see no reason why you couldn't incorporate the flashloader into your project. First and foremost, you need to be able to make your code start from an address other than the start of flash (0x10000000) because that is where the flashloader will be. At just over a megabyte, the firmware is quite large but as long as you have enough unused space on the flash chip to store a second copy, that isn't a problem itself. I would also suggest you look at the 'urloader' branch if you haven't already as that gives you the possibility to perform a power-fail safe update of the flashloader code itself. |
Beta Was this translation helpful? Give feedback.
The flashloader (as presented here) doesn't care how the new firmware gets onto the chip. When it runs, it just expects to find the new firmware somewhere in flash so that it can then copy it over the existing firmware. So it's up to your existing application to download the new firmware by whatever means and store it.
What you certainly need to be on top of is what is placed where in flash. As I said, I've never used MicroPython but I've just had a quick look at the repository and the port for the RP2040. From what I can see, it reserves the last 1408KB of flash (unless defined otherwise) for (presumably) storing Python applications and anything else they need.
The linker script for the …