This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

fixed entry point

I need to force a certain function to a fixed address in the code space - so I can jump to this address when required

this is an entry point for an app to jump into the bootloader

I cant seem to find this in your documentation

  • Hi Steven,
    Here is just an example. Suppose the function starts at address 0x1000.

    StartAddress = (uint32_t)0x00001000;
    ((void (*)(void))StartAddress)()
  • I need to have the linker PLACE a function at a certain address that I choose and never move it even if other code is added (place the other code around it)

    in Keil is done this way
    void booterEntry (void) __attribute__((section(".ARM.__at_0xF00")));
    void booterEntry (void)
    {

    booterControlLoop();
    }
    the function booterEntry will always be at F00

    how do you do this with CCS?
  • Hi Steven,

      Your question can be best answered by the compiler forum if my answer does not answer your question. Let me know if you want me to move your post to the compiler forum or you can create a new post there. 

      I think you can use the #pragma CODE_SECTION. See below example excerpt from the compiler userguide.

    #pragma CODE_SECTION(fn, "my_sect")
    int fn(int x)
    {
    return x;
    }

    In the linker command file you can then map the section to a physical address.