ARM Technical Support Knowledge Articles

OVERLAY DATA FROM INTERRUPT ROUTINE WITH MAIN

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


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...

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

Article last edited on: 2006-08-01 13:21:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential