This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to assign a C function to a pointed address?

hi,all Is there anyway for my to assign a C function pointer to a pointed address? for example,I want to set
my function :A be assigned to 0xA0000000 when compile and link. i use LPC2478 and uision 2.54. hopeing for your helps!

Parents
  • Not sure exactly what you are saying, since you seem to be talking about multiple things.

    You can make a function pointer point to any address in the memory space, either giving it an initial value at compile time or assigning the value in runtime.

    But you are mixing discussion of function pointers and location of functions. If you have your function in a separate source file, then you can easily create a linker scatter file that places this object file at a specific location in memory.

    But how about taking two steps back and describing what problem you are trying to solve, instead of jumping directly into how to do a specific detail.

Reply
  • Not sure exactly what you are saying, since you seem to be talking about multiple things.

    You can make a function pointer point to any address in the memory space, either giving it an initial value at compile time or assigning the value in runtime.

    But you are mixing discussion of function pointers and location of functions. If you have your function in a separate source file, then you can easily create a linker scatter file that places this object file at a specific location in memory.

    But how about taking two steps back and describing what problem you are trying to solve, instead of jumping directly into how to do a specific detail.

Children
No data