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.

MSP430FG4618 startup code help

Other Parts Discussed in Thread: MSP430FG4618

Hi 

I believe there is bug in MSP due to which MSP430fg4618 doesn't boot some times and only way to recover the system is reflashing.

I was trying to find startup code which it executes before it calls main.

I am using CCS version 5 .

If i know where is the startup code , i can atleast check where it fails  and may be i can put some way so that i can reflash the system without JTAG.

I tried to search it but CCS is not a tool which gives any information so easily.

Please let me know where is the start up code in CCS 

  • Hi Rakesh,

    I'm not sure what you exactly mean with start up code... do you mean example code?
    When you power your device after the code was programmed to flash, it starts execution on the address of the reset vector content 0xFFFEh.
    Please have a look to the example code from web:
    www.ti.com/.../toolssoftware
    Usually in all examples first of all the SP pointer is initialized and afterwards the WDT is disabled.

    Best regards
    Lukas
  • Thanks for the response.

    Let me explain it more simple way.

    In CCS I am looking for the code which works as init code for MSP430.

    there should be some where which indicates system has to go to main.

    I understand those vector location but I am unable to find the code which is before main().

    Once all basic init is done it jumps to main.I am trying to find the code before main.

  • There is no init code existing before going to the address of the Reset vector (0xFFFE).

    Let me explain this on the below example.

    After power up the address of the Reset vector is resolved.

    It shows to the label RESET.

    The init of the SP is done, also the WDT is disabled.

    P1.5 is configured as output.

    Afterwards the Mainloop is executed.

    Here is the created image of the code:

    Best regards

    Lukas

  • Rakesh Kumar4 said:
    Please let me know where is the start up code in CCS

    The start up code is in the C run time library.

    When using a TI compiler the C run time library source code is available <ccs_5_install_directory>/ccsv5/tools/compiler/<compiler_version>/lib/rtssrc.zip

    If you want to debug the start-up code disable the option which auto-runs to main (see http://processors.wiki.ti.com/index.php/Debug_Handbook_for_CCS#Auto_Run_and_Launch_Options) which means when start a debug session the program will be at the reset vector and you can then step through the start-up code.

    With CCSv6 CCS automatically unzips the contents of the rtssrc.zip zip file.

    With CCSv5 I think you have to manually unzip the rtssrc.zip file for the debugger to be able to locate the source code for the C run time library.

**Attention** This is a public forum