SlideShare a Scribd company logo
1 of 37
Download to read offline
Colin Walls
Self-Testing in Embedded
Systems
colin_walls@mentor.com
http://blogs.mentor.com/colinwalls
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Introduction
 Failure is almost inevitable
 Important to accept this fact
 Key issues:
— How to reduce likelihood of failure
— How to handle impending failure
— How to recover from failure conditions
Restricted © 2017 Mentor Graphics Corporation
Failure and Testing
 What can fail in an
embedded system?
— CPU
— Peripherals
— Memory
— Software
 Start-up testing
 Background testing
 Watchdog
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
CPU Failure
 Quite unlikely for just processor to fail
 Possibly no hope of recovery
 Failure most likely at power up
 Partial failure very rare
 Multicore designs offer
options
Restricted © 2017 Mentor Graphics Corporation
CPU Failure
 Quite unlikely for just processor to fail
 Possibly no hope of recovery
 Failure most likely at power up
 Partial failure very rare
 Multicore designs
offer options
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Peripheral Failure
 Total failure: not responding to address
— Trap handler
 Other failures/tests are device dependent
 Loop back testing is common
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Memory Failure
 Systems have a lot of memory
— Surprising that failure is not more
common
 Failure most likely at power up
— That is the time for
comprehensive testing
 3 failure modes:
— Not responding
— Stuck bits
— Cross-talk
Restricted © 2017 Mentor Graphics Corporation
Memory Testing
 “Moving Ones” test
— Looks for stuck bits and cross talk with fine grain resolution
— Perform on start up
— Code to only use registers
— “Moving Zeros” is the same idea
 Pattern test
— Also looks for stuck bits and cross talk
— Perform in background task
 All tests can be optimized if the memory
architecture is known
Restricted © 2017 Mentor Graphics Corporation
Moving Ones Test
set every bit of memory to 0
for each bit of memory
{
verify that all bits are 0
set the bit under test to 1
verify that it is 1
verify all other bits are 0
set the bit under test to 0
}
Restricted © 2017 Mentor Graphics Corporation
Memory Testing
 “Moving Ones” test
— Looks for stuck bits and cross talk with fine grain resolution
— Perform on start up
— Code to only use registers
— “Moving Zeros” is the same idea
 Pattern test
— Also looks for stuck bits and cross talk
— Perform in background task
 All tests can be optimized if the memory
architecture is known
Restricted © 2017 Mentor Graphics Corporation
Pattern Test
for each byte of memory
{
turn off interrupts
save memory byte contents
for values 0x00, 0xff, 0xaa, 0x55
{
write value to byte under test
verify value of byte
}
restore byte data
turn on interrupts
}
Restricted © 2017 Mentor Graphics Corporation
Memory Testing
 “Moving Ones” test
— Looks for stuck bits and cross talk with fine grain resolution
— Perform on start up
— Code to only use registers
— “Moving Zeros” is the same idea
 Pattern test
— Also looks for stuck bits and cross talk
— Perform in background task
 All tests can be optimized if the memory architecture is known
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Software Error Conditions
 Bugs can lead to unpredictable failure
 Defensive code can anticipate problems
 2 key failure modes:
— Data corruption
— Code looping
Restricted © 2017 Mentor Graphics Corporation
Data Corruption
 Pointers!
 Null pointer
— Trap handler
 Incorrect pointer
— May point anywhere
— Leads to random corruption
— MMU may help
— Special cases
– Stack overflow/underflow
– Array bound violations
Restricted © 2017 Mentor Graphics Corporation
Stack Overflow/Underflow
 Avoid by careful testing
— Use memory access breakpoints during
debug
— Unexpected recursion depth is hard to
predict
 Use guard words
— Test periodically
– Background task?
— Choose odd value to avoid addresses
— Use unlikely value
– Not 0, 1, 0xffffffff
— 4 billion to 1 chance of a false alarm
— Might use MMU
Restricted © 2017 Mentor Graphics Corporation
Stack Overflow/Underflow
0x16951695
0x16951695
 Avoid by careful testing
— Use memory access breakpoints during
debug
— Unexpected recursion depth is hard to
predict
 Use guard words
