Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Payam Soltany
07/04/05 21:41
Read: 5144 times
Tehran
Iran


 
Msg Score: +1
 +1 Informative
#96569 - disciplined clear process for debugging
I summarized Parivallal Kannan's presentation at University of Texas and Jack Ganssle's articles on debugging to be used as a "disciplined clear process we should follow for debugging and troubleshooting" as said by Jack Ganssle. Your corrections are most welcomed.

1. Power
- Check power and gnd connectivity on all Ics and discretes
- Check Vcc with a scope, not a meter
2. Clock
- Check clock connectivity
- Is the oscillator running: X2 pin should be toggling
3. Processor
- Is the processor is out of RESET: Reset pin should be low
– Activity on continuously active signals:
ALE: ALE would be about 1.7 volts, same true for HC573's clock pin
AD[] (LSBs are best)
A[] (LSBs are best)
RD
WR
4. Memory
– Address and data lines: Are bus lines shorted together? Probe all address and data lines
- Chip-selects
5. Peripherals
– All ICs – Chip selects, WR and RD
6. Transceivers' voltage levels OK?
– MAX232s, transducers etc
7. HOST settings
– Port settings (COM, LPT), etc
8. Chips in their sockets
- It's common for a pin to bend under the chip and appear to go into the socket
9. Not done yet ?
– Timing analysis (data sheets, LA etc)
– Analyze data transfers (LA)
10. Control registers
- Should be correctly initialized/programmed
11. ISRs
- Make sure you are protecting all your registers.
- Make sure you restore protected values: The same number of values in the reverse orer.
- Use RETI not RET: Otherwise your interrupt will only be executed once and mysteriously stops executing
- Enable only one interrupt at a time, and even if it seems to work spend a few minutes checking its operation. This is a lot faster than searching for the cause of some weird problem later when a dozen interrupts are flying around.
- Does the stack balance: the stack just after the ISR return must be identical to the stack just before it

