Embedded Systems Design - July 2008 - (Page 40) 20 years ago Listing 1, continued from page 39. stk->reg_ds, stk->reg_si, stk->reg_di ); lngth += sprintf( &sys_crsh_pntr[ lngth ], sys_crsh_rpt[ 6 ], stk->reg_bp, ((stk_addr & 0xFFFF0000) >> 16), (stk_addr & 0x0000FFFF), stk->reg_psw ); lngth += sprintf( &sys_crsh_pntr[ lngth ], sys_crsh_rpt[ 7 ] ); lngth += sprintf( &sys_crsh_pntr[ lngth ], sys_crsh_rpt[ 8 ], stk->ret_segment, stk->ret_offset ); lngth += sprintf( &sys_crsh_pntr[ lngth ], sys_crsh_rpt[ 9 ] ); lngth += sprintf( &sys_crsh_pntr[ lngth ], sys_crsh_rpt[ 10 ] ); lngth += sprintf( &sys_crsh_pntr[ lngth ], sys_crsh_rpt[ 11 ] ); /*== Format stack into six rows of eight words. ==*/ for( indx = 0; indx > 16), (stk_addr & 0X0000FFFF), *stk_pntr++, *stk_pntr++, *stk_pntr++, *stk_pntr++, *stk_pntr++, *stk_pntr++, *stk_pntr++, *stk_pntr++ ); } } /*======================= End File ======================*/ The crash report illustrated here provides a great deal of information to the system implementer. It displays the crash and error codes, allowing the implementer to check the central crash file for the mnemonic of the crash code and locate the line of source code in which the exception occurred. The error parameter can then be used to determine the cause of the error. The register and stack information is useful in tracing the history of the problem; if the system is implemented in a high-level language, many of the parameters used are passed or stored on the stack. More important than this information is the fact that the system halted in a controlled fashion. The application decided that an ‘unrecoverable fault condition existed and raised the exception; the crash report was printed and system execution halted. Without a methodology of this kind, a fault might not cause a system halt until subsequent actions have been taken—actions that may alter or destroy critical information needed to isolate the cause of the fault. In production mode, where the system can’t be frozen, the crash report may be stored for later use and the system automatically restarted. Crash reports provide a history of system errors that can point up consistencies and patterns. ADVANCED HANDLING The exception handler described here either halts the system upon detection of a fault or records the exception parameters and restarts the system. This is sufficient from a development and testing perspective but doesn’t handle all the situations that may arise. For example, some systems can’t tolerate a complete restart; they enter a “limp-along” mode in which they partially recover from the fault without disrupting operation entirely. And some exceptions may not be fatal-the system merely notes them and continues processing. In this case, the exception may need a priority associated with it. High-priority exceptions may require the system to be halted or restarted, while those of low priority are simply logged. Exception report. SOFTWARE FAULT WED Apr 12 19:06 18 1989 Crash Code: 0005 Error Code: 000A AX = 0004 BX = 3839 CX = 2065 DX = 6874 ES = 6854 DS = 7369 SI = 2073 DI = 6920 BP = 7365 SS = 0188 SP = 0014 PSW = 0420 Called From 0047:2074 Stack Contents: 0188:0014 3637 3839 0188:0024 7261 7473 0188:0034 0000 0AA7 0188:0044 0000 1234 0188:0054 0000 0000 0188:0064 2045 5241 Figure 1 2065 2079 0000 0000 0000 5754 6874 6172 0987 1356 0000 464F 2073 0047 0188 0000 0000 5320 6920 2074 0014 9876 0987 2020 7369 0005 0000 0000 0000 2000 6854 000A 0A74 0000 0987 0A0A 40 JULY 2008 | embedded systems design | www.embedded.com http://www.embedded.com
Table of Contents Feed for the Digital Edition of Embedded Systems Design - July 2008 Embedded Systems Design - July 2008 Contents #Include Parity Bit Programming Pointers Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design Building a Power Supply for Discontinuous Transmission Wireless Networks An Exception Primer Advertising Index Break Points Marketplace Embedded Systems Design - July 2008 Embedded Systems Design - July 2008 - Embedded Systems Design - July 2008 (Page Cover1) Embedded Systems Design - July 2008 - Embedded Systems Design - July 2008 (Page Cover2) Embedded Systems Design - July 2008 - Embedded Systems Design - July 2008 (Page 1) Embedded Systems Design - July 2008 - Embedded Systems Design - July 2008 (Page 2) Embedded Systems Design - July 2008 - Contents (Page 3) Embedded Systems Design - July 2008 - Contents (Page 4) Embedded Systems Design - July 2008 - Contents (Page 5) Embedded Systems Design - July 2008 - Contents (Page 6) Embedded Systems Design - July 2008 - #Include (Page 7) Embedded Systems Design - July 2008 - #Include (Page 8) Embedded Systems Design - July 2008 - Parity Bit (Page 9) Embedded Systems Design - July 2008 - Programming Pointers (Page 10) Embedded Systems Design - July 2008 - Programming Pointers (Page 11) Embedded Systems Design - July 2008 - Programming Pointers (Page 12) Embedded Systems Design - July 2008 - Programming Pointers (Page 13) Embedded Systems Design - July 2008 - Programming Pointers (Page 14) Embedded Systems Design - July 2008 - Programming Pointers (Page 15) Embedded Systems Design - July 2008 - Programming Pointers (Page 16) Embedded Systems Design - July 2008 - Programming Pointers (Page 17) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 18) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 19) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 20) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 21) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 22) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 23) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 24) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 25) Embedded Systems Design - July 2008 - Interactive C-code Cleaning Tool Supports Multiprocessor SoC Design (Page 26) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 27) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 28) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 29) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 30) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 31) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 32) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 33) Embedded Systems Design - July 2008 - Building a Power Supply for Discontinuous Transmission Wireless Networks (Page 34) Embedded Systems Design - July 2008 - An Exception Primer (Page 35) Embedded Systems Design - July 2008 - An Exception Primer (Page 36) Embedded Systems Design - July 2008 - An Exception Primer (Page 37) Embedded Systems Design - July 2008 - An Exception Primer (Page 38) Embedded Systems Design - July 2008 - An Exception Primer (Page 39) Embedded Systems Design - July 2008 - An Exception Primer (Page 40) Embedded Systems Design - July 2008 - An Exception Primer (Page 41) Embedded Systems Design - July 2008 - An Exception Primer (Page 42) Embedded Systems Design - July 2008 - An Exception Primer (Page 43) Embedded Systems Design - July 2008 - Advertising Index (Page 44) Embedded Systems Design - July 2008 - Break Points (Page 45) Embedded Systems Design - July 2008 - Break Points (Page 46) Embedded Systems Design - July 2008 - Marketplace (Page 47) Embedded Systems Design - July 2008 - Marketplace (Page 48) Embedded Systems Design - July 2008 - Marketplace (Page Cover3) Embedded Systems Design - July 2008 - Marketplace (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.