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.
I want to locate a C function at a specific location in the memory. How can I do that?
Regards, Gaurav
I do not want to place the function at a specific location but I want to avoid certain memory range, specifically the 0-4K range.
It's good that you said that, because that is quite different from "locating a function at a certain address" !
Using the answer you got for the latter address, you would have had to locate all of your functions by hand, and that is a true nightmare.
What you are really trying to do it excluding a certain address range from the pool that the linker uses to locate functions - i.e. you want to modify the memory map.
As Christoph said, your actual requirement is quite different from the question that you originally asked!
"What you are really trying to do it excluding a certain address range from the pool that the linker uses to locate functions"
Absolutely; and the Linker has specific controls to do exactly that - see the appropriate Linker Manual:
http://www.keil.com/support/man/docs/bl51/ http://www.keil.com/support/man/docs/lx51/
If you're using uVision: www.keil.com/.../uv3_ca_ovwconfigdialogs.htm http://www.keil.com/support/man/docs/uv3/uv3_dg_target51.htm http://www.keil.com/support/man/docs/uv3/uv3_dg_l51loc.htm http://www.keil.com/support/man/docs/uv3/uv3_dg_l251loc.htm