Skip to main content
Visitor II
September 23, 2022
Question

OTA firmware update for a Nucleo F746.

  • September 23, 2022
  • 3 replies
  • 2154 views

*Edited, I had a long question about why the code wasn't working. I was using an example based on Embetronicx. Here is the git location for his example. https://github.com/Embetronicx/Tutorials/tree/ETX_Bootloader_3.0/Microcontrollers/STM32/STM32F7xx/Bootloader_Example

I found a video series from ST on building a bootloader also. The ST example is significantly different than the Embetronicx example. Embetronicx has good information and it may be good to use. I'm not sure based on the other info I'm finding.

So my question is; what is the best simple method of an OTA bootloader? Do you have links or examples?

Thanks

 

    This topic has been closed for replies.

    3 replies

    Graduate II
    September 24, 2022

    Well typically the tool-chain doesn't send the .BIN, it works off the .ELF, and that can be sectional and sparse. Perhaps use objcopy or fromelf to inspect. The .HEX might be more record based.

    I might suggest

    Instrument the code, outputting progress and sums

    Get a Hard Fault Handler that outputs actionable data

    Step the transition code

    Avoid reconfiguring clocks, so don't teardown in SystemInit(), and just set SCB->VTOR =&__gfnVectors, then skip the SystemClock_Config()

    Super User
    September 26, 2022

    @Community member​ Why do you want to use this github example as a base for "OTA update"? UART is not a wireless ("air") interface.

    SWood.4Author
    Visitor II
    September 27, 2022

    The embedded cell modem connected to the MCU has a UART interface. The connection from the server application to the MCU ends up like a serial connection to the PC. The cell modem and ethernet connections in the middle end up transparent to the applications on both ends. So I need a way to update firmware over a cellular VPN, with a UART connection.

    My thought is for the server application to send a UART command so the MCU knows what follows is a firmware update, the MCU can save firmware to a FLASH location, do check sum , CRC etc. if its good, save a value at a location the bootloader checks so it knows new firmware is available, reset MCU, boot loader checks if new firmware is available, copies firmware to the Application area of the MCU, jumps to that location and runs it.

    I had also thought about having two application areas, the bootloader would jump to the one with the higher number, most recent version. Then the MCU application updates the firmware for the "offline" application, next reset the newer one runs.

    Let me know there is a better approach or an entirely better way of getting new firmware on a remote MCU. Thanks

    Super User
    September 28, 2022

    @Community member​ Your approach generally looks good and should work.

    (recently I've seen this thing from inside; it has the same STM32F7 and a similar UART-connected wireless interface. The update process works exactly as you describe, except that it pulls updates from a cloud web server).

    > I had also thought about having two application areas, the bootloader would jump to the one with the higher number

    This won't work unless you manage to make position independent binaries. By default the CubeIDE will produce code located at specific address, it won't run in place at a different address.

    Graduate II
    September 26, 2022

    Dramatically editing top posts removing the original question is unhelpful.

    Open a new question, or add a new post to the thread to take it in a different direction.