Replies: 3 comments
-
Currently that feature is not implemented in TinyGo. A link to the C language implementation would be nice. |
Beta Was this translation helpful? Give feedback.
-
There are various ways to implement this sort of thing, and all of them rely on a bootloader of some sort. Basically, a separate stripped down firmware that handles some part of the upgrade that cannot be done on-the-fly (you can't rewrite the firmware that's currently running). Some common designs are:
I recommend looking into existing bootloaders instead of trying to reinvent the wheel. It's very easy to screw up, and you don't want to have bugs in the OTA mechanism especially when it's somewhere in a hard to reach place. One popular bootloader seems to be mcuboot, you could take a look at it. I haven't used it personally. Oh and to be clear, this usually requires little cooperation from TinyGo, apart from some linker script tinkering (to avoid overwriting the bootloader). We already have some boards that use a bootloader. |
Beta Was this translation helpful? Give feedback.
-
@sago35 That's what I thought. Let me have a try. Start with a C bootloader, then jump to the address where the tinygo firmware started. @aykevl I'm wondering, is there a way to allow tinygo to directly write data to the specified ROM address? I mean, I can download the tinygo bin file, but how can I write it into ROM if I don't have external flash? I can write the new bin into the blank spaces where tinygo didn't use. STM32F407vgt6 has 1MB ROM storage. If my bin file is less than 400KB, it could be something that can be done... OK, just do it, now. |
Beta Was this translation helpful? Give feedback.
-
WOW, I don't even know Github has discussion function......
Well, I'm using STM32F407, and I can connect to network through this development board.
Assuming I can download the bin file to the board, how can I upgrade the firmware?
Like a Boot-Loader or something?
I'm sure it's able by C, I can write the bin data into ROM. But I'm not sure if this feature can be implemented by Tinygo.
Beta Was this translation helpful? Give feedback.
All reactions