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.

Simple code does not work in MSP430FR5969, yet it does on the Launchpad

Other Parts Discussed in Thread: MSP-TS430RGZ48C, MSP430FR5969, MSP430G2553

Hello,

I have written a very simple code built on top of the blinking led example code included in CCS v5.3.0.00090. It creates a global char array with the string "Hello World" on it, and it then copies the string using strcpy to another global char array. After that, it just blinks the LED. This code works when I run the debugger on the Launchpad with an MSP430G2553, but when I try to debug it on an MSP430FR5969 using the MSP-TS430RGZ48C rev 1.1 board and an MSP-FET430UIF, it does not work. It seems to never enter the main function since it never let's me single step the device. If I hit the suspend button, it gives me an error: Can't find a source file at "/tmp/TI_MKLIBaXqLbT/SRC/copy_decompress_rle.c"

Any idea on what's happening?

Thanks!

#include <msp430.h>
#include <string.h>

char helloWorld[] = "Hello World";
char helloWorldCopy[20];

int main(void) {
	strcpy(helloWorldCopy, helloWorld);

	WDTCTL = WDTPW | WDTHOLD;		// Stop watchdog timer
	P1DIR |= 0x01;				// Set P1.0 to output direction

	for(;;) {
		volatile unsigned int i;	// volatile to prevent optimization

		P1OUT ^= 0x01;			// Toggle P1.0 using exclusive-OR

		i = 10000;		// SW Delay
		do i--;
		while(i != 0);
	}
	
	return 0;
}

  • I also tried to run one of the MSP430FR5969 examples, named "msp430fr59xx_framwrite.c". It does not work either, hanging before entering the main function. Any ideas?

    #include "msp430.h"
    
    void FRAMWrite(void);
    
    unsigned char count = 0;
    unsigned long *FRAM_write_ptr;
    unsigned long data;
    
    #define FRAM_TEST_START 0xD000
    
    
    int main(void)
    {
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
    
      // Turn on LED
      P1DIR |= BIT0;
      // Initialize dummy data
      data = 0x00010001;
    
      while(1)
      {
      data ++;
      FRAM_write_ptr = (unsigned long *)FRAM_TEST_START;
      FRAMWrite();                              // Endless loop
      count++;
      if (count > 100)
        {
          P1OUT ^= 0x01;                        // Toggle LED to show 512K bytes
          count = 0;                            // ..have been written
          data = 0x00010001;
        }
    
      }
    
    }
    
    
    void FRAMWrite (void)
    
    {
     unsigned int i=0;
    
      for ( i= 0; i<128; i++)
      {
        *FRAM_write_ptr++ = data;
      }
    
    }
    
  • Samuel Rodriguez said:
    If I hit the suspend button, it gives me an error: Can't find a source file at "/tmp/TI_MKLIBaXqLbT/SRC/copy_decompress_rle.c"

    Sound like it is crashing during the start-up code. Are there any warnings generated by the compiler or linker?

    (I don't have a MSP430FR5969 to test the examples)

  • Yes, I get 25 warnings, all of them about interrupt vectors not having interrupt handler routines, and 4 information Items, #1 No use of LPMs, #2 uninitialized Port A, #3 uninitialized Port B, and #4 detected loop counting up, recommended counting down.

    I do have an update. I tried using another MSP430FR5969 and it worked. I'm not sure about this, but it seems that the microcontroller was defective in some way. I noticed that the problem occurred when I tried accessing a variable that was defined globally.

    Description Resource Path Location Type
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "WDT" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 181 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "USCI_A0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 180 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "USCI_B0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 179 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "ADC12" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 178 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER0_A0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 177 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER0_A1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 176 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "USCI_A1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 175 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "DMA" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 174 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "SYSNMI" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 186 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "UNMI" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 185 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "COMP_B" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 184 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER0_B0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 183 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER0_B1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 182 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10372.html">#10372-D</a> (ULP 4.1) Detected uninitialized Port B in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins. FRAM write example C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10372.html">#10372-D</a> (ULP 4.1) Detected uninitialized Port A in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins. FRAM write example C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10371.html">#10371-D</a> (ULP 1.1) Detected no uses of low power mode state changes using LPMx or _bis_SR_register() or __low_power_mode_x() in this project. FRAM write example C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER2_A1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 169 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "PORT2" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 168 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER3_A0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 167 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER3_A1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 166 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER1_A0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 173 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER1_A1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 172 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "PORT1" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 171 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "TIMER2_A0" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 170 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/1544.html">#1544-D</a> (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier blink.c /FRAM write example line 111 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "AES256" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 162 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "PORT3" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 165 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "PORT4" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 164 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/MSP430/10374.html">#10374-D</a> Interrupt vector "RTC" does not have an interrupt handler routine. lnk_msp430fr5969.cmd /FRAM write example line 163 C/C++ Problem

  • Samuel Rodriguez said:
    Yes, I get 25 warnings, all of them about interrupt vectors not having interrupt handler routines, and 4 information Items, #1 No use of LPMs, #2 uninitialized Port A, #3 uninitialized Port B, and #4 detected loop counting up, recommended counting down.

    None of those warnings explain why the software would fail during start-up. Since the code doesn't enable interrupts having no interrupt handlers isn't a problem.

  • Samuel Rodriguez said:
    Yes, I get 25 warnings, all of them about interrupt vectors not having interrupt handler routines, and 4 information Items, #1 No use of LPMs, #2 uninitialized Port A, #3 uninitialized Port B, and #4 detected loop counting up, recommended counting down.

    Those are from the ULP advisor (you can switch it off to not get bothered).
    The no ISR warnings would be gread it they would only appear when an IE bit is set that has no ISR to handle the then coming interrupt. But to generally issue them for any possible ISR is a waste of screen space.
    The rest is about consuming lower power than with the default (whcih is chosen for signal safety at startup, not for lowest power), but unimportant for a hello world example.

    Samuel Rodriguez said:
    I tried using another MSP430FR5969 and it worked.

    So it's not the code. Unless you uploaded teh ALunchpad version of the code to the 5x device and caused an eternal reset loop. THings like this can happen when including the wrong include files or having the wrong project settings.

    In this case, the MSP can often be mass-erased using the BSL, to get rid of the wrong code.

    It's difficult to permanently damage an MSP by software alone. (It's not easy to damage it even by applying inverse supply voltage or doing other things - the MSPs are real die-hards)

  • Hi, try to write your first code like this:


    #include <msp430.h>
    #include <string.h>



    int main(void) {
        strcpy(helloWorldCopy, helloWorld);
        PM5CTL0 &= ~LOCKLPM5;            // Clear locked IO Pins

        WDTCTL = WDTPW | WDTHOLD;        // Stop watchdog timer
        P1DIR |= 0x01;                // Set P1.0 to output direction

        for(;;) {
            volatile unsigned int i;    // volatile to prevent optimization

            P1OUT ^= 0x01;            // Toggle P1.0 using exclusive-OR

            i = 10000;        // SW Delay
            do i--;
            while(i != 0);
        }
        
        return 0;
    }

  • It sounds like you are making a suggestion. Do you have a question? Or, are you just making a comment?

    Note that the thread you respond to is over a year and half old.

    The code you suggested is the same as what Samuel Rodriguez posted on 3/28/2013.

    Jens-Michael Gross did not post any code on 4/3/2013.

**Attention** This is a public forum