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.

startup code

I read a few postings on how to manually set the address of _c_int00, but none were for the MSP430.

I am running application code under control of a bootloader and need to place the startup code at a known address.

I modified the linker file as follows:

     (a) added      "STARTUP : origin = 0x1100, length = 0x0080" in the Memory block

    (b) changed the Flash definition to "FLASH : origin = 0x1200, length = 0xAD00" in the Memory block

 

     (c) added  ".text:_c_int00   : {} > STARTUP      /* STARTUP CODE SPACE */" in the sections block

This did not work; my code ended up starting at 0x1200, but _c_int00 is in higher memory at 0x136C

I had all this working with the IAR IDE, am now moving to CC4 and need the same functionality.  Thanks.

Stan

  • Well, the startup code is a compiler specific piece of code.
    As this, it's label name is in no way standardized. Maybe your changes do work fine, just the startcode does not have the name _c_int00 under CC4.

    Anyway, if the startcode has been compiled for a certain segment, it might be difficult to move it into a different segment by the linker script. Whether this is possible at all depends on the linker and the startup code concept.

    I don't use either one compiler, only mspgcc, and there the start code is called _reset_vector__ and contains several subsections _init_x for user plug-ins. Moving the _reset_vector part to a different segment would still leave the other user-provided parts and the copy loops in the text segment, effectively breaking the code completely. (I think, the _reset_vector part is empty anyway).
    I wrote my own startup code (the default disables the WDT, mine triggers it during data copy) and it is easy to place it at a certain address or segment, as it is compiled with this information then.

  • Hi,

       I wanted to do something similiar for the CCS BSL.  In the end, I had to place a BR _c_int00 at 0x1000 manually, but I asked the CCS guys about forcing that section to the beginning flash address.  Here's what they gave me for a linker command file example:

        .text    : {

            *(.text:_c_int00*)

            *(.text)

                    } > FLASH

    I never tried this, but perhaps it will help you.

  • This worked; thanks for the help.

    I have one more problem to resolve; will do a separate post to keep the topics straight.

  • Stan,

    Why don't you handle the "reset vector" the same way you handle the "interrupt vectors" in your other posting?

    --OCY

**Attention** This is a public forum