Keil Logo

MCB520: PROGRAM CRASHES WHEN LOADED BELOW 100H


Information in this article applies to:

  • MCB520 Evaluation Boards

SYMPTOMS

Help. I have a very small program that I download and run on the MCB520 board. The opcodes at address 3Bh, 3Ch, and 3Dh (or at 23h, 24h, and 25h) get corrupted and my program crashes. If I relocate my program to start at 100h, everything works fine. What's wrong with this configuration?

CAUSE

The monitor on the MCB520 board uses SIO1 on the 520 to communicate with the PC. It also uses the interrupt vector (interrupt 7 at address 3Bh) to halt program execution when you stop program execution in the debugger. The monitor overwrites this interrupt vector and that is what causes your program corruption.

If you change the monitor to use SIO0, interrupt vector 4 will be used instead of interrupt 7.

RESOLUTION

There are 2 ways you can resolve this problem.

  1. Locate your program code to start at 100h like you are doing with the linker:
    BL51 mycode.obj CODE(0100h)
    
  2. Define a dummy interrupt for interrupt 7 (or 4 if you use SIO0):
    void dummy_isr (void) interrupt 7
    {
    }
    

    This will reserve space for the interrupt vector (actually it will point to dummy_isr) and the monitor can overwrite this without corrupting your program code.

MORE INFORMATION

Refer to the Example Programs section in the MCB520 Evaluation Board User's Manual for more information.

For more information about the MCB520 evaluation board, refer to the following URL: http://www.keil.com/mcb520

Last Reviewed: Saturday, July 9, 2005


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.