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.

MSP430F5438A with IAR_Program exit reched

Other Parts Discussed in Thread: MSP430F5438A

Dear Sir/ Madam,

we are using MSP430F5438A board with IAR IDE.

when we download and debug the program, we are getting "Program exit reached" (code is not dumping into Micro controller).

i am attaching snap shot.

Thanks in advance.

  • So what is the problem? I see none. You have return 0; in your code so main function is returning to whatever code called it. In most cases there is only infinite loop after main (jmp $).

    Regards,
    Maciej 

  • when i try to dump the code, it is not able to dumping into Micro controller. every time in IAR it is showing "Program exit reached. "

  • K VIJAYA RAM BHARADVAJ said:
    when i try to dump the code, it is not able to dumping into Micro controller.

    Can you please rephrase. I have no idea what you want to do.

    Regards,
    Maciej 

  • Hi,

    You have not told your program to loop indefinitely, so when it gets to the end of main and hits return 0, the program ends. Then IAR states "program exit reached."

    So the program is actually loading and running - but it only runs through once, hits the return, and ends.

    Most of the time in a microcontroller project, that's not what you want to happen - instead, you would typically put a while(1) loop that contains the code that you want to run/repeat forever in the MSP430. If you see any of the MSP430 code examples, this is how they are written - they have a while(1) loop that contains the main code. You might want to look at msp430x54xA_1.c in the code examples I linked - it loops forever toggling a pin.

    One other thing - if you are saying that you don't see anything happen on your MSP430 device you have connected to your computer while you step through your code, a common issue is that IAR defaults to running the code on a simulator rather than actually loading it on a device. So you need to go into Project > Options > Debugger and on the Setup tab select FET debugger in the Driver dropdown (instead of Simulator, which is default).

    Regards,

    Katie

  • Problem was solved..

    Thank you. 

**Attention** This is a public forum