— Test periodically
– Background task?
— Choose odd value to avoid addresses
— Use unlikely value
– Not 0, 1, 0xffffffff
— 4 billion to 1 chance of a false alarm
— Might use MMU
Restricted © 2017 Mentor Graphics Corporation
Stack Overflow/Underflow
0x00000000
0xffffffff
0x00000000
0x00000000
0x99000000
0x00000000
0x00000000
0x00000000
0x12341234
0x16951695
0x16951695
 Avoid by careful testing
— Use memory access breakpoints during
debug
— Unexpected recursion depth is hard to
predict
 Use guard words
— Test periodically
– Background task?
— Choose odd value to avoid addresses
— Use unlikely value
– Not 0, 1, 0xffffffff
— 4 billion to 1 chance of a false alarm
— Might use MMU
Restricted © 2017 Mentor Graphics Corporation
Stack Overflow/Underflow
0x16951695
0x16951695
0x77770000
0x00000000
0xffffffff
0x00000000
0x00000000
0x99000000
0x00000000
0x00000000
0x00000000
0x12341234
 Avoid by careful testing
— Use memory access breakpoints during
debug
— Unexpected recursion depth is hard to
predict
 Use guard words
— Test periodically
– Background task?
— Choose odd value to avoid addresses
— Use unlikely value
– Not 0, 1, 0xffffffff
— 4 billion to 1 chance of a false alarm
— Might use MMU
Restricted © 2017 Mentor Graphics Corporation
Array Bound Violations
 No checking in C
— Considered a runtime overhead
— Could add in C++
– Overload the [ ] operator
— Pointers can get around bounding
 Using guard words makes sense
— Most programming errors result in writing
to memory immediately adjacent to the
end of the array
Restricted © 2017 Mentor Graphics Corporation
Code Looping
 Infinite loops should not occur
 May be a programming error
 May be a device failing to respond
— Software should have timeout
 Hardware watchdog helpful
 In multi-threaded environment, use a watchdog task
— Event flag for each task
— Watchdog sets flags to 1 and goes to sleep
— Other tasks periodically set their flag to 0
— When watchdog wakes, any 1 flags result in alarm
Restricted © 2017 Mentor Graphics Corporation
Using a Watchdog Task
Task 1 Task 2 Task 3
Watchdog
Task
1 1 1
Restricted © 2017 Mentor Graphics Corporation
Using a Watchdog Task
Task 1 Task 2 Task 3
Watchdog
Task
1 1 10 0
Restricted © 2017 Mentor Graphics Corporation
Using a Watchdog Task
Task 1 Task 2 Task 3
Watchdog
Task
1 1 10 0
Watchdog
Task
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Failure Reporting and Recovery
 Action on finding a fault is very system
dependent
 If there is a user interface, an alarm may
be activated
 A deeply embedded system may have no
option other than a reset
 Example: heart pacemaker
Restricted © 2017 Mentor Graphics Corporation
Sounding the Alarm
 Display
— Text/graphics
 Sound
 Network
— Send email
— Web page
 LEDs
— On/Off
— Color
— Flashing
Restricted © 2017 Mentor Graphics Corporation
Flashing LEDs
 Speed
— Slow – “heartbeat”
— Fast – “error”
 Duty cycle
— Morse code?
LONG = 500
SHORT = 50
flash_delay = LONG
LED_state = 0
loop-forever
{
flags = 0xff
sleep(flash_delay)
set_LED(LED_state)
if LED_state = 0
LED_state = 1
else
LED_state = 0
if flags <> 0
flash_delay = SHORT
}
Restricted © 2017 Mentor Graphics Corporation
Reset
 Automatic reset is sometimes the only option
— Deeply embedded systems with no UI
— Maybe log for later reference
 User input
— Reset button may be reassuring
— Multi-key sequences not intuitive or reliable
Restricted © 2017 Mentor Graphics Corporation
Agenda
Introduction
CPU Failure
Peripheral Failure
Memory Failure
Software Error Conditions
Failure Recovery and Reporting
Conclusions
Restricted © 2017 Mentor Graphics Corporation
Conclusions
 First rule is accept that failure is possible
 Consider all possible failure modes
 Add code to monitor system “health”
 Consider action on failure
— Warn
— Fix
Colin Walls
Thank you
colin_walls@mentor.com
http://blogs.mentor.com/colinwalls

More Related Content

Similar to 4 colin walls - self-testing in embedded systems

Back to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentBack to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentMongoDB
 
System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Applicationedavid2685
 
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Spark Summit
 
Run MongoDB with Confidence Using MongoDB Management Service (MMS)
Run MongoDB with Confidence Using MongoDB Management Service (MMS)Run MongoDB with Confidence Using MongoDB Management Service (MMS)
Run MongoDB with Confidence Using MongoDB Management Service (MMS)MongoDB
 
Top10 list planningpostgresdeployment.2014
Top10 list planningpostgresdeployment.2014Top10 list planningpostgresdeployment.2014
Top10 list planningpostgresdeployment.2014EDB
 
Why Software Test Performance Matters
Why Software Test Performance MattersWhy Software Test Performance Matters
Why Software Test Performance MattersSolano Labs
 
Open source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packagesOpen source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packagesRogue Wave Software
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSMongoDB
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningjClarity
 
How to not fail at security data analytics (by CxOSidekick)
How to not fail at security data analytics (by CxOSidekick)How to not fail at security data analytics (by CxOSidekick)
How to not fail at security data analytics (by CxOSidekick)Dinis Cruz
 
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Rogue Wave Software
 
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...MongoDB
 
Cyber security - It starts with the embedded system
Cyber security - It starts with the embedded systemCyber security - It starts with the embedded system
Cyber security - It starts with the embedded systemRogue Wave Software
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelDaniel Coupal
 
MongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMSMongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMSMongoDB
 
Automate MongoDB with MongoDB Management Service
Automate MongoDB with MongoDB Management ServiceAutomate MongoDB with MongoDB Management Service
Automate MongoDB with MongoDB Management ServiceMongoDB
 
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016Jon Milsom
 
DevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesDevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesAlex Cruise
 
Final presentasi gnome asia
Final presentasi gnome asiaFinal presentasi gnome asia
Final presentasi gnome asiaAnton Siswo
 
Presentation confoo optimization_sherifzaroubi
Presentation confoo optimization_sherifzaroubiPresentation confoo optimization_sherifzaroubi
Presentation confoo optimization_sherifzaroubiValtech Canada
 

Similar to 4 colin walls - self-testing in embedded systems (20)

Back to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentBack to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production Deployment
 
System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Application
 
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
Clipper: A Low-Latency Online Prediction Serving System: Spark Summit East ta...
 
Run MongoDB with Confidence Using MongoDB Management Service (MMS)
Run MongoDB with Confidence Using MongoDB Management Service (MMS)Run MongoDB with Confidence Using MongoDB Management Service (MMS)
Run MongoDB with Confidence Using MongoDB Management Service (MMS)
 
Top10 list planningpostgresdeployment.2014
Top10 list planningpostgresdeployment.2014Top10 list planningpostgresdeployment.2014
Top10 list planningpostgresdeployment.2014
 
Why Software Test Performance Matters
Why Software Test Performance MattersWhy Software Test Performance Matters
Why Software Test Performance Matters
 
Open source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packagesOpen source: Top issues in the top enterprise packages
Open source: Top issues in the top enterprise packages
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMS
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
How to not fail at security data analytics (by CxOSidekick)
How to not fail at security data analytics (by CxOSidekick)How to not fail at security data analytics (by CxOSidekick)
How to not fail at security data analytics (by CxOSidekick)
 
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
 
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
 
Cyber security - It starts with the embedded system
Cyber security - It starts with the embedded systemCyber security - It starts with the embedded system
Cyber security - It starts with the embedded system
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
 
MongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMSMongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMS
 
Automate MongoDB with MongoDB Management Service
Automate MongoDB with MongoDB Management ServiceAutomate MongoDB with MongoDB Management Service
Automate MongoDB with MongoDB Management Service
 
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
 
DevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesDevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 Slides
 
Final presentasi gnome asia
Final presentasi gnome asiaFinal presentasi gnome asia
Final presentasi gnome asia
 
Presentation confoo optimization_sherifzaroubi
Presentation confoo optimization_sherifzaroubiPresentation confoo optimization_sherifzaroubi
Presentation confoo optimization_sherifzaroubi
 

More from Ievgenii Katsan

8 andrew kalyuzhin - 30 ux-advices, that will make users love you
8   andrew kalyuzhin - 30 ux-advices, that will make users love you8   andrew kalyuzhin - 30 ux-advices, that will make users love you
8 andrew kalyuzhin - 30 ux-advices, that will make users love youIevgenii Katsan
 
