You are on page 1of 81

Firmware

Over The Air (FOTA)

Supervised By
Prof. Dr. Salah Shaban Prof. Dr. Mohamed Badawy
Agenda
01 Introduction

02 System Overview

03 WEB

04 Security
Agenda
05 Server

06 CAN Protocol

07 Bootloader

08 Main ECU
Agenda
09 USER INTERFACE

10 Application ECU

11 Hardware Implementation

12 Future Work
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
System Overview
FOTA Services

Optimize operations Keep devices Firmware update


while delivering a updated over their facilitates bug fixing, Secure system
great customer entire lifecycle, enhancements, and through data integrity
experience without costly service security patch and source
trips updates authentication

OEMs
System Overview
Firmware & Software
where the users Update Release Provides the products
can get new with Firmware system
updates for their
systems or send
diagnostics to get
problems solved.
Communication
Backend Firmware Updates Protocols. OEM Firmware
server/cloud Update Provider
sent to devices

ECU ECU

TCU GW

ECU ECU

Gate Way
Telematics Unit Connects between TCU
It’s the bridge and all the product Electronic Control Unit
connecting the server ECUs, get important An embedded system in
and the whole system data from the received automotive electronics
allowing to send and update before sending it controls one or more of the
receive multiple data to the target ECU like electrical systems or
through it. ECU ID subsystems.
System Overview
Is that all?
Flashing Techniques for Microcontrollers
Flash is a type of non-volatile memory; that is, it's a memory that keeps the information transferred to
it even when the power to the microcontroller is shut off… We need to get our program there

In-System
Off-Circuit
Programming Bootloader
Programming
(ISP)
WEB: Front-End
OVERVIEW
WEB: Back-End
Update Page
Firebase: Real-time Database
Firebase: Storage
Firebase: Realtime
Security & Cryptography
What is cryptography
SenderSide

BLACK
Plaintext
BOX

RecieverSide
Why AES
AES 256 ECC RSA
Medium Short Long
quantum- offers excellent susceptible to
resistant resistance to quantum attacks
quantum attacks using Shor's
algorithm
Symmetric Asymmetric Asymmetric

AES 256 is the used algorithm.


AES Modes
CBC CTR ECB
Each plaintext block is Converts a block cipher into a block of plaintext is independently
XORed with the previous stream cipher encrypted
ciphertext block before
encryption.
Interdependency
between blocks.
initialization vector (IV) Parallelizable and allows for Identical plaintext blocks will result
for the first block is efficient encryption/decryption in identical ciphertext blocks
required.
Require padding padding isn’t required Does not provide any mechanism
for error propagation
Better security that ECB Suitable, efficient and secure. Vulnerable
Main Characteristics

Why AES
Black-Box

ً % 0 ‫ق‬
{ z ‫ہ‬
M k à
J [ j
A E S
C h a r
a c t e
r i s t
Example of Encryption
Server
Firebase
• Firebase is a Backend-as-a-Service (Baas). It provides developers with
a variety of tools and services to help them develop quality apps
• Firebase is categorized as a NoSQL database program, that stores data
in JSON-like documents.
Realtime Database
• The Firebase Real-time Database is a cloud-hosted NoSQL database that enables
data to be stored and synced between users in real-time.
Authentication
• Firebase Authentication makes it easy for developers to build secure authentication
systems and enhances the sign-in and onboarding experience for users.
Storage
• Firebase allows us to store files like the software update to access them later and
download it.
Firebase Pros
• Faster App Development
• Hosting
• Performance Monitoring
• Extensive Documentation
• Analytics
• Serverless Platform
• Cloud Firestore
• Easy Integration
ESP
The ESP32 is a popular and versatile microcontroller, It is widely used
on the Internet of Things (IoT) and embedded systems projects due to
its powerful features and built-in connectivity options.
Why ESP32?
• Wi-Fi and Bluetooth Connectivity
• Built-in Peripherals
• Low Power Consumption
• OTA (Over-the-Air) Updates
• Open-Source
• Large Community and Support
• Extensive Development Frameworks
ESP with Firebase
ESP is used to store and read data from the database
ESP Wi-Fi

The ESP32 are readily available Wi-Fi modules with full TCP/IP stack and
microcontroller capability.
ESP32 Wi-Fi networking functionality

• Station mode (aka STA mode or Wi-Fi client mode). ESP32 connects to an access
point.
• AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the
ESP32.
• Station/AP-coexistence mode (ESP32 is concurrently an access point and a station
connected to another access point).
• Various security modes for the above (WPA, WPA2, WPA3, etc.)
• Scanning for access points (active & passive scanning).
• Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets.
CAN Protocol
CAN Network
Controller Area Network
CAN Features
❖ Low Cost

❖ Speed

❖ Multi-Master

❖ Message based, not address based

❖ Built-in Error Detection

❖ Stable
Message Types
❖ Data Frame

❖ Remote Frame

❖ Error Frame

❖ Overload Frame
CAN Interface
CAN Operation
❖ Message Transmission

Identifier List Mode

❖ Message Filtering
Identifier Mask Mode

❖ Message Reception
Bootloader
Bootloader

➢ Solving The Problem.

➢ Bootloader.
Bootloader
• Memory Hierarchy
Bootloader
• Scenarios
Bootloader
• CRC Check
Bootloader
• Update Complete
Bootloader
• Data Corruption
MAIN ECU
MAIN ECU
Main Functions of Main ECU
Telematics Gateway
Unit Unit
• Receive Update Request • Handling of communication traffic

• Check for Update Version between multiple ECUs

• Download Update File • Send downloaded file to APP ECU

• Decryption of File • Receive diagnostics data

• Send Update File


MAIN ECU
Components of Main ECU
STM32 BLUE PILL TFT diplay
MAIN ECU
Steps of Downloading Update File
Server Authentication / Check Update Version /
Connection with Server Download Update File
Providing API key and
Check version of update
server authentication
file from server RTDB and
credentials to connect to
download file from the
server and allow access to
database and save it to
fetch data.
SPIFFS.
Send file to Gateway
using UART Decryption of Update File
We use UART Read file line by line then
communication protocol to decode it using Base64
send data after receiving and decrypt each line using
an acknowledgment to AES method.
send the frame required.
USER INTERFACE
Touch Screen
Touch Screen
Touch Screen
Touch Screen
Touch Screen
Touch Screen
APP ECUs
STM32
APP ECUs
Hardware
Hardware
Future Work
Future Work

-Embedded LINUX
-RTOS
-AUTOSAR Layered Architecture
THANK YOU

You might also like