ARM Technical Support Knowledge Articles

CAN I EXECUTE ARM CODE FROM RAM?

Applies to: RealView C Compiler

Answer


Information in this knowledgebase article applies to:


SYMPTOM

I need to execute a part of my program from RAM

CAUSE

Hardware requirements, for procedures such as In Application Programming (IAP) of the Flash ROM.

RESOLUTION

Assuming we have 8000h bytes of RAM, starting at 40000000H, and we want to execute about 1k of code from RAM:

  1. Place all the code that you want to execute from RAM into its own C module (for example "ram_code.c") and add that module to your project.
  2. Subtract 0x400 (= 1k) from the size of your IRAM1, in your Target options(Project — Options for Target — Target tab).
  3. Set the start address for IROM2 to your IRAM1 start address, plus your IRAM1 size. for example
    IRAM1 start = 0x40000000
    IRAM1 size = 0x7C00
    IROM2 start = 0x40007C00
  4. Set IROM2 size to 0x400.
  5. Click OK in the options dialog
  6. Right-click on ram_code.c in the project workspace, and select Options for File
  7. Change the Code / Const: setting, under Memory Assignment, from <> to IROM2[0x40007C00-0x40007FFF]

MORE INFORMATION

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2008-08-15 08:27: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