Hi,
I'm using the keil to compile a project for the 8051.
I want to place a single function in a specific address in the rom.
I found a lot of answers, in the forum, but non of them actually worked.
How can i "tell" the keil that the specific function MUST be at address 0x1234, for example? if it helps, the function is written in a seperate file. Thanks, Noam
per, it's a bit difficult to explain, but in a nutshell there is a register that holds an address in the ROM. this address is the first address of the bugged function. Once the h/w recognize that the RISC got to the bugged function jumps to the first address in the RAM. in the end of the fixed function in the RAM there is a jump to the last address of the bugged function in the ROM. Therefore you don't need the RAM to be as large as the ROM. So, anyone has any idea how to place a function in a specific address in the ROM?
So, anyone has any idea how to place a function in a specific address in the ROM?
You still haven't described what you have already tried and why it did not work.
You can use the linker to locate segments and functions at certain memory locations. How to do this can be found in the documentation of the linker you are using (BL51 or LX51), for example
http://www.keil.com/support/man/docs/bl51/bl51_code.htm
"it's a bit difficult to explain, but in a nutshell there is a register that holds an address in the ROM. this address is the first address of the bugged function."
Is this a custom design in ASIC or FPGA or something?
Thank you very much. the kink that you sent me worked. I still didn't come to conclusion what happens to the original code.
yes, and the link above proved to work fine!
Noam, Per mentioned a very good point. If you recompile, you (possibly) lose all reference. But maybe you can prevent that by filling in the gaps: The C167 processor a special linker directive (I think it is called "RESERVE" by the Tasking linker) that reserves pieces of memory. If you can somehow use that thing, maybe your memory map will not change. But this has, of course, serious limitations.
The C51 linker also has a RESERVE directive that you can use to block address ranges from being used.