SlideShare a Scribd company logo
1 of 34
Download to read offline
FIRMWARE UPDATE
BLUETOOTH OVER-THE-AIR
SVIOS MEETUP - APRIL 2017 - RAMIN FIROOZYE - RAMIN@GMAIL.COM - @RAMINF
DEVICES ARE GETTING SMARTER
TYPICAL BLUETOOTH DEVICE
=
EMBEDDED CPU + WIRELESS + SOFTWARE
FIRMWARE IS…
▸ Software that runs on an
embedded device CPU
▸ App typically written in ‘C’ and
compiled into binary
▸ First loaded onto device using
a wired connection or
‘programmer’ device
▸ App runs on power on
TYPICAL CONNECTED DEVICE
Hardware
Firmware
Phone
App
Server
REST API
IF THERE’S A PROBLEM WITH YOUR PHONE APP…
▸ You push out an update to the App Store
▸ But what if there’s a problem with the firmware?
IF PROBLEM IS WITH FIRMWARE YOU CAN:
▸ Ignore it. Maybe no one will notice
▸ Ask user to plug into a USB cable and manually update
▸ Factory recall the device then update and send back
▸ Send a new device to every new customer
Bluetooth Over-The-Air Firmware Update
Bluetooth Over-The-Air Firmware Update
THERE’S AN EASIER WAY
▸ Over the Air Updates
▸ OTA
▸ DFU
▸ OAD
HOW OTA UPDATES WORK
Firmware

v2.0 binary
Update

Server
1
Version ?
v1.0
App Firmware
2
OK
App Firmware
4
Here’s

2.0
I have

v1.0?
3
App
Update

Server
DEVICE NEEDS
▸ Enough flash storage to keep 2 or more copies of firmware
Current
New
Factory 

(optional but recommended)
FIRMWARE NEEDS TO HAVE…
‣ Way to get firmware version, HW rev, and type
‣ Unique ID (if user has more than one)
‣ Switch to/from normal and update mode
‣ Detect incomplete/corrupt downloads
‣ Recover from bad update (bricking)
Factory 

(maybe not so optional)
▸Manual
▸Always On
▸Software switch
SWITCHING IN/OUT UPDATE MODE
Normal Mode
Update Mode
Enable

Update
Power

On
HOW TO SWITCH INTO UPDATE WITH BLE
▸ Scan/connect normally
▸ Standard BLE Service has an ‘update mode’ characteristic
▸ Write ‘1’ into characteristic (for example)
▸ Firmware reboots, this time running Update BLE Service
▸ Scan for Update service
▸ Connect and transfer binary
HOW TO SWITCH OUT OF UPDATE WITH BLE
▸ Wait for download complete
▸ Checksum
▸ If OK, overwrite old firmware
▸ Restart into normal mode with new firmware
▸ If not OK, either request retransmit or go back to normal
RECOVER FROM BAD FIRMWARE/STATE
▸ Make it hard to accidentally
invoke factory reset
▸ Overwrite current firmware from
on-board factory version
▸ Should not require connection
(may not be there)
▸ OK to lose cached data
ALSO, SECURITY…
SECURITY THROUGH OBSCURITY DOESN’T WORK
COMPILED BINARY ISN’T GOOD PROTECTION
IDA Pro Disassembler/Debugger https://www.hex-rays.com/products/ida/
UPDATES CAN ALSO BE DONE BADLY
PRO-TIPS
END-TO-END ENCRYPTION
Firmware

v2.0 binary
Update

Server
1
Version ?
v1.0
App Firmware
2
OK
App Firmware
4
Here’s

2.0
I have

v1.0?
3
App
Update

Server
ENCRYPTION BEST-PRACTICES
▸ Use asymmetric public-key encryption
▸ Use digital signatures to verify devices
▸ Choose BLE chip with built-in crypto hardware
▸ Do full security audit/code review before launch
▸ If feasible, use a ‘secure enclave’ chip to hold private keys
PROBLEM WITH ON-CHIP DECRYPTION
▸ Need enough flash to keep 3 or more copies of firmware
Factory (Optional)
New (encrypted)
Current
New (decrypted)
(Plus scratch space during decryption)
ENCRYPTION TRADE-OFF
▸ Bill Of Material Cost
▸ Processing Power
▸ Added Complexity
▸ Development Time
$$$
PLAN B: DECRYPT ON PHONE
OK
App Firmware
4
Here’s

2.0
I have

v1.0?
3
App
Update

Server
Requires 

pairing
DECRYPTING ON IPHONE (HOMEWORK)
▸ Don’t decrypt until absolutely necessary
▸ Go watch WWDC 2015 Video: “Security and Your Apps”
▸ https://developer.apple.com/videos/play/wwdc2015/706/
▸ If too lazy check out: SecureEnclaveCrypto library on GitHub
▸ https://github.com/trailofbits/SecureEnclaveCrypto
▸ Set up bonding/pairing between phone and device
▸ https://devzone.nordicsemi.com/question/47091/getting-an-ios-
central-app-to-bond/
BARE MINIMUM FIRMWARE UPDATE SYSTEM
▸ Manual deployment checklist
▸ Web download site with SSL (i.e. Amazon S3)
▸ Firmware metadata (text file)
▸ Simple mobile SDK (REST to server - BLE to device)
▸ Firmware with OTA update + software toggle
▸ BLE hardware with 2x flash
A PROPER UPDATE SYSTEM
▸ Rapid firmware build and
deploy (with encryption)
▸ Back-end update server (with
SSL/TLS and REST API)
▸ Release workflow automation
▸ Mobile app SDK (REST to
server - BLE to device)
▸ Push notification (or
WebSocket support)
▸ Application UX/UI design
templates
▸ Firmware with OTA update +
software toggle
▸ Hardware support for OTA 

(4x flash + crypto + factory reset)
▸ Device segmentation and
analytics
▸ End-to-end encryption
THINK DIFFERENT
▸ Treat Firmware Updates like App Updates
▸ Release an MVP device then iterate
quickly with new features
▸ Have different firmware for different
markets (or users)
▸ Use serial numbers & encryption to avoid
piracy
▸ Do not load final firmware at factory (!?!)
COUNTERFEITS
▸ Hoverboards
▸ https://www.wired.com/2015/06/
the-weird-story-of-the-viral-
chinese-scooter-phunkeeduck-io-
hawk/
▸ Saleae Logic Analyzers
▸ https://www.saleae.com/
counterfeit
PLAN AHEAD
▸ Don’t leave firmware update support to the last minute
▸ Don’t host firmware updates on same back-end as app-server
▸ Always have a fallback plan / factory reset
▸ Design app UX with firmware update in mind
▸ Test, test, test
▸ If all this seems too daunting…
▸ Get in touch: raminf@gmail.com
Q&A
Thank You

More Related Content

What's hot

How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...Peter Leschev
 
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...Cloud Native Day Tel Aviv
 
Game of Codes: the Battle for CI
Game of Codes: the Battle for CIGame of Codes: the Battle for CI
Game of Codes: the Battle for CIAtlassian
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingSteve Smith
 
Jenkins Docker
Jenkins DockerJenkins Docker
Jenkins DockerAlex Soto
 
mykola marzhan - jenkins on aws spot instance
mykola marzhan - jenkins on aws spot instancemykola marzhan - jenkins on aws spot instance
mykola marzhan - jenkins on aws spot instanceDariia Seimova
 
Architecting for continuous delivery (33rd Degree)
Architecting for continuous delivery (33rd Degree)Architecting for continuous delivery (33rd Degree)
Architecting for continuous delivery (33rd Degree)Axel Fontaine
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansiblewajrcs
 
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014Amazon Web Services
 
How to setup jenkins
How to setup jenkinsHow to setup jenkins
How to setup jenkinslinuxdady
 
Docker, Continuous Integration, and You
Docker, Continuous Integration, and YouDocker, Continuous Integration, and You
Docker, Continuous Integration, and YouAtlassian
 
Two-Step Deployment with Rails
Two-Step Deployment with RailsTwo-Step Deployment with Rails
Two-Step Deployment with Railsdugsmith
 
AtlasCamp 2013: Bring your own Stack
AtlasCamp 2013: Bring your own Stack AtlasCamp 2013: Bring your own Stack
AtlasCamp 2013: Bring your own Stack colleenfry
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Yan Cui
 
Ansible training | redhat Ansible 2.5 Corporate course - GOT
Ansible training | redhat Ansible 2.5 Corporate course - GOTAnsible training | redhat Ansible 2.5 Corporate course - GOT
Ansible training | redhat Ansible 2.5 Corporate course - GOTkeerthi124
 
State of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DCState of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DCPuppet
 
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014Endava
 

What's hot (20)

How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
 
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
 
Game of Codes: the Battle for CI
Game of Codes: the Battle for CIGame of Codes: the Battle for CI
Game of Codes: the Battle for CI
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration training
 
Jenkins Docker
Jenkins DockerJenkins Docker
Jenkins Docker
 
mykola marzhan - jenkins on aws spot instance
mykola marzhan - jenkins on aws spot instancemykola marzhan - jenkins on aws spot instance
mykola marzhan - jenkins on aws spot instance
 
Architecting for continuous delivery (33rd Degree)
Architecting for continuous delivery (33rd Degree)Architecting for continuous delivery (33rd Degree)
Architecting for continuous delivery (33rd Degree)
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
 
How to setup jenkins
How to setup jenkinsHow to setup jenkins
How to setup jenkins
 
Docker, Continuous Integration, and You
Docker, Continuous Integration, and YouDocker, Continuous Integration, and You
Docker, Continuous Integration, and You
 
Watchman Monitoring Mactech Pro Quicktalk 2016
Watchman Monitoring Mactech Pro Quicktalk 2016Watchman Monitoring Mactech Pro Quicktalk 2016
Watchman Monitoring Mactech Pro Quicktalk 2016
 
Two-Step Deployment with Rails
Two-Step Deployment with RailsTwo-Step Deployment with Rails
Two-Step Deployment with Rails
 
fmcsadmin 1.0.0
fmcsadmin 1.0.0fmcsadmin 1.0.0
fmcsadmin 1.0.0
 
AtlasCamp 2013: Bring your own Stack
AtlasCamp 2013: Bring your own Stack AtlasCamp 2013: Bring your own Stack
AtlasCamp 2013: Bring your own Stack
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
 
Ansible training | redhat Ansible 2.5 Corporate course - GOT
Ansible training | redhat Ansible 2.5 Corporate course - GOTAnsible training | redhat Ansible 2.5 Corporate course - GOT
Ansible training | redhat Ansible 2.5 Corporate course - GOT
 
Docker, OSS and Azure
Docker, OSS and AzureDocker, OSS and Azure
Docker, OSS and Azure
 
State of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DCState of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DC
 
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
 

Similar to Bluetooth Over-The-Air Firmware Update

Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administrationConcentrated Technology
 
Android 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsAndroid 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsKai Koenig
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt LongOpenCredo
 
Building and Deploying PHP Applications, PHPTour 2016
Building and Deploying PHP Applications, PHPTour 2016Building and Deploying PHP Applications, PHPTour 2016
Building and Deploying PHP Applications, PHPTour 2016Martins Sipenko
 
Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API SetupDiana Michelle
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using AnsibleSonatype
 
N-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and SecurityN-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and SecurityPeter Gfader
 
Real World Click Once
Real World Click OnceReal World Click Once
Real World Click OnceVivusCraig
 
Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7
Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7
Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7Arun Sharma
 
Sequence Like a Boss - BriForum 2015 Denver
Sequence Like a Boss - BriForum 2015 DenverSequence Like a Boss - BriForum 2015 Denver
Sequence Like a Boss - BriForum 2015 DenverRyanWillDotcom
 
Getting started with CFEngine - Webinar
Getting started with CFEngine - WebinarGetting started with CFEngine - Webinar
Getting started with CFEngine - WebinarCFEngine
 