Debugging algorithm
1. Observe the behavior to find the bug(Determine the bug's symptoms)
2. Gain as much information as possible about it
3. Think about possible “reasons” that can cause the problem seen(Round up the usual suspects)
4. Generate a hypothesis based on cause and effect
5. Generate an experiment to test the hypothesis(what’s wrong and why)
6. Fix the bug(Not a quick and dirty fix)
7. Provide proof that the change really fixed the problem(Not merely because the symptom has disappeared)
8. Look for way to find any similar problems.

Misc. Notes
. Stay focused on a single problem at a time.
. Zealot's regard for the scientific method
. Iterative loop of focus, hypothesis, and experiment.
. Never figure anything is working right until proven by repeated experiment
. Problems that mysteriously go away tend to mysteriously come back unless you can prove that the change really fixed the problem
. There is no cosmic conspiracy against you !
. Most problems have simple causes and solutions
. Know the electrical properties of the components in your system: Absolute maximum ratings of currents and voltages; Maximum frequency of operation; ESD
. Analytical thinking: Think about possible “reasons” that can cause the problem seen; Check the input to the system – your design and its schematics (remember GIGO)
. Problem domain identification: Eliminate hardware issues. Then it’s the software’s turn


List of 105 messages in thread
TopicAuthorDate
disciplined clear process for debugging        Payam Soltany      07/04/05 21:41      
   Use a scope!      Andy Neil      07/05/05 00:06      
   Design for debug      Andy Neil      07/05/05 01:00      
      comments      Erik Malund      07/05/05 06:59      
         Comments on comments      Andy Neil      07/05/05 12:27      
            In the eyes of the beholder      Erik Malund      07/05/05 12:35      
               budget      Andy Neil      07/05/05 14:46      
                  budget      Bartosz Wucke      07/11/05 06:27      
                     that is when it will be needed      Erik Malund      07/11/05 06:44      
                        unless...      Bartosz Wucke      07/11/05 07:12      
                           you do not get the point      Erik Malund      07/11/05 07:18      
                              shoud I?      Jan Waclawek      07/11/05 07:30      
                              Yes.      Bartosz Wucke      07/11/05 08:14      
                                 inconsequent      Erik Malund      07/11/05 08:28      
                                    no, no, no...      Bartosz Wucke      07/11/05 10:49      
                                       then why      Erik Malund      07/11/05 10:56      
                                          ...which means...      Bartosz Wucke      07/11/05 11:13      
                                             which you must verify which is more work      Erik Malund      07/11/05 11:27      
                                                Coding style...      Bartosz Wucke      07/12/05 01:00      
                                                   that's impossible      Erik Malund      07/12/05 06:09      
               9 out of 10 cats prefer it      Donald Catto      07/06/05 02:46      
                  corrections      Erik Malund      07/06/05 06:26      
                     Experience, not correction.      Donald Catto      07/06/05 07:26      
                        I'm curious      Erik Malund      07/06/05 07:35      
                           no ICE      James Hinnant      07/06/05 20:04      
         I like Serial Debugging      Neil Kurzman      07/05/05 12:50      
         re:ice      Jacob Boyce      07/06/05 12:25      
            Don't put the bugs in!      Russell Bull      07/07/05 02:27      
               your brain is your best debugger      Jacob Boyce      07/07/05 07:15      
                  not always so      Erik Malund      07/07/05 07:29      
                     blindness      Jan Waclawek      07/07/05 08:01      
                        Tell it to the gatepost      Andy Neil      07/07/05 08:18      
                           are you calling      Erik Malund      07/07/05 08:40      
                           Simpler help.      Bartosz Wucke      07/11/05 06:52      
                              clerical errors      Erik Malund      07/11/05 07:10      
                                 Re:      Bartosz Wucke      07/11/05 07:33      
                                    when quoting, be complete      Erik Malund      07/11/05 07:37      
                        re:blindness      Jacob Boyce      07/07/05 08:51      
                           testing      Jan Waclawek      07/07/05 09:04      
                              debugging is NOT testing      Richard Erlacher      07/12/05 07:25      
                                 not according to NASA      Erik Malund      07/12/05 08:23      
                                    What?      Richard Erlacher      07/17/05 23:55      
                                       unnecessary code      Erik Malund      07/18/05 06:26      
                                       read all about it      Erik Malund      07/18/05 06:32      
                                          that's the difference ...      Richard Erlacher      07/18/05 22:47      
                                             I agree with NASA, you do not      Erik Malund      07/19/05 06:09      
                                 terminology      Jan Waclawek      07/12/05 09:36      
                                    definintions?      Richard Erlacher      07/17/05 23:45      
                           when designing devices that can harm lif      Erik Malund      07/07/05 09:50      
                              re:don't do harm      Jacob Boyce      07/07/05 12:13      
                                 another article of interest      Jacob Boyce      07/07/05 12:52      
                  WYWIWYS      Andy Neil      07/07/05 08:11      
                     An old programmer's law        Slobodan Mandaric      07/11/05 03:26      
                        An Old Programmer's response      Andy Neil      07/11/05 03:48      
                           perfect communication      Erik Malund      07/11/05 06:46      
   hmmmm      Jez Smith      07/05/05 02:04      
      Learning.      Bartosz Wucke      07/11/05 07:19      
      Sorry Mr. Professional      Payam Soltany      07/11/05 18:48      
         don't read if they are boring      Erik Malund      07/12/05 06:12      
            Allright      Payam Soltany      07/12/05 07:12      
               as I said      Erik Malund      07/12/05 07:14      
   Thanks Payam!      Mehdi      07/05/05 02:08      
      Don't let Erik see that!      Andy Neil      07/05/05 05:09      
         Bad engineering      Donald Catto      07/06/05 02:35      
            I don't think it is bad engineering!      Mehdi      07/06/05 03:07      
               Calm down - it's only a joke!      Andy Neil      07/06/05 03:41      
                  Yes and no      Donald Catto      07/06/05 05:22      
                     Testing      Steve M. Taylor      07/06/05 06:06      
                        succesful testing does not prove the abs      Erik Malund      07/06/05 06:39      
                           The proof is in the pudding      Donald Catto      07/06/05 07:12      
                              you can't      Erik Malund      07/06/05 07:42      
                              Proving      Andy Neil      07/06/05 11:43      
                           successful testing!      Mehdi      07/06/05 10:01      
                           Bad testing      Andy Neil      07/06/05 11:49      
                              bad, maybe, but possibly complete      Erik Malund      07/06/05 11:57      
                                 Perfect vs Good Enough.      Bartosz Wucke      07/11/05 08:14      
                                    the slippery slope      Erik Malund      07/11/05 08:37      
                                       90% agreement.      Bartosz Wucke      07/11/05 11:05      
                                          then why do you discuss releasing progra      Erik Malund      07/11/05 11:16      
                                             I don't "release".      Bartosz Wucke      07/11/05 11:48      
                                                Is repeating part of the question an ans      Erik Malund      07/11/05 12:09      
                                                   Yes.      Bartosz Wucke      07/12/05 00:34      
                                                      not authority but knowledge      Erik Malund      07/12/05 06:18      
                                                         Where...?      Bartosz Wucke      07/12/05 12:08      
                                                            do you really think that anyone consider      Erik Malund      07/12/05 12:26      
                                                               The $3.000.000 machine      Jan Waclawek      07/12/05 13:31      
            Yes, but...      Bartosz Wucke      07/11/05 07:42      
   I have one more ...        Slobodan Mandaric      07/05/05 06:07      
      CVS or SVN        Benjamin Damet      07/05/05 06:19      
         ....      Benjamin Damet      07/05/05 17:33      
   re:ISR      Jacob Boyce      07/06/05 12:42      
      defeating a purpose      Erik Malund      07/06/05 14:08      
         re:ISR      Jacob Boyce      07/06/05 15:11      
   Wikipedia:: debugging (etc.)      James Hinnant      07/06/05 20:37      
   Another one for your list      Andy Neil      07/07/05 00:38      
   PC-LINT      Mahmood Elnasser      07/07/05 13:58      
      anyone not using it?      Erik Malund      07/07/05 14:21      
         re:anyone not using it      Jacob Boyce      07/07/05 14:26      
            PC lint cost about $200      Erik Malund      07/07/05 14:34      
               PC Lint      Jacob Boyce      07/07/05 14:37      
            PC lint cost about $200      Erik Malund      07/07/05 14:36      
               Not Always      Neil Kurzman      07/07/05 18:09      
                  amen to that      Erik Malund      07/08/05 06:03      
   All nice and pretty...      Bartosz Wucke      07/11/05 05:19      
      Noise problems?      Payam Soltany      07/11/05 19:01      

Back to Subject List