Keil Logo

BL51: OVERLAY DATA FROM INTERRUPT ROUTINE WITH MAIN


Information in this article applies to:

  • C51 All Versions
  • CX51 All Versions
  • C251 All Versions

QUESTION

In my application there is an interrupt function which is only used for exception handling. It never returns to the application after execution. Is there a way to overlay data from this function with the main application to save data space?

ANSWER

Yes, this is possible with the OVERLAY directive of BL51 and LX51. In the interrupt routine itself you should call a separate function which does the required operations (e.g. a reset).

Your code may look like this example:

void test_int2 (void) {
  ...       // Do something here, for example exception handling
  while(1); // Never return from the interrupt - a WDT can reset here
}

void test_int (void) interrupt 1 using 1 {
  test_int2();
}

To instruct the linker to overlay the local variables that are used in test_int2...

  • ... open the Options for Target - BL51(LX51) Misc tab.
  • ... enter the following under OVERLAY: test_int ~ test_int2, main ! test_int2.

test_int ~ test_int2 ignores calls of test_int2 from test_int.
main ! test_int2 adds a virtual call reference between main and test_int2 which allows the data to be overlaid with main.

MORE INFORMATION

  • Refer to OVERLAY in the BL51 User's Guide.
  • Refer to OVERLAY in the LX51 User's Guide.

Last Reviewed: Tuesday, August 1, 2006


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.