UNIT 2 P5 part 2
UNIT 2 P5 part 2UNIT 2 P5 part 2
UNIT 2 P5 part 2OriginalGSM
 
Safe peak installation guide version 2.1
Safe peak installation guide version 2.1Safe peak installation guide version 2.1
Safe peak installation guide version 2.1Vladi Vexler
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii ShumadaFwdays
 
Container Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.xContainer Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.xJakub Hajek
 
React native buildrelease
React native buildreleaseReact native buildrelease
React native buildreleaseDung Nguyen Van
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionCFEngine
 

Similar to Bluetooth Over-The-Air Firmware Update (20)

Free tools for win server administration
Free tools for win server administrationFree tools for win server administration
Free tools for win server administration
 
Android 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsAndroid 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture Components
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
 
Building and Deploying PHP Applications, PHPTour 2016
Building and Deploying PHP Applications, PHPTour 2016Building and Deploying PHP Applications, PHPTour 2016
Building and Deploying PHP Applications, PHPTour 2016
 
Spring boot
Spring bootSpring boot
Spring boot
 
Google Glass Mirror API Setup
Google Glass Mirror API SetupGoogle Glass Mirror API Setup
Google Glass Mirror API Setup
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using Ansible
 
N-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and SecurityN-Tier Application with Windows Forms - Deployment and Security
N-Tier Application with Windows Forms - Deployment and Security
 
Real World Click Once
Real World Click OnceReal World Click Once
Real World Click Once
 
Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7
Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7
Oracle Enterprise Manager Cloud Control 13c13.3 Installation On Oracle Linux-7
 
Sequence Like a Boss - BriForum 2015 Denver
Sequence Like a Boss - BriForum 2015 DenverSequence Like a Boss - BriForum 2015 Denver
Sequence Like a Boss - BriForum 2015 Denver
 
Getting started with CFEngine - Webinar
Getting started with CFEngine - WebinarGetting started with CFEngine - Webinar
Getting started with CFEngine - Webinar
 
UNIT 2 P5 part 2
UNIT 2 P5 part 2UNIT 2 P5 part 2
UNIT 2 P5 part 2
 
Safe peak installation guide version 2.1
Safe peak installation guide version 2.1Safe peak installation guide version 2.1
Safe peak installation guide version 2.1
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
 
Container Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.xContainer Orchestration with Traefik 2.x
Container Orchestration with Traefik 2.x
 
Best free tools for win database admin
Best free tools for win database adminBest free tools for win database admin
Best free tools for win database admin
 
Best free tools for w d a
Best free tools for w d aBest free tools for w d a
Best free tools for w d a
 
React native buildrelease
React native buildreleaseReact native buildrelease
React native buildrelease
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated Version
 

More from Ramin Firoozye

Here Come The Smartwatches
Here Come The Smartwatches Here Come The Smartwatches
Here Come The Smartwatches Ramin Firoozye
 
IOT Oversharing: 
Stop Sending My Stuff to the Cloud
IOT Oversharing: 
Stop Sending My Stuff to the CloudIOT Oversharing: 
Stop Sending My Stuff to the Cloud
IOT Oversharing: 
Stop Sending My Stuff to the CloudRamin Firoozye
 
Not another *$#@ app: How to avoid IoT fatigue
Not another *$#@ app: How to avoid IoT fatigueNot another *$#@ app: How to avoid IoT fatigue
Not another *$#@ app: How to avoid IoT fatigueRamin Firoozye
 
Build Your own iBeacon
Build Your own iBeaconBuild Your own iBeacon
Build Your own iBeaconRamin Firoozye
 
iPhone and iPad Back-End Servers
iPhone and iPad Back-End ServersiPhone and iPad Back-End Servers
iPhone and iPad Back-End ServersRamin Firoozye
 
iPhone Back-End Servers
iPhone Back-End ServersiPhone Back-End Servers
iPhone Back-End ServersRamin Firoozye
 

More from Ramin Firoozye (7)

Smartwatches Oooooof!
Smartwatches Oooooof!Smartwatches Oooooof!
Smartwatches Oooooof!
 
Here Come The Smartwatches
Here Come The Smartwatches Here Come The Smartwatches
Here Come The Smartwatches
 
IOT Oversharing: 
Stop Sending My Stuff to the Cloud
IOT Oversharing: 
Stop Sending My Stuff to the CloudIOT Oversharing: 
Stop Sending My Stuff to the Cloud
IOT Oversharing: 
Stop Sending My Stuff to the Cloud
 
Not another *$#@ app: How to avoid IoT fatigue
Not another *$#@ app: How to avoid IoT fatigueNot another *$#@ app: How to avoid IoT fatigue
Not another *$#@ app: How to avoid IoT fatigue
 
Build Your own iBeacon
Build Your own iBeaconBuild Your own iBeacon
Build Your own iBeacon
 
iPhone and iPad Back-End Servers
iPhone and iPad Back-End ServersiPhone and iPad Back-End Servers
iPhone and iPad Back-End Servers
 
iPhone Back-End Servers
iPhone Back-End ServersiPhone Back-End Servers
iPhone Back-End Servers
 

Recently uploaded

Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInThousandEyes
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud DataEric D. Schabell
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updateadam112203
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarThousandEyes
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024Brian Pichman
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxGraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxNeo4j
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameKapil Thakar
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingFrancesco Corti
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptxHansamali Gamage
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxKaustubhBhavsar6
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kitJamie (Taka) Wang
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Muhammad Tiham Siddiqui
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1DianaGray10
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Alkin Tezuysal
 

Recently uploaded (20)

Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxGraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is going
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptx
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kit
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 
SheDev 2024
SheDev 2024SheDev 2024
SheDev 2024
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
 

