I am just starting with MSP430 and Code Composer Studio (CCS).

I want to make a pure-assembly project. At the moment, I have a "hello world" program that does nothing but light an LED on the MSP430F5529 Launchpad.

However, when I run this program in the debugger, execution begins at address 0x0000 instead of at my designated entry point, called RESET (0x10000). I can see that PC is intially set to 0x0000. If I manually set it in the watch window to RESET, the program runs as expected.

I have declared RESET to be global, and I have set the linker option to make RESET the entry point.

I'm guessing I have a problem with either debugger settings or the (boot)loader, but I could be totally on the wrong track.

            .cdecls C,LIST,"msp430.h"       ; Include device header file
            .text                           ; Assemble into program memory
            .retain                         ; Override ELF conditional linking
                                            ; and retain current section
            .retainrefs                     ; Additionally retain any sections
                                            ; that have references to current
                                            ; section
            .global RESET
RESET       mov.w   #__STACK_END,SP         ; Initialize stackpointer
StopWDT     mov.w   #WDTPW|WDTHOLD,&WDTCTL  ; Stop watchdog timer

                                            ; Main loop here
            bis.b #01h, &P1DIR
            bis.b #01h, &P1OUT
;           Stack Pointer definition
            .global __STACK_END
            .sect   .stack

;           Interrupt Vectors
            .sect   ".reset"                ; MSP430 RESET Vector
            .short  RESET
  • \$\begingroup\$ When you say that execution begins at 0x0000, is that after you load the program, or after you reset, or after you click the Run button? \$\endgroup\$
    – Adam Haun
    Dec 8, 2014 at 3:01
  • \$\begingroup\$ @AdamHaun, If I push the "bug" button, then the "play" button, it will start running at 0x0000. \$\endgroup\$
    – The Photon
    Dec 8, 2014 at 3:41
  • \$\begingroup\$ Also if I push the "bug" button, then "Reload Program", then "Resume" (the play button). \$\endgroup\$
    – The Photon
    Dec 8, 2014 at 3:44
  • \$\begingroup\$ If I push the bug button, then set PC to RESET, then press play, the program runs. \$\endgroup\$
    – The Photon
    Dec 8, 2014 at 3:46

1 Answer 1


I haven't programmed an MSP430 in assembly, but it seems like the program entry point is not written to the address 0xFFFE:

Program counter (PC) is loaded with the boot code address and boot code execution begins at that address. See Section 1.9 for more information regarding the boot code. Upon completion of the boot code, the PC is loaded with the address contained at the SYSRSTIV reset location (0FFFEh).

So from your description, you are using --entry_point= global_symbol as an option to set the entry point. I can't really see why that wouldn't work, have you checked the actual linker call if that option is applied?

So another option would be to write to the address 0xFFFE the value of your start address. Or at least check in your resulting hex image what value gets written there.

I just found this:

    MEM : origin = 0x0200, length = 0xFDFD
    RESET : origin = 0xFFFE, length = 0x0002
    .text : {} > MEM
    .const : {} > MEM
    .data : {} > MEM
    .bss : {} > MEM
    .reset : > RESET
    .cinit : {} > MEM ;cflag option only
    .pinit : {} > MEM ;cflag option only

as the default placement. So maybe because you also named you label RESET the linker gets confused in some way? Maybe name your entry point differently like START or ENTRY. But this also gives a hint how to get the actual address where you want it. You just have to define a 16 bit constant to be placed in the .reset section.

It's strange how different the TI assembler is from the IAR one, with which I'm a bit more familiar.

  • \$\begingroup\$ I will give this a try on Monday. \$\endgroup\$
    – The Photon
    Aug 22, 2015 at 21:27
  • \$\begingroup\$ Kicking ass on the msp430 questions @Arsenal \$\endgroup\$
    – Passerby
    Aug 22, 2015 at 22:12
  • 1
    \$\begingroup\$ @Passerby thank you - I guess :D I've worked a bit with the MSP430 and in my last project quite a lot with some linker and placement struggles (on a different controller but meh, can't be all that different here...) \$\endgroup\$
    – Arsenal
    Aug 22, 2015 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.