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.

MSP430 doesn't start a debug session; assembly code is not correct

Other Parts Discussed in Thread: MSP430F1222

Hi,

I am using MSP430F1222 with MSP-FET430UIF debugger and IAR.

compilation and linking is fine.

I am using the debugger power source for the chip so I chose the  "attach to running target" option. the voltage read is OK.

download the firmware and verification to the chip is displayed fine so I assume all the connections are OK.

the problem is that after downloading the firmware the IAR doesn't jump to main(), waiting for me to press F5 button to start running.

the assembly code that is shown on the disassembly window doesn't seem to be correct.

what may be the problem?

  • At the beginning, did you create this project yourself? You probably did not set it up right.

    It is easier if you use the project template to set up a new project. In your case, it seems you want to use c-main.

  • Thanks for your answer.

    At the beginning I created an "empty project".

    Now, I created a new project using "c-main" and it still doesn't work.

    The debug window announce me "warning: download and debug with attach to running target option".

    The disassembly window shows all 0xFFFFFFFF.

    It still doesn't jump to main().

  • Try uncheck the box "Attach to running target" in the setup.

    The reset vector at 0xFFFE and 0xFFFF should point to the c-startup routine. The debugger should have already executed the c-startup and stops after it calls main(). It should also show you the disassembled code around the beginning of main()

  • When I uncheck "Attach to running target" the download verification fails and with it it works fine.

    The value at address 0xFFFE (?reset vector) is F000 meaning instruction "and.w PC,pC"

  • ALON TALER said:
    The value at address 0xFFFE (?reset vector) is F000 meaning instruction "and.w PC,pC"

    the reset vector contains an address and not an instruction. 0xf000 is the position of the startup code. (and also likely the beginning of flash memory area, but that's rather coincidental).
    On a reset, the boot code performs an implicit MOV &0xFFFE, PC after the peripherals have been initialized.

    ALON TALER said:
    When I uncheck "Attach to running target" the download verification fails and with it it works fine.

    'Attach to running target# tells the debugger to just load the debug session data and assume the MSP already has the software loaded and is already running it. Which it apparently didn't.

    However, the verification shouldn't fail.

**Attention** This is a public forum