Keil Logo

RTX51: Relocating the RTX51 Interrupt Base Address

QUESTION

Is it possible to relocate RTX-51's interrupt vector base address?

ANSWER

Yes. There are only a few steps you must take to move the interrupt vectors.

  1. Change the startup code to begin at the target reset vector.
  2. Locate the interrupt vectors at their new location using C51.
  3. Specify the code area for the linker.
  4. Modify the RTXSETUP.DCL to know where to put the interrupt vector table.
  5. Specify the RTX interrupt vector location to the linker.

The following example assumes that you wish to relocate the interrupt table to 0x1000 where the reset vector is at 0x1000 and interrupts are at 0x1003, 0x100B, 0x1013, and so on.

  1. To change the startup code, copy the STARTUP.A51 file from the \C51\LIB directory to your project directory. Search for CSEG AT 0000h and change it to CSEG AT 1000h.
  2. To locate the interrupt vectors, in µVision, select the C51 Compiler command from the Options menu and select the Object tab. Change the Offset for the interrupt vectors to 0x1000. If you don't use µVision, add IV (0x1000) to your C51 command line.
  3. To specify the code area for the linker, in µVision, select the BL51 Code Banking Linker command from the Options menu and select the Size/Location tab. Change the Code segment location to 1000 (note that 0x and H are not required here). If you don't use µVision, add CODE (0x1000) to your BL51 command line.
  4. Modify RTXSETUP.DCL so that the interrupt base address is 0x1000. Search for ?RTX_INTBASE EQU 0 and change it to ?RTX_INTBASE EQU 1000h.
  5. In the BL51 Linker Options dialog box, select the Additional tab and add RTXINTBASE(1000h) to the first available line. This linker command relocates the RTX51 interrupt table to 1000h. The address you specify must be the same as for the ?RTX_INTBASE declaration in RTXSETUP.DCL. Note that you may abbreviate the linker option as RI(1000h).

Rebuild your program and look at the M51 map file to make sure your program begins at the appropriate address.

You could also create a small assembly program that redirects the interrupt vectors to their new locate. Either way, the real interrupt vectors must redirect the interrupt to your new interrupt vector table.

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


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.