SlideShare a Scribd company logo
1 of 35
Download to read offline
Software Update on
Embedded Systems
Do not brick your device
Stefano Babic
ELCE October 2014
Introduction
● Me:
– Software Engineer at DENX, Gmbh
– U-Boot Custodian for Freescale's i.MX
– Focus on Linux embedded with PowerPC and ARM
processors.
Agenda
● Why upgrade ?
● Why is it different with a Linux-PC ?
● Upgrading strategies
● Swupdate
Why do we need to update an
embedded system ?
● It is not only hardware
● Bug fixes
● New features can be added
● Security issues : heartbleed, bad implementation...
Why is ES different ?
● Power failure
● Bad firmware
● Communication errors in
case of remote update
● No access to target
Target must recover from errors !
Which elements must be
updated ?
● Bootloader (dangerous !)
● Kernel + DT
● Root filesystem
● Application data, other filesystems..
● Customer data (migration )
● Specific software (FPGA bitstream,...)
Where is a new SW installed ?
NOR
NAND
FPGA
AREF
GND
RESET
3V3
L
TX
RX
USB
EXT
PWRSEL
PWR
ICSP
TX
RX
3
1
2
1
1
1
0
1
9 8
DIGITAL
7 6 5 4 3 2 1 0
1
5V Gnd
POWER
www.adruino.cc
ANALOG IN
Vin 0 1 2 3 4 5
d0
47
25V
d0
47
25V
ADRUINO
Which interface ?
● Local:
– Local storage (USB, SD,..)
– Local peripheral (USB as device, UART,..)
● Remote:
– HTTP / web based
– FTP
– Proprietary protocol
– Many more...
Who will update ?
X X
No expertise required
+
System upgrade solutions
● Bootloader upgrade
● Linux upgrade
– Package Manager
– Rescue image or specific application
– From the running application
Bootloader
Limited access to peripherals (drivers, filesystems)
Implementation in bootloader not in sync with Linux
Limited network support (UDP, not TCP)
Limited UI with an operator
Update is simpler
Smaller footprint
Linux App
Footprint
Availability of all drivers used by the product
A lot of tools/libraries
package manager as distro ?
Upgrade is not atomic
Nightmare for test engineers/support
New firmware partially written
More places where things can go wrong
Small update image
Full update
Size, Time to transfer
Atomic: it works or not
Single image delivery
Double copy strategy
BOOT LOADER
Application Software
Running copy
Application Software
Standby copy
Databases, config, user data
BOOT LOADER
Application Software
Standby copy
Application Software
Running copy
Databases, config, user data
Single copy (rescue)
BOOT LOADER
SWUPDATE
Kernel + initrd
Application Software Databases, config, user data
swupdate: FLOSS upgrade sw
● Missing an open source upgrade software for ES
● Take care of failure mechanism
● Hardware / software compatibility
● Proof correctness images to be installed (chksum,..)
● Partitioning storage
● Local or remote install
Swupdate-2
● Scriptable (LUA), pre- and postinstall scripts
● Single image for multiple devices
● Easy for users to perform update
● Missing : signed images !
Handling hardware differences
MENU ALARMS
OVERVIEW
Q UANTITY
Brandon-Alvin ViewerPane K600
HMI
Gateway
Type A-1 Type A-2
Type A-3 Type A-4
One release, multiple devices
Type A-1
MENU ALARMS
OVERVIEW
QUA NTITY
Brandon-Alvin ViewerPane K600
HMI
Software for A-1
Software for A-3
Software for HMI
Release XX.YY for device family
Type A-3
Single image structure
CPIO Header
sw-description
Image 1
Image 2
Image 3
Image i
Image n
Swupdate architecture
Local Storage
WebServer
Custom protocol
INSTALLER
Default
Parser
(libconfig)
Custom
Parser
(LUA)
UBI MTD RAW U-Boot
ENV
Custom
LUA
Handler
API
Handler manager
Notifier
Handling HW differences
software =
{
version = "0.1.0";
target-1target-1 = {
images: (
{
...
}
);
};
target-2 = {
images: (
{
...
}
);
};
}
sw-description
software =
{
version = "0.1.0";
myboard = {
hardware-compatibility: [ "1.2", "1.3", "18#010071"];
partitions: ( /* UBI Volumes */
{
name = "rootfs";
device = "mtd10";
size = 104896512; /* in bytes */
},
{
name = "kernel";
device = "mtd9";
size = 4194304; /* in bytes */
}
);
sw-description
images: (
{
filename = "core-image-base-myboard.ubifs";
volume = "rootfs";
},
{
filename = "uboot-env";
type = "uboot";
},
{
filename = "uImage";
volume = "kernel";
},
{
filename = "fpga.bin";
type = "fpga";
}
);
sw-description: scripts, u-boot
scripts: (
{
filename = "test.lua";
type = "lua";
},
{
filename = "sdcard.lua";
type = "lua";
},
{
filename = "test_shell.sh";
type = "shellscript";
}
);
uboot: (
{
name = "vram";
value = "4M";
}
Recovery from failures
U-Boot
Swupdate
Set update
flag
Update flag set ?
Reset
update flag
run
success
Load
kernel
fail
Kernel
boots
Application
Reset bootcounter
Bootcounter ?
Panic, watchdog,..
API for external client
Client swupdate
REQ_INSTALL
REQ_INSTALL
Status, NotificationStatus, Notification
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
DATA (IMAGE)DATA (IMAGE)
GET STATUS
GET STATUS
ACKACK
Status, NotificationStatus, Notification
GET STATUS
GET STATUS
Updating from browser
Using with Yocto
● Meta-swupdate
● It generates a ramdisk suitable for u-boot (.uboot.gz)
● “dora” and “daisy” branches
● Footprint RAMDISK (gzipped) : 2.6 – 7 MB
– Typical: ~4MB
Handler in LUA
require ("swupdate")
fpga_handler = function(image)
print("Install FPGA Software ")
for k,l in pairs(image) do
print("image[" .. tostring(k) .. "] = " .. tostring(l) )
swupdate.notify(swupdate.RECOVERY_STATUS.RUN,0,
"image[" .. tostring(k) .. "] = " .. tostring(l))
end
return 0
end
swupdate.register_handler("fpga",fpga_handler)
swupdate todo list
● Create a community around the project
● Security: add support for signed images !
● Low resources: support for full streamable image
● New handlers
Links
● Swupdate sources at
https://github.com/sbabic/swupdate
● Documentation at http://sbabic.github.io/swupdate
● Mailing list: swupdate@googlegroups.com
● http://www.denx.de/
Questions ...
● It's your turn now...

More Related Content

What's hot

Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yoctoAlex Gonzalez
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerSherif Mousa
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectYen-Chin Lee
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Anne Nicolas
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Projectrossburton
 
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...linuxlab_conf
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
Linux field-update-2015
Linux field-update-2015Linux field-update-2015
Linux field-update-2015Chris Simmonds
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practiceChris Simmonds
 
Qemu device prototyping
Qemu device prototypingQemu device prototyping
Qemu device prototypingYan Vugenfirer
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux SystemJian-Hong Pan
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?Pradeep Kumar
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
サーバ構築を自動化する 〜Ansible〜
サーバ構築を自動化する 〜Ansible〜サーバ構築を自動化する 〜Ansible〜
サーバ構築を自動化する 〜Ansible〜Yui Ito
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linuxsureskal
 

What's hot (20)

Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution Maker
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
 
Qemu Introduction
Qemu IntroductionQemu Introduction
Qemu Introduction
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Project
 
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
 
レシピの作り方入門
レシピの作り方入門レシピの作り方入門
レシピの作り方入門
 
TripleO Deep Dive 1.1
TripleO Deep Dive 1.1TripleO Deep Dive 1.1
TripleO Deep Dive 1.1
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Linux field-update-2015
Linux field-update-2015Linux field-update-2015
Linux field-update-2015
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practice
 
Qemu device prototyping
Qemu device prototypingQemu device prototyping
Qemu device prototyping
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
サーバ構築を自動化する 〜Ansible〜
サーバ構築を自動化する 〜Ansible〜サーバ構築を自動化する 〜Ansible〜
サーバ構築を自動化する 〜Ansible〜
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 

Similar to Software update for embedded systems - elce2014

Evolution of ota_update_in_the_io_t_world
Evolution of ota_update_in_the_io_t_worldEvolution of ota_update_in_the_io_t_world
Evolution of ota_update_in_the_io_t_worldStefano Babic
 
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...OpenStack Korea Community
 
ELC_NA-2015-AFT_for_CI-Igor.Stoppa
ELC_NA-2015-AFT_for_CI-Igor.StoppaELC_NA-2015-AFT_for_CI-Igor.Stoppa
ELC_NA-2015-AFT_for_CI-Igor.StoppaIgor Stoppa
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解Rex Tsai
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot) Omkar Rane
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Add sale davinci
Add sale davinciAdd sale davinci
Add sale davinciAkash Sahoo
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Strategies for developing and deploying your embedded applications and images
Strategies for developing and deploying your embedded applications and imagesStrategies for developing and deploying your embedded applications and images
Strategies for developing and deploying your embedded applications and imagesMender.io
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3David Pasek
 
Embedded Recipes 2018 - swupdate: update your embedded device - Charles-Anto...
Embedded Recipes 2018 -  swupdate: update your embedded device - Charles-Anto...Embedded Recipes 2018 -  swupdate: update your embedded device - Charles-Anto...
Embedded Recipes 2018 - swupdate: update your embedded device - Charles-Anto...Anne Nicolas
 
Sys cat i181e-en-07+sysmac studio
Sys cat i181e-en-07+sysmac studioSys cat i181e-en-07+sysmac studio
Sys cat i181e-en-07+sysmac studioMaulana Kharis
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry PiLloydMoore
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 

Similar to Software update for embedded systems - elce2014 (20)

Evolution of ota_update_in_the_io_t_world
Evolution of ota_update_in_the_io_t_worldEvolution of ota_update_in_the_io_t_world
Evolution of ota_update_in_the_io_t_world
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
 
ELC_NA-2015-AFT_for_CI-Igor.Stoppa
ELC_NA-2015-AFT_for_CI-Igor.StoppaELC_NA-2015-AFT_for_CI-Igor.Stoppa
ELC_NA-2015-AFT_for_CI-Igor.Stoppa
 
Nano Server (ATD 11)
Nano Server (ATD 11)Nano Server (ATD 11)
Nano Server (ATD 11)
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Add sale davinci
Add sale davinciAdd sale davinci
Add sale davinci
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Strategies for developing and deploying your embedded applications and images
Strategies for developing and deploying your embedded applications and imagesStrategies for developing and deploying your embedded applications and images
Strategies for developing and deploying your embedded applications and images
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Node js meetup
Node js meetupNode js meetup
Node js meetup
 
Embedded Recipes 2018 - swupdate: update your embedded device - Charles-Anto...
Embedded Recipes 2018 -  swupdate: update your embedded device - Charles-Anto...Embedded Recipes 2018 -  swupdate: update your embedded device - Charles-Anto...
Embedded Recipes 2018 - swupdate: update your embedded device - Charles-Anto...
 
Sys cat i181e-en-07+sysmac studio
Sys cat i181e-en-07+sysmac studioSys cat i181e-en-07+sysmac studio
Sys cat i181e-en-07+sysmac studio
 
DRIVE PX 2
DRIVE PX 2DRIVE PX 2
DRIVE PX 2
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Software update for embedded systems - elce2014

  • 1. Software Update on Embedded Systems Do not brick your device Stefano Babic ELCE October 2014
  • 2. Introduction ● Me: – Software Engineer at DENX, Gmbh – U-Boot Custodian for Freescale's i.MX – Focus on Linux embedded with PowerPC and ARM processors.
  • 3. Agenda ● Why upgrade ? ● Why is it different with a Linux-PC ? ● Upgrading strategies ● Swupdate
  • 4. Why do we need to update an embedded system ? ● It is not only hardware ● Bug fixes ● New features can be added ● Security issues : heartbleed, bad implementation...
  • 5. Why is ES different ? ● Power failure ● Bad firmware ● Communication errors in case of remote update ● No access to target Target must recover from errors !
  • 6. Which elements must be updated ? ● Bootloader (dangerous !) ● Kernel + DT ● Root filesystem ● Application data, other filesystems.. ● Customer data (migration ) ● Specific software (FPGA bitstream,...)
  • 7. Where is a new SW installed ? NOR NAND FPGA AREF GND RESET 3V3 L TX RX USB EXT PWRSEL PWR ICSP TX RX 3 1 2 1 1 1 0 1 9 8 DIGITAL 7 6 5 4 3 2 1 0 1 5V Gnd POWER www.adruino.cc ANALOG IN Vin 0 1 2 3 4 5 d0 47 25V d0 47 25V ADRUINO
  • 8. Which interface ? ● Local: – Local storage (USB, SD,..) – Local peripheral (USB as device, UART,..) ● Remote: – HTTP / web based – FTP – Proprietary protocol – Many more...
  • 11. System upgrade solutions ● Bootloader upgrade ● Linux upgrade – Package Manager – Rescue image or specific application – From the running application
  • 12. Bootloader Limited access to peripherals (drivers, filesystems) Implementation in bootloader not in sync with Linux Limited network support (UDP, not TCP) Limited UI with an operator Update is simpler Smaller footprint
  • 13. Linux App Footprint Availability of all drivers used by the product A lot of tools/libraries
  • 14. package manager as distro ? Upgrade is not atomic Nightmare for test engineers/support New firmware partially written More places where things can go wrong Small update image
  • 15. Full update Size, Time to transfer Atomic: it works or not Single image delivery
  • 16. Double copy strategy BOOT LOADER Application Software Running copy Application Software Standby copy Databases, config, user data BOOT LOADER Application Software Standby copy Application Software Running copy Databases, config, user data
  • 17. Single copy (rescue) BOOT LOADER SWUPDATE Kernel + initrd Application Software Databases, config, user data
  • 18. swupdate: FLOSS upgrade sw ● Missing an open source upgrade software for ES ● Take care of failure mechanism ● Hardware / software compatibility ● Proof correctness images to be installed (chksum,..) ● Partitioning storage ● Local or remote install
  • 19. Swupdate-2 ● Scriptable (LUA), pre- and postinstall scripts ● Single image for multiple devices ● Easy for users to perform update ● Missing : signed images !
  • 20. Handling hardware differences MENU ALARMS OVERVIEW Q UANTITY Brandon-Alvin ViewerPane K600 HMI Gateway Type A-1 Type A-2 Type A-3 Type A-4
  • 21. One release, multiple devices Type A-1 MENU ALARMS OVERVIEW QUA NTITY Brandon-Alvin ViewerPane K600 HMI Software for A-1 Software for A-3 Software for HMI Release XX.YY for device family Type A-3
  • 22. Single image structure CPIO Header sw-description Image 1 Image 2 Image 3 Image i Image n
  • 23. Swupdate architecture Local Storage WebServer Custom protocol INSTALLER Default Parser (libconfig) Custom Parser (LUA) UBI MTD RAW U-Boot ENV Custom LUA Handler API Handler manager Notifier
  • 24. Handling HW differences software = { version = "0.1.0"; target-1target-1 = { images: ( { ... } ); }; target-2 = { images: ( { ... } ); }; }
  • 25. sw-description software = { version = "0.1.0"; myboard = { hardware-compatibility: [ "1.2", "1.3", "18#010071"]; partitions: ( /* UBI Volumes */ { name = "rootfs"; device = "mtd10"; size = 104896512; /* in bytes */ }, { name = "kernel"; device = "mtd9"; size = 4194304; /* in bytes */ } );
  • 26. sw-description images: ( { filename = "core-image-base-myboard.ubifs"; volume = "rootfs"; }, { filename = "uboot-env"; type = "uboot"; }, { filename = "uImage"; volume = "kernel"; }, { filename = "fpga.bin"; type = "fpga"; } );
  • 27. sw-description: scripts, u-boot scripts: ( { filename = "test.lua"; type = "lua"; }, { filename = "sdcard.lua"; type = "lua"; }, { filename = "test_shell.sh"; type = "shellscript"; } ); uboot: ( { name = "vram"; value = "4M"; }
  • 28. Recovery from failures U-Boot Swupdate Set update flag Update flag set ? Reset update flag run success Load kernel fail Kernel boots Application Reset bootcounter Bootcounter ? Panic, watchdog,..
  • 29. API for external client Client swupdate REQ_INSTALL REQ_INSTALL Status, NotificationStatus, Notification DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) DATA (IMAGE)DATA (IMAGE) GET STATUS GET STATUS ACKACK Status, NotificationStatus, Notification GET STATUS GET STATUS
  • 31. Using with Yocto ● Meta-swupdate ● It generates a ramdisk suitable for u-boot (.uboot.gz) ● “dora” and “daisy” branches ● Footprint RAMDISK (gzipped) : 2.6 – 7 MB – Typical: ~4MB
  • 32. Handler in LUA require ("swupdate") fpga_handler = function(image) print("Install FPGA Software ") for k,l in pairs(image) do print("image[" .. tostring(k) .. "] = " .. tostring(l) ) swupdate.notify(swupdate.RECOVERY_STATUS.RUN,0, "image[" .. tostring(k) .. "] = " .. tostring(l)) end return 0 end swupdate.register_handler("fpga",fpga_handler)
  • 33. swupdate todo list ● Create a community around the project ● Security: add support for signed images ! ● Low resources: support for full streamable image ● New handlers
  • 34. Links ● Swupdate sources at https://github.com/sbabic/swupdate ● Documentation at http://sbabic.github.io/swupdate ● Mailing list: swupdate@googlegroups.com ● http://www.denx.de/
  • 35. Questions ... ● It's your turn now...