Demo 55: Firmware Update Over The Air (FOTA) for ECU (STM32) via ESP32 (HTTP - CAN protocols)

1. Introduction

FOTA is keeping an important role now a day. It helps to update the Firmware without recalling the product, especially in automotive where recalling costs millions to billions of USD.

The demo with old firmware will blink the Red Led. The new firmware will blink the Blue Led.

This demo is setup as below:

This demo reused some demos: 

STM32 Firmwares include:

STM32 Flash layout for this demo:

2. Hardware

1 ESP32 Dev module

2 CAN transceivers 

STM32F407 Discovery board

The connection between CAN transceiver and ESP32: ESP32 CAN

The connection between CAN transceiver and STM32: 

- PB8 x CRX

- PB9 x CTX

3. Software

STM32 Flowchart:

ESP32 Flowchart:
CAN Flowchart

The format of SW Info file (NSW.txt): version;url (Example: 1.3;

The FW file (.bin) and NSW.txt are put under a directory and a Python3 Simple HTTP is used. Under the SW directory open the Terminal and run the command: python3 -m http.server

The source code is updated here:

4. Result

Post a Comment


Anonymous said…
Discount now,save upto 79% and 100% guarantee the quality.