5 hans van loenhoud - master-class the 7 skills of highly successful teams
5   hans van loenhoud - master-class the 7 skills of highly successful teams5   hans van loenhoud - master-class the 7 skills of highly successful teams
5 hans van loenhoud - master-class the 7 skills of highly successful teamsIevgenii Katsan
 
4 alexey orlov - life of product in startup and enterprise
4   alexey orlov - life of product in startup and enterprise4   alexey orlov - life of product in startup and enterprise
4 alexey orlov - life of product in startup and enterpriseIevgenii Katsan
 
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
3   dmitry gomeniuk - how to make data-driven decisions in saa s products3   dmitry gomeniuk - how to make data-driven decisions in saa s products
3 dmitry gomeniuk - how to make data-driven decisions in saa s productsIevgenii Katsan
 
7 hans van loenhoud - the problem-goal-solution trinity
7   hans van loenhoud - the problem-goal-solution trinity7   hans van loenhoud - the problem-goal-solution trinity
7 hans van loenhoud - the problem-goal-solution trinityIevgenii Katsan
 
3 denys gobov - change request specification the knowledge base or the task...
3   denys gobov - change request specification the knowledge base or the task...3   denys gobov - change request specification the knowledge base or the task...
3 denys gobov - change request specification the knowledge base or the task...Ievgenii Katsan
 
5 victoria cupet - learn to play business analysis
5   victoria cupet - learn to play business analysis5   victoria cupet - learn to play business analysis
5 victoria cupet - learn to play business analysisIevgenii Katsan
 
5 alina petrenko - key requirements elicitation during the first contact wi...
5   alina petrenko - key requirements elicitation during the first contact wi...5   alina petrenko - key requirements elicitation during the first contact wi...
5 alina petrenko - key requirements elicitation during the first contact wi...Ievgenii Katsan
 
3 karabak kuyavets transformation of business analyst to product owner
3   karabak kuyavets transformation of business analyst to product owner3   karabak kuyavets transformation of business analyst to product owner
3 karabak kuyavets transformation of business analyst to product ownerIevgenii Katsan
 
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...Ievgenii Katsan
 
3 zornitsa nikolova - the product manager between decision making and facil...
3   zornitsa nikolova - the product manager between decision making and facil...3   zornitsa nikolova - the product manager between decision making and facil...
3 zornitsa nikolova - the product manager between decision making and facil...Ievgenii Katsan
 
4 viktoriya gudym - how to effectively manage remote employees
4   viktoriya gudym - how to effectively manage remote employees4   viktoriya gudym - how to effectively manage remote employees
4 viktoriya gudym - how to effectively manage remote employeesIevgenii Katsan
 
9 natali renska - product and outsource development, how to cook 2 meals in...
9   natali renska - product and outsource development, how to cook 2 meals in...9   natali renska - product and outsource development, how to cook 2 meals in...
9 natali renska - product and outsource development, how to cook 2 meals in...Ievgenii Katsan
 
7 denis parkhomenko - from idea to execution how to make a product that cus...
7   denis parkhomenko - from idea to execution how to make a product that cus...7   denis parkhomenko - from idea to execution how to make a product that cus...
7 denis parkhomenko - from idea to execution how to make a product that cus...Ievgenii Katsan
 
6 anton vitiaz - inside the mvp in 3 days
6   anton vitiaz - inside the mvp in 3 days6   anton vitiaz - inside the mvp in 3 days
6 anton vitiaz - inside the mvp in 3 daysIevgenii Katsan
 
5 mariya popova - ideal product management. unicorns in our reality
5   mariya popova - ideal product management. unicorns in our reality5   mariya popova - ideal product management. unicorns in our reality
5 mariya popova - ideal product management. unicorns in our realityIevgenii Katsan
 
2 victor podzubanov - design thinking game
2   victor podzubanov - design thinking game2   victor podzubanov - design thinking game
2 victor podzubanov - design thinking gameIevgenii Katsan
 
3 sergiy potapov - analyst to product owner
3   sergiy potapov - analyst to product owner3   sergiy potapov - analyst to product owner
3 sergiy potapov - analyst to product ownerIevgenii Katsan
 
4 anton parkhomenko - how to make effective user research with no budget at...
4   anton parkhomenko - how to make effective user research with no budget at...4   anton parkhomenko - how to make effective user research with no budget at...
4 anton parkhomenko - how to make effective user research with no budget at...Ievgenii Katsan
 

