We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I have 2 questions regarding SROM that I couldn't find the answer to.
1) If the compiler adds LCALLs to c lib (?C?..) functions in the code I am copying to the ram are the c lib functions located in this segment as well and are copied to the RAM or are they still called from the flash?
2) Dows the linker know to locate global/local variables that are used from this function in a RAM area that isn't overlapping with the are I'm about to copy the code into or must I locate all variables manually in a non-oberlapping area of of the RAM?
Thank you
If the compiler adds LCALLs to c lib (?C?..) functions in the code I am copying to the ram are the c lib functions located in this segment as well and are copied to the RAM or are they still called from the flash?
I can only guess thet you somehow have the impression that code goes into RAM, it does not. It takes "hardware tricks" to make the '51 execute from RAM.
if my guess is correct it's "bible time"
here are the links to "the bible" Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer’s Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
Erik
"It takes "hardware tricks" to make the '51 execute from RAM."
The 8051 neither knows nor cares about RAM - all it knows is its address spaces - CODE, XDATA, etc.
The LX51 Linker has several features to support various different types of memory (RAM, ROM, etc) being mapped (and, possibly, re-mapped) into the 8051's various address spaces.
This particular LX51 option (SROM) is specifically to support such tricks!
Please read the manual: http://www.keil.com/support/man/docs/lx51/lx51_ls_srom.htm
"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"