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.

Run time Issue with MSP430FR6989 while trying to run / debug source code

Other Parts Discussed in Thread: MSP430FR6989

Hi,

I am Unable to run source code on msp430fr6989 and stop at main function in IAR workbench, As i can do this with simulator mode but not in FET debugger mode where i try to run it on board.

Problem:

Source code is not working when porting to the development board of "msp430fr6989". It is going to infinite loop at 

ENTRY                                          ADDRESS                  REF BY
=====                                              ======                     ======
__data16_memzero                    F480                          ?cstart_init_zero (?cstart)

could you please let me know what would be the problem?

Observations:

- I can able to run and debug the example projects on launch pad, but if the add API's from my source code it is unable to stop at main function/ debug.

- I tested with calling small function call like "multiplication". It is working fine. I feel there might be a run time memory issue or memory partitioning issue. 

Please help me to solve this.

  • Hi Veeraj,

    From what device are you porting this code? Have you only used the simulator to develop your APIs? You APIs could be preventing the MSP430FR6989 from disabling the watchdog timer before it is serviced, in which case you will never reach your main function. You should add in your APIs to working code one-at-a-time to see which combinations cause the issue described.

    Regards,
    Ryan
  • Hi veeratej,

    The error is occurring in the cstartup initialization code that runs before main, during the code that initializes uninitialized arrays/variables to 0 which is why the error mentions cstart_init_zero . By default, IAR causes all variables or arrays that aren't explicitly initialized to be initialized to 0 at startup, unless you use the __no_init keyword in IAR (see the IAR compiler reference under the Help menu in IAR). The problem is that if there is too much data getting initialized, this startup code can take too long to run and the WDT times out before you ever reach main to be able to disable it.

    See this FAQ entry as well: processors.wiki.ti.com/.../MSP430_FAQ

    You can solve this issue by either declaring some variables or arrays as __no_init, or by customizing the __low_level_init() function to stop the watchdog timer. __low_level_init() is called before the variables are initialized so it will solve the problem even if you do have a large amount of data that needs to get initialized in the cstartup code. You can find more info on __low_level_init() in the IAR compiler guide as well.

    Regards,
    Katie
  • Hi Katie,
    Thanks for your reply, There is no error occurred during compilation, the format i mentioned in the post was taken from .map file for understanding of where the program is going to infinite loop at that address. still I can able to run the code but it is going to infinite loop at __data16_memzero, ref by ?cstart_init_zero (?cstart). This observed while break the debug and check.


    Regards,

    Veeratej

  • Hi Ryan,
    I am porting to device MSP430FR6989 launch pad, I tried to place my source code API one at a time, (Note: all API's of my source code are large in size) It is not able to stop at main function still. I also placed small example function call to the example code "outofbox" that's working fine.
    I am not using watchdog timer in my API's. Please let me know if there is any watchdog timer issue from IAR compiler itself and how to solve this?
  • Hi Veeratej,

    The issue I mentioned in my previous post does not show up during compile time - you would not have a compiler error. Rather, you would see the device run but not stop at main just like you are describing. I'd recommend trying the __low_level_init solution that I mentioned and disabling the WDT in __low_level_init, and see if you are now able to make it to main.

    Regards,

    Katie

  • Hi Katie,
    Thank you, It's working now.

    Regards,
    Veeratej
  • Great! I'm glad to hear that fixed it :-)
    -Katie

**Attention** This is a public forum