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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/05/05 03:41
Read: times


 
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            01/01/70 00:00      
   Use a scope!            01/01/70 00:00      
   Design for debug            01/01/70 00:00      
      comments            01/01/70 00:00      
         Comments on comments            01/01/70 00:00      
            In the eyes of the beholder            01/01/70 00:00      
               budget            01/01/70 00:00      
                  budget            01/01/70 00:00      
                     that is when it will be needed            01/01/70 00:00      
                        unless...            01/01/70 00:00      
                           you do not get the point            01/01/70 00:00      
                              shoud I?            01/01/70 00:00      
                              Yes.            01/01/70 00:00      
                                 inconsequent            01/01/70 00:00      
                                    no, no, no...            01/01/70 00:00      
                                       then why            01/01/70 00:00      
                                          ...which means...            01/01/70 00:00      
                                             which you must verify which is more work            01/01/70 00:00      
                                                Coding style...            01/01/70 00:00      
                                                   that's impossible            01/01/70 00:00      
               9 out of 10 cats prefer it            01/01/70 00:00      
                  corrections            01/01/70 00:00      
                     Experience, not correction.            01/01/70 00:00      
                        I'm curious            01/01/70 00:00      
                           no ICE            01/01/70 00:00      
         I like Serial Debugging            01/01/70 00:00      
         re:ice            01/01/70 00:00      
            Don't put the bugs in!            01/01/70 00:00      
               your brain is your best debugger            01/01/70 00:00      
                  not always so            01/01/70 00:00      
                     blindness            01/01/70 00:00      
                        Tell it to the gatepost            01/01/70 00:00      
                           are you calling            01/01/70 00:00      
                           Simpler help.            01/01/70 00:00      
                              clerical errors            01/01/70 00:00      
                                 Re:            01/01/70 00:00      
                                    when quoting, be complete            01/01/70 00:00      
                        re:blindness            01/01/70 00:00      
                           testing            01/01/70 00:00      
                              debugging is NOT testing            01/01/70 00:00      
                                 not according to NASA            01/01/70 00:00      
                                    What?            01/01/70 00:00      
                                       unnecessary code            01/01/70 00:00      
                                       read all about it            01/01/70 00:00      
                                          that's the difference ...            01/01/70 00:00      
                                             I agree with NASA, you do not            01/01/70 00:00      
                                 terminology            01/01/70 00:00      
                                    definintions?            01/01/70 00:00      
                           when designing devices that can harm lif            01/01/70 00:00      
                              re:don't do harm            01/01/70 00:00      
                                 another article of interest            01/01/70 00:00      
                  WYWIWYS            01/01/70 00:00      
                     An old programmer's law            01/01/70 00:00      
                        An Old Programmer's response            01/01/70 00:00      
                           perfect communication            01/01/70 00:00      
   hmmmm            01/01/70 00:00      
      Learning.            01/01/70 00:00      
      Sorry Mr. Professional            01/01/70 00:00      
         don't read if they are boring            01/01/70 00:00      
            Allright            01/01/70 00:00      
               as I said            01/01/70 00:00      
   Thanks Payam!            01/01/70 00:00      
      Don't let Erik see that!            01/01/70 00:00      
         Bad engineering            01/01/70 00:00      
            I don't think it is bad engineering!            01/01/70 00:00      
               Calm down - it's only a joke!            01/01/70 00:00      
                  Yes and no            01/01/70 00:00      
                     Testing            01/01/70 00:00      
                        succesful testing does not prove the abs            01/01/70 00:00      
                           The proof is in the pudding            01/01/70 00:00      
                              you can't            01/01/70 00:00      
                              Proving            01/01/70 00:00      
                           successful testing!            01/01/70 00:00      
                           Bad testing            01/01/70 00:00      
                              bad, maybe, but possibly complete            01/01/70 00:00      
                                 Perfect vs Good Enough.            01/01/70 00:00      
                                    the slippery slope            01/01/70 00:00      
                                       90% agreement.            01/01/70 00:00      
                                          then why do you discuss releasing progra            01/01/70 00:00      
                                             I don't "release".            01/01/70 00:00      
                                                Is repeating part of the question an ans            01/01/70 00:00      
                                                   Yes.            01/01/70 00:00      
                                                      not authority but knowledge            01/01/70 00:00      
                                                         Where...?            01/01/70 00:00      
                                                            do you really think that anyone consider            01/01/70 00:00      
                                                               The $3.000.000 machine            01/01/70 00:00      
            Yes, but...            01/01/70 00:00      
   I have one more ...            01/01/70 00:00      
      CVS or SVN            01/01/70 00:00      
         ....            01/01/70 00:00      
   re:ISR            01/01/70 00:00      
      defeating a purpose            01/01/70 00:00      
         re:ISR            01/01/70 00:00      
   Wikipedia:: debugging (etc.)            01/01/70 00:00      
   Another one for your list            01/01/70 00:00      
   PC-LINT            01/01/70 00:00      
      anyone not using it?            01/01/70 00:00      
         re:anyone not using it            01/01/70 00:00      
            PC lint cost about $200            01/01/70 00:00      
               PC Lint            01/01/70 00:00      
            PC lint cost about $200            01/01/70 00:00      
               Not Always            01/01/70 00:00      
                  amen to that            01/01/70 00:00      
   All nice and pretty...            01/01/70 00:00      
      Noise problems?            01/01/70 00:00      

Back to Subject List