cancel
Showing results for 
Search instead for 
Did you mean: 

FOTA using STM32

Maunik Patel
Associate II

According to AN2606 (STM32 microcontroller system memory boot mode), Section 4.3, we require a 'HOST' peripheral, to communicate with STM32 MCU, in order to get new firmware from the peripheral (while booting from System Memory).

Flowchart from Section 5.2 shows that bootloader will wait until it receives either 0x7F from USARTx OR some specific byte from specific peripheral.

After reading this document, I think we must have a HOST Controller (like another MCU) in our development board, to do FOTA.

Am I correct ?

Is there any alternative to flash new code in main flash memory, using the default bootloader ?

All I need to do is do FOTA using STM32L432KB.

Please suggest me all possible ways for that.

8 REPLIES 8

In this context FOTA is more like an IAP (In App Programming) method rather than ISP using the ROM

Ideally you want a place to stage the new firmware, either an external SPI Flash, or the upper half of the Internal Flash.

Is "AIR" in your application radio, ie WiFi, Cellular, NB, LoRa, etc?

You could also use a small app running from RAM if the connection/power is reliable and more of the Internal Flash needs updating, ie small loader, larger app

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

"AIR" is Cellular here, a BG96 module from Quectel.

Yes, I understand that it is IAP.

I have gone through the boot loader configuration process for this MCU.

Once the default boot loader is called after RESET, it looks for specific byte from its peripherals, to initiate Flashing.

I would like to know, what if one wants to update Flash code using IAP (using the Boot Loader).

Do we need to have a HOST controller (as I asked before), that can initiate communication with the boot loader and send it the specific byte ?

OR it works in some other manner ?

>>Yes, I understand that it is IAP.

Ok, but you keep talking about the ROM based boot loader

IAP across a network would be done internally by your own loader running in the L432, likely doing an HTTP GET to a file server holding a new image.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

To use the ROM loader, yes you'd need an external micro to talk the protocols described in the AN2606. The ROM is designed for ISP (In System Programming), ie Production/Test at the factory.

Your own code can access and write to the Flash, you don't need the ROM's assistance.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

OK Clive, I think I get you now.

Actually I misunderstood IAP and thought boot-loader is a part of IAP.

Thanks for correcting me.

Now, I am reading AN4657 (attached below).

(If there is a general document for STM32 IAP, please share it with me.)

Section 1.1 (page 5), states that "The user application is likely to have independent stack and interrupt vector (both are recommended but neither is mandatory)"

I would like to know why it is recommended and how to achieve it ?

Instead of the recommended method, can I use below mentioned approach ?

  • when reset occurs, program counter is set to execute IAP code
  • IAP code checks a condition to get new firmware
  • If new firmware is available, write it below IAP code (we need to know size of IAP code for that) and reset the MCU from IAP code
  • If new firmware is not available, jump at the address where Application code is written (address can be calculated from point 3)

(Application address = Vector Table Size + size of IAP code + some alignment bytes)

Equation above is just my calculation. Don't know if I am in right direction or not.

Please guide me.

SMask.1
Associate II

Hello

also i have to do this task. FOTA download using UART boot loader please guide me..

SMask.1
Associate II

here i am using STM32L010RB board

SMask.1
Associate II

Hello

also i have to do this task. FOTA download using UART boot loader please guide me..

here i am using STM32L010RB board