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

Locating Code

I wish to install a bootloader in a specific sector of the LPC2106. How can I place a section of code to start at a specific address?

Thanks

Rich

Parents Reply Children
  • Yes, that is true. the question remains........

  • You'd do this by sending a CODE() directive to the linker. For instance, if you had a file named BAR.C with a function FOO() in it, you'd specify:

    CODE(?PR?FOO?BAR(0xXXXX))

    where 0xXXXX is the memory address you want the function located at. There are some variations in the way the compiler might name the segments, but that's the general jist of it.

    If you want to do this in uVision, you'd go to Project->Options for Target and choose the BL51 locate tab and type something in the edit box next to the word "code." (ie. put ?PR?FOO?BAR(0xXXXX) there.

    For more information about how things are named and what you can do to locate program and data segments at different places, just look in the compiler and linker manuals.