Keil Logo

MON166: MONITOR STOPS WORKING AFTER EXECUTING CODE


Information in this article applies to:

  • C166 all Versions

SYMPTOMS

When using MON166 and executing code, the monitor stops responding after starting the target program.

CAUSE

This problem may be caused by the following:

  • Overwriting the interrupt vectors used by the monitor.
  • Overwriting the monitor code or data areas.
  • Changing the P3 direction register (used by the serial port).
  • The application causes a Class A or Class B Trap.

RESOLUTION

Overwriting the interrupt vectors used by the monitor.

If you use the Monitor in Bootstrap mode, you must reserve the interrupt vectors and the monitor code area. In most cases you have to RESERVE at least the serial interrupt 0 and the NMI trap with L166. Under µVision2 you need to enter this information under Options - L166 Misc - Reserve:

8H-0BH, 0ACH-0AFH

Overwriting the monitor code or data areas.

You should also reserve the monitor code and data area. Please check the configuration of your monitor to figure out which areas you need to reserve. For most boards you will find this information under µVision2 in the dialog Options - Debug - Monitor Settings - Description.

Changing the port 3 direction register (used by the serial port).

I/O port 3 is used by the monitor for the serial port (typically) but may also be used in your application. Therefore, you need to make sure that the register P3 and DP3 are configured as follows:

  • TxD0 (P3.10) as output and initilize the P3.10 port with '1'.
  • RxD0 (P3.11) as input.

For example:

  P3   = 0x0400;        // P3.10 must be 'high'
  DP3  = 0x0400;        // P3.10 must be 'output'

The application causes a Class A or Class B Trap.

Class A or Class B traps have a higher priority than the monitor's UART interrupt. Because of that, the monitor cannot get control over the CPU.

Even setting a breakpoint in a trap handler function and debugging this function will not work reliable because the monitor needs to disable interrupts while it is active. Since Class A and Class B traps cannot be disabled the monitor will run into recursivity problems and will show wrong results / behavior.

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Tuesday, November 23, 2010


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.