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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/08/08 01:27
Read: times


 
#156502 - So this is on a simulator?
Responding to: ???'s previous message
I have not used the Keil Simulator, But if it has the features of a Full HW Emulator look for a break on change. This will set a break point for a write to a variable.

Break it down to debug. Fill in the array with fixed values. if it works you know your EE Read is bad. Other wise you know it is being corrupted else where. It helps to narrow the focus you you are not looking at code that is not involved. The smaller the hay stack the easier it is to find the needle.

The stack gets the return address pushed for each call (2 Bytes) it should not be an issue unless it wraps around.
Insure an variables that are used in main() and an interrupt are atomic ( bits and bytes for and 8052 AND operations that have a an ASM OP-Code). If you have ASM code mixed in you have to make sure it does not step out of bounds. Pointers including arrays. Insure pointers are pointing to the correct thing. Insure they do not get out of bounds. The same with arrays. If you write to the wrong memory you are trashing other variables.

List of 25 messages in thread
TopicAuthorDate
Data Array getting corrupted after init            01/01/70 00:00      
   OnePossibleIdea....            01/01/70 00:00      
      I did not do anything with the stack            01/01/70 00:00      
         As Michael said....            01/01/70 00:00      
         How do you test and debug code?            01/01/70 00:00      
            Keil is the only thing in place            01/01/70 00:00      
               'crap'??            01/01/70 00:00      
                  Is this the book you refer?            01/01/70 00:00      
                     nope            01/01/70 00:00      
                        Erik            01/01/70 00:00      
                           So where is the code            01/01/70 00:00      
                           do NOT "put them"            01/01/70 00:00      
                              Focus            01/01/70 00:00      
                                 Simulator            01/01/70 00:00      
               So this is on a simulator?            01/01/70 00:00      
                  Post your duff code            01/01/70 00:00      
               Finding Cause of Corruption            01/01/70 00:00      
                  Get the C right, then look at the target CPU            01/01/70 00:00      
                  Optimizing Compilers            01/01/70 00:00      
                     In my experience.....            01/01/70 00:00      
                        Keil C 51 Optimizations            01/01/70 00:00      
                           Use IAR then            01/01/70 00:00      
                              different approaches            01/01/70 00:00      
                           sometimes, depends            01/01/70 00:00      
                              Thanks            01/01/70 00:00      

Back to Subject List