Keil Logo

Special ROM Handling

The LX51 Linker include special ROM (SROM) handling support that allows you to re-target memory classes and program segments at run-time. This feature allows you to create classes and segments that are stored in one location but execute from another.

The most obvious use for this feature is in-system Flash programming for applications where the code to re-program the Flash is actually stored in Flash. In such applications, these routines must be moved to RAM for execution so that the re-programming process does not corrupt the re-programming code.

The CLASSES and SEGMENTS directives store these SROM classes or segments at one address but link them for execution from another.

To use SROM classes or segments in your program, you must:

  1. Create the functions that will be re-targeted. You may put these routines in a user-defined class.
  2. Adjust the linker CLASSES or SEGMENTS directive to relocate the SROM code.
  3. Create code or a function to copy the SROM code to its execution address using the Segment Information or Class Information the linker automatically creates. 
  4. Execute the SROM code.
  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.