|
|||||||||||
Technical Support Support Resources
Product Information |
C166: Writing Relocatable C Functions for Copying To RAMInformation in this article applies to:
QUESTIONI have read application note 138, which describes how to copy assembler routines from Flash memory to RAM for execution. I want to copy C routines. Is this possible? ANSWERYes. However, you must locate the C code in FAR memory (MEDIUM, LARGE, or HLARGE memory model) and you must use the RENAMECLASS directive to specify the correct name for the code class. Write your C functions in a separate source file as functions. For example:
Your C routines are then ready to use! You will probably receive a linker warning similar to the following:
The warning is caused (in this instance) because the memory model of the program is SMALL while the memory model of the PFLASH module must be LARGE. It is safe to ignore this warning. MORE INFORMATIONSEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
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.