More from Ievgenii Katsan (20)

8 andrew kalyuzhin - 30 ux-advices, that will make users love you
8   andrew kalyuzhin - 30 ux-advices, that will make users love you8   andrew kalyuzhin - 30 ux-advices, that will make users love you
8 andrew kalyuzhin - 30 ux-advices, that will make users love you
 
5 hans van loenhoud - master-class the 7 skills of highly successful teams
5   hans van loenhoud - master-class the 7 skills of highly successful teams5   hans van loenhoud - master-class the 7 skills of highly successful teams
5 hans van loenhoud - master-class the 7 skills of highly successful teams
 
4 alexey orlov - life of product in startup and enterprise
4   alexey orlov - life of product in startup and enterprise4   alexey orlov - life of product in startup and enterprise
4 alexey orlov - life of product in startup and enterprise
 
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
3   dmitry gomeniuk - how to make data-driven decisions in saa s products3   dmitry gomeniuk - how to make data-driven decisions in saa s products
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
 
7 hans van loenhoud - the problem-goal-solution trinity
7   hans van loenhoud - the problem-goal-solution trinity7   hans van loenhoud - the problem-goal-solution trinity
7 hans van loenhoud - the problem-goal-solution trinity
 
1 hans van loenhoud -
1   hans van loenhoud - 1   hans van loenhoud -
1 hans van loenhoud -
 
3 denys gobov - change request specification the knowledge base or the task...
3   denys gobov - change request specification the knowledge base or the task...3   denys gobov - change request specification the knowledge base or the task...
3 denys gobov - change request specification the knowledge base or the task...
 
5 victoria cupet - learn to play business analysis
5   victoria cupet - learn to play business analysis5   victoria cupet - learn to play business analysis
5 victoria cupet - learn to play business analysis
 
5 alina petrenko - key requirements elicitation during the first contact wi...
5   alina petrenko - key requirements elicitation during the first contact wi...5   alina petrenko - key requirements elicitation during the first contact wi...
5 alina petrenko - key requirements elicitation during the first contact wi...
 
3 karabak kuyavets transformation of business analyst to product owner
3   karabak kuyavets transformation of business analyst to product owner3   karabak kuyavets transformation of business analyst to product owner
3 karabak kuyavets transformation of business analyst to product owner
 
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
 
3 zornitsa nikolova - the product manager between decision making and facil...
3   zornitsa nikolova - the product manager between decision making and facil...3   zornitsa nikolova - the product manager between decision making and facil...
3 zornitsa nikolova - the product manager between decision making and facil...
 
4 viktoriya gudym - how to effectively manage remote employees
4   viktoriya gudym - how to effectively manage remote employees4   viktoriya gudym - how to effectively manage remote employees
4 viktoriya gudym - how to effectively manage remote employees
 
9 natali renska - product and outsource development, how to cook 2 meals in...
9   natali renska - product and outsource development, how to cook 2 meals in...9   natali renska - product and outsource development, how to cook 2 meals in...
9 natali renska - product and outsource development, how to cook 2 meals in...
 
7 denis parkhomenko - from idea to execution how to make a product that cus...
7   denis parkhomenko - from idea to execution how to make a product that cus...7   denis parkhomenko - from idea to execution how to make a product that cus...
7 denis parkhomenko - from idea to execution how to make a product that cus...
 
6 anton vitiaz - inside the mvp in 3 days
6   anton vitiaz - inside the mvp in 3 days6   anton vitiaz - inside the mvp in 3 days
6 anton vitiaz - inside the mvp in 3 days
 
5 mariya popova - ideal product management. unicorns in our reality
5   mariya popova - ideal product management. unicorns in our reality5   mariya popova - ideal product management. unicorns in our reality
5 mariya popova - ideal product management. unicorns in our reality
 
2 victor podzubanov - design thinking game
2   victor podzubanov - design thinking game2   victor podzubanov - design thinking game
2 victor podzubanov - design thinking game
 
3 sergiy potapov - analyst to product owner
3   sergiy potapov - analyst to product owner3   sergiy potapov - analyst to product owner
3 sergiy potapov - analyst to product owner
 
4 anton parkhomenko - how to make effective user research with no budget at...
4   anton parkhomenko - how to make effective user research with no budget at...4   anton parkhomenko - how to make effective user research with no budget at...
4 anton parkhomenko - how to make effective user research with no budget at...
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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?
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

4 colin walls - self-testing in embedded systems

  • 1. Colin Walls Self-Testing in Embedded Systems colin_walls@mentor.com http://blogs.mentor.com/colinwalls
  • 2. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 3. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 4. Restricted © 2017 Mentor Graphics Corporation Introduction  Failure is almost inevitable  Important to accept this fact  Key issues: — How to reduce likelihood of failure — How to handle impending failure — How to recover from failure conditions
  • 5. Restricted © 2017 Mentor Graphics Corporation Failure and Testing  What can fail in an embedded system? — CPU — Peripherals — Memory — Software  Start-up testing  Background testing  Watchdog
  • 6. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 7. Restricted © 2017 Mentor Graphics Corporation CPU Failure  Quite unlikely for just processor to fail  Possibly no hope of recovery  Failure most likely at power up  Partial failure very rare  Multicore designs offer options
  • 8. Restricted © 2017 Mentor Graphics Corporation CPU Failure  Quite unlikely for just processor to fail  Possibly no hope of recovery  Failure most likely at power up  Partial failure very rare  Multicore designs offer options
  • 9. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 10. Restricted © 2017 Mentor Graphics Corporation Peripheral Failure  Total failure: not responding to address — Trap handler  Other failures/tests are device dependent  Loop back testing is common
  • 11. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 12. Restricted © 2017 Mentor Graphics Corporation Memory Failure  Systems have a lot of memory — Surprising that failure is not more common  Failure most likely at power up — That is the time for comprehensive testing  3 failure modes: — Not responding — Stuck bits — Cross-talk
  • 13. Restricted © 2017 Mentor Graphics Corporation Memory Testing  “Moving Ones” test — Looks for stuck bits and cross talk with fine grain resolution — Perform on start up — Code to only use registers — “Moving Zeros” is the same idea  Pattern test — Also looks for stuck bits and cross talk — Perform in background task  All tests can be optimized if the memory architecture is known
  • 14. Restricted © 2017 Mentor Graphics Corporation Moving Ones Test set every bit of memory to 0 for each bit of memory { verify that all bits are 0 set the bit under test to 1 verify that it is 1 verify all other bits are 0 set the bit under test to 0 }
  • 15. Restricted © 2017 Mentor Graphics Corporation Memory Testing  “Moving Ones” test — Looks for stuck bits and cross talk with fine grain resolution — Perform on start up — Code to only use registers — “Moving Zeros” is the same idea  Pattern test — Also looks for stuck bits and cross talk — Perform in background task  All tests can be optimized if the memory architecture is known
  • 16. Restricted © 2017 Mentor Graphics Corporation Pattern Test for each byte of memory { turn off interrupts save memory byte contents for values 0x00, 0xff, 0xaa, 0x55 { write value to byte under test verify value of byte } restore byte data turn on interrupts }
  • 17. Restricted © 2017 Mentor Graphics Corporation Memory Testing  “Moving Ones” test — Looks for stuck bits and cross talk with fine grain resolution — Perform on start up — Code to only use registers — “Moving Zeros” is the same idea  Pattern test — Also looks for stuck bits and cross talk — Perform in background task  All tests can be optimized if the memory architecture is known
  • 18. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 19. Restricted © 2017 Mentor Graphics Corporation Software Error Conditions  Bugs can lead to unpredictable failure  Defensive code can anticipate problems  2 key failure modes: — Data corruption — Code looping
  • 20. Restricted © 2017 Mentor Graphics Corporation Data Corruption  Pointers!  Null pointer — Trap handler  Incorrect pointer — May point anywhere — Leads to random corruption — MMU may help — Special cases – Stack overflow/underflow – Array bound violations
  • 21. Restricted © 2017 Mentor Graphics Corporation Stack Overflow/Underflow  Avoid by careful testing — Use memory access breakpoints during debug — Unexpected recursion depth is hard to predict  Use guard words — Test periodically – Background task? — Choose odd value to avoid addresses — Use unlikely value – Not 0, 1, 0xffffffff — 4 billion to 1 chance of a false alarm — Might use MMU
  • 22. Restricted © 2017 Mentor Graphics Corporation Stack Overflow/Underflow 0x16951695 0x16951695  Avoid by careful testing — Use memory access breakpoints during debug — Unexpected recursion depth is hard to predict  Use guard words — Test periodically – Background task? — Choose odd value to avoid addresses — Use unlikely value – Not 0, 1, 0xffffffff — 4 billion to 1 chance of a false alarm — Might use MMU
  • 23. Restricted © 2017 Mentor Graphics Corporation Stack Overflow/Underflow 0x00000000 0xffffffff 0x00000000 0x00000000 0x99000000 0x00000000 0x00000000 0x00000000 0x12341234 0x16951695 0x16951695  Avoid by careful testing — Use memory access breakpoints during debug — Unexpected recursion depth is hard to predict  Use guard words — Test periodically – Background task? — Choose odd value to avoid addresses — Use unlikely value – Not 0, 1, 0xffffffff — 4 billion to 1 chance of a false alarm — Might use MMU
  • 24. Restricted © 2017 Mentor Graphics Corporation Stack Overflow/Underflow 0x16951695 0x16951695 0x77770000 0x00000000 0xffffffff 0x00000000 0x00000000 0x99000000 0x00000000 0x00000000 0x00000000 0x12341234  Avoid by careful testing — Use memory access breakpoints during debug — Unexpected recursion depth is hard to predict  Use guard words — Test periodically – Background task? — Choose odd value to avoid addresses — Use unlikely value – Not 0, 1, 0xffffffff — 4 billion to 1 chance of a false alarm — Might use MMU
  • 25. Restricted © 2017 Mentor Graphics Corporation Array Bound Violations  No checking in C — Considered a runtime overhead — Could add in C++ – Overload the [ ] operator — Pointers can get around bounding  Using guard words makes sense — Most programming errors result in writing to memory immediately adjacent to the end of the array
  • 26. Restricted © 2017 Mentor Graphics Corporation Code Looping  Infinite loops should not occur  May be a programming error  May be a device failing to respond — Software should have timeout  Hardware watchdog helpful  In multi-threaded environment, use a watchdog task — Event flag for each task — Watchdog sets flags to 1 and goes to sleep — Other tasks periodically set their flag to 0 — When watchdog wakes, any 1 flags result in alarm
  • 27. Restricted © 2017 Mentor Graphics Corporation Using a Watchdog Task Task 1 Task 2 Task 3 Watchdog Task 1 1 1
  • 28. Restricted © 2017 Mentor Graphics Corporation Using a Watchdog Task Task 1 Task 2 Task 3 Watchdog Task 1 1 10 0
  • 29. Restricted © 2017 Mentor Graphics Corporation Using a Watchdog Task Task 1 Task 2 Task 3 Watchdog Task 1 1 10 0 Watchdog Task
  • 30. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 31. Restricted © 2017 Mentor Graphics Corporation Failure Reporting and Recovery  Action on finding a fault is very system dependent  If there is a user interface, an alarm may be activated  A deeply embedded system may have no option other than a reset  Example: heart pacemaker
  • 32. Restricted © 2017 Mentor Graphics Corporation Sounding the Alarm  Display — Text/graphics  Sound  Network — Send email — Web page  LEDs — On/Off — Color — Flashing
  • 33. Restricted © 2017 Mentor Graphics Corporation Flashing LEDs  Speed — Slow – “heartbeat” — Fast – “error”  Duty cycle — Morse code? LONG = 500 SHORT = 50 flash_delay = LONG LED_state = 0 loop-forever { flags = 0xff sleep(flash_delay) set_LED(LED_state) if LED_state = 0 LED_state = 1 else LED_state = 0 if flags <> 0 flash_delay = SHORT }
  • 34. Restricted © 2017 Mentor Graphics Corporation Reset  Automatic reset is sometimes the only option — Deeply embedded systems with no UI — Maybe log for later reference  User input — Reset button may be reassuring — Multi-key sequences not intuitive or reliable
  • 35. Restricted © 2017 Mentor Graphics Corporation Agenda Introduction CPU Failure Peripheral Failure Memory Failure Software Error Conditions Failure Recovery and Reporting Conclusions
  • 36. Restricted © 2017 Mentor Graphics Corporation Conclusions  First rule is accept that failure is possible  Consider all possible failure modes  Add code to monitor system “health”  Consider action on failure — Warn — Fix