Is anyone interested in collaborating to develop OTA capability?



  • Re: K210 Over-the-Air or In-App-Programming (Flashing) Example?

    I'm at the point in my project where having the ability to update my firmware OTA is getting important. It looks like just waiting for the solution to appear isn't going to work out very well so I'd like to work though this with others that are interested in developing a solution.

    Any takers?



  • @loboris that's great!

    I'm looking forward to what you've put together.



  • I'm working on OTA solution and the first results are quite good.
    Basically, I've implemented a 2nd stage bootloader which is loaded and executed on boot instead of the main application firmware.
    The SPI Flash is organized this way:

    • 2nd stage bootloader at address 0x000000, 256KB
    • Flags/data area, 4KB
    • Firmware #1 area, 2MB
    • Firmware #2 area, 2MB
    • Other flash areas, like data, flash file system(s), etc...

    The sizes can be changed according to the needs.

    On power on/reset the 2nd stage bootloader is loaded to SRAM by K210 booltloader and executed.
    2nd stage bootloader is a very simple program which only checks which firmware to load (based on some flags from SPI Flash flags area), loads the firmware from SPI Flash to SRAM and executes it. The firmware's CRC32 checksum (located in Flags/data area) is checked before executing it, if not matched, loading of another firmware is attempted and approppriate flags set.
    As an option, 2nd stage bootloader can check the state of an external pin to decide which firmware to load.

    The main firmware application must be aware from which SPI Flash area it was loaded and can flash the new firmware to the other SPI Flash firmware area. The new firmware can be downloaded from Internet/LAN (if WiFi/GSM/LAN adapter is available) or loaded from SD Card and flashed to the required Flash area.
    If successfully flashed (CRC32 check), flag can be set to load the new firmware after reboot.

    I'm still working on some issues, but the solution works and I expect to put it on GitHub in a month or so.