This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

single step into an interrupt routine

Is there a way to prevent the debugger from single stepping into an interrupt routine. To disable interrupts help but it is awkward.

  • I too have found this to be a problem in the past. The only solution I have found is to manually change the EA bit. The worst thing about this is remembering to put it back as it was before pressing run.

    It would be nice to have a button on the debug toolbar that disables interrupts while single stepping.

  • "It would be nice to have a button on the debug toolbar that disables interrupts while single stepping."

    You could always create your own - see the uVision Getting Started Guide.

  • Come to think of it. When would one ever want to single step into a interrupt routine?

  • You can always create a toolbox button to disable the interrupt

  • Why not use the Go To Cursor with a hot key and let the interrupt work.

  • I can suggest you a "partial" solution, if the problem you are speaking of is regarding a cyclic interrupt such as a Timer Interrupt.
    We had this problem in the past: Mon51 was continuously interrupted by the Timer during debug, since Timer was running even if program was halted due to a breakpoint.
    After every step we continued to run into Timer Interrupt routine.
    We found a solution by means of the two Mon51 hooks called AFTER_GO and BEFORE_GO.
    If you look in INSTALL.A51, the Mon51 configuration file, you will find two declarations

    PUBLIC  BEFORE_GO       ; DO SOME THINGS BEFORE STARTING USER PROGRAM
    PUBLIC  AFTER_GO        ; DO SOME THINGS AFTER TERMINATION OF USER PROGRAM
    

    BEFORE_GO is called by the monitor every time it passes control to your program
    AFTER_GO is called every time your program passes control back to Mon51, i.e. during a Breakpoint or during Single Step.
    You can customize the two functions at your need, maybe stopping the timer when you reach a breakpoint, by means of AFTER_GO, and then restoring the original status with BEFORE_GO when your program restarts.
    By using the two functions you can completely "freeze" your microcontroller during the debug inspection phase, letting Mon51 behave almost like a real emulator.

  • "BEFORE_GO is called by the monitor every time it passes control to your program
    AFTER_GO is called every time your program passes control back to Mon51, i.e. during a Breakpoint or during Single Step."

    I disassemble the mon51,I found mon51 never
    call BEFORE_GO and AFTER_GO,Why? my keil version is V7.1

  • I disassemble the mon51,I found mon51 never call BEFORE_GO and AFTER_GO,Why? my keil version is V7.1

    Hmmm. We use it all the time for custom monitor configurations and it gets called.

    Have you tried it to see if it works? You could set a port bit in BEFORE_GO and reset the bit in AFTER_GO and use a scope or logic probe to verify.

    Jon

  • thanks Jon,I followed what you said,I can see it works. could you please tell me detail about mon51?thanks! my mail:tomsbao@hotmail.com