Bluetooth Over-The-Air Firmware Update

  • 1. FIRMWARE UPDATE BLUETOOTH OVER-THE-AIR SVIOS MEETUP - APRIL 2017 - RAMIN FIROOZYE - RAMIN@GMAIL.COM - @RAMINF
  • 3. TYPICAL BLUETOOTH DEVICE = EMBEDDED CPU + WIRELESS + SOFTWARE
  • 4. FIRMWARE IS… ▸ Software that runs on an embedded device CPU ▸ App typically written in ‘C’ and compiled into binary ▸ First loaded onto device using a wired connection or ‘programmer’ device ▸ App runs on power on
  • 6. IF THERE’S A PROBLEM WITH YOUR PHONE APP… ▸ You push out an update to the App Store ▸ But what if there’s a problem with the firmware?
  • 7. IF PROBLEM IS WITH FIRMWARE YOU CAN: ▸ Ignore it. Maybe no one will notice ▸ Ask user to plug into a USB cable and manually update ▸ Factory recall the device then update and send back ▸ Send a new device to every new customer
  • 10. THERE’S AN EASIER WAY ▸ Over the Air Updates ▸ OTA ▸ DFU ▸ OAD
  • 11. HOW OTA UPDATES WORK Firmware
 v2.0 binary Update
 Server 1 Version ? v1.0 App Firmware 2 OK App Firmware 4 Here’s
 2.0 I have
 v1.0? 3 App Update
 Server
  • 12. DEVICE NEEDS ▸ Enough flash storage to keep 2 or more copies of firmware Current New Factory 
 (optional but recommended)
  • 13. FIRMWARE NEEDS TO HAVE… ‣ Way to get firmware version, HW rev, and type ‣ Unique ID (if user has more than one) ‣ Switch to/from normal and update mode ‣ Detect incomplete/corrupt downloads ‣ Recover from bad update (bricking) Factory 
 (maybe not so optional)
  • 14. ▸Manual ▸Always On ▸Software switch SWITCHING IN/OUT UPDATE MODE Normal Mode Update Mode Enable
 Update Power
 On
  • 15. HOW TO SWITCH INTO UPDATE WITH BLE ▸ Scan/connect normally ▸ Standard BLE Service has an ‘update mode’ characteristic ▸ Write ‘1’ into characteristic (for example) ▸ Firmware reboots, this time running Update BLE Service ▸ Scan for Update service ▸ Connect and transfer binary
  • 16. HOW TO SWITCH OUT OF UPDATE WITH BLE ▸ Wait for download complete ▸ Checksum ▸ If OK, overwrite old firmware ▸ Restart into normal mode with new firmware ▸ If not OK, either request retransmit or go back to normal
  • 17. RECOVER FROM BAD FIRMWARE/STATE ▸ Make it hard to accidentally invoke factory reset ▸ Overwrite current firmware from on-board factory version ▸ Should not require connection (may not be there) ▸ OK to lose cached data
  • 19. SECURITY THROUGH OBSCURITY DOESN’T WORK
  • 20. COMPILED BINARY ISN’T GOOD PROTECTION IDA Pro Disassembler/Debugger https://www.hex-rays.com/products/ida/
  • 21. UPDATES CAN ALSO BE DONE BADLY
  • 23. END-TO-END ENCRYPTION Firmware
 v2.0 binary Update
 Server 1 Version ? v1.0 App Firmware 2 OK App Firmware 4 Here’s
 2.0 I have
 v1.0? 3 App Update
 Server
  • 24. ENCRYPTION BEST-PRACTICES ▸ Use asymmetric public-key encryption ▸ Use digital signatures to verify devices ▸ Choose BLE chip with built-in crypto hardware ▸ Do full security audit/code review before launch ▸ If feasible, use a ‘secure enclave’ chip to hold private keys
  • 25. PROBLEM WITH ON-CHIP DECRYPTION ▸ Need enough flash to keep 3 or more copies of firmware Factory (Optional) New (encrypted) Current New (decrypted) (Plus scratch space during decryption)
  • 26. ENCRYPTION TRADE-OFF ▸ Bill Of Material Cost ▸ Processing Power ▸ Added Complexity ▸ Development Time $$$
  • 27. PLAN B: DECRYPT ON PHONE OK App Firmware 4 Here’s
 2.0 I have
 v1.0? 3 App Update
 Server Requires 
 pairing
  • 28. DECRYPTING ON IPHONE (HOMEWORK) ▸ Don’t decrypt until absolutely necessary ▸ Go watch WWDC 2015 Video: “Security and Your Apps” ▸ https://developer.apple.com/videos/play/wwdc2015/706/ ▸ If too lazy check out: SecureEnclaveCrypto library on GitHub ▸ https://github.com/trailofbits/SecureEnclaveCrypto ▸ Set up bonding/pairing between phone and device ▸ https://devzone.nordicsemi.com/question/47091/getting-an-ios- central-app-to-bond/
  • 29. BARE MINIMUM FIRMWARE UPDATE SYSTEM ▸ Manual deployment checklist ▸ Web download site with SSL (i.e. Amazon S3) ▸ Firmware metadata (text file) ▸ Simple mobile SDK (REST to server - BLE to device) ▸ Firmware with OTA update + software toggle ▸ BLE hardware with 2x flash
  • 30. A PROPER UPDATE SYSTEM ▸ Rapid firmware build and deploy (with encryption) ▸ Back-end update server (with SSL/TLS and REST API) ▸ Release workflow automation ▸ Mobile app SDK (REST to server - BLE to device) ▸ Push notification (or WebSocket support) ▸ Application UX/UI design templates ▸ Firmware with OTA update + software toggle ▸ Hardware support for OTA 
 (4x flash + crypto + factory reset) ▸ Device segmentation and analytics ▸ End-to-end encryption
  • 31. THINK DIFFERENT ▸ Treat Firmware Updates like App Updates ▸ Release an MVP device then iterate quickly with new features ▸ Have different firmware for different markets (or users) ▸ Use serial numbers & encryption to avoid piracy ▸ Do not load final firmware at factory (!?!)
  • 33. PLAN AHEAD ▸ Don’t leave firmware update support to the last minute ▸ Don’t host firmware updates on same back-end as app-server ▸ Always have a fallback plan / factory reset ▸ Design app UX with firmware update in mind ▸ Test, test, test
  • 34. ▸ If all this seems too daunting… ▸ Get in touch: raminf@gmail.com Q&A Thank You