230 likes | 247 Vues
SE-3910 Real-time Systems. Week 5, Class 1 Quick-Quiz (Ungraded) Lab 4 turn-in up - due Tuesday, Week 5 Select when to use Polling or Interrupts Describe the interrupt handling process Use conditional compilation to remove code from compiling.
E N D
SE-3910Real-time Systems • Week 5, Class 1 • Quick-Quiz (Ungraded) • Lab 4 turn-in up - due Tuesday, Week 5 • Select when to use Polling or Interrupts • Describe the interrupt handling process • Use conditional compilation to remove code from compiling SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling, Some from Dr. Hornick, etc.
Quick Quiz! What is the rise-time of this signal? 5V 0 16ms 10ms 13ms SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling
Quick Quiz! Which of the following is correct? void foo(struct bar2* b); … struct bar* b; And then…. • foo((struct bar2*) b*) • foo((bar2*) *b) • foo((bar2*) b&) • foo((struct bar2*) &b) SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling
When to Poll vs. Interrupt? • Polling • Advantages • Lower latency (if 100% CPU) • Disadvantages • High CPU • Low Punctuality • Interrupts • Disadvantages • Context switch cost • Advantages • Low CPU • Higher Punctuality SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling
Potential Problems • What happens if an unexpected interrupt occurs and we have random garbage in the interrupt table? • What happens if an interrupt handler doesn’t return? SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling
The Clementine In 1994, a deep space probe, the Clementine, was launched to make observations of the moon and a large asteroid (1620 Geographos). After months of operation, a software exception caused a control thruster to fire for 11 minutes, which depleted most of the remaining fuel and caused the probe to rotate at 80 RPM. Control was eventually regained, but it was too late to successfully complete the mission. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Why use a watchdog timer? • Embedded systems must be able to cope with both hardware and software anomalies to be truly robust. • In many cases, embedded devices operate in total isolation and are not accessible to an operator. • Manually resetting a device in this scenario when its software “hangs” is not possible. • In extreme cases, this can result in damaged hardware or loss of life and incur significant cost impact. Watchdog Timers
Watchdog Timer Structure SE3910 Real Time Systems
Watchdog On the Beaglebone • http://beaglebone.cameon.net/home/watchdog-timer • Open the file /dev/watchdog • Do not close the file • Write something (e.g. "\n") to the file at least every 59 seconds to keep the system running SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling
Conditional Compilation • #define DEBUG • #ifdef DEBUG • #endif • #define LEVEL 5 • #if LEVEL > 0 • #endif SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling