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.

Flash program disappears from MSP430 5 Series!

Other Parts Discussed in Thread: MSP430F5326

I am facing a strange problem. The program written to Flash using launchpad SBW runs perfectly but it disappears when I disconnect the power and reconnect it. 

I am using MSP430F5326 and 24. Programming is in system programming on a custom card via launchpad. 

The circuit is not new and other boards of the same design do retain the program without any issue. However I cannot understand why 2 pieces of the same board are exhibiting this problem. I have replaced the MCU's 3 to 4 times. 

I am only using the launchpad for power although the board has power input, I am not using external power for debugging this problem.

I also notice that the MSP runs a bit warmer.

What could possibly cause this issue? 

When the program is originally written, it works fine any number of times until I disconnect the power. On reconnecting the power the code does not start at all and I have to reprogram the MCU and again it works fine until I power it down and again the programming seems lot when power is applied next.

  • I do not think the Flash program really "disappears". Probable those two boards have some kind of fault and the program cannot run without the debugger attached.

  • No, that is not the case. For debugging purpose I am running a tiny application which after turning off the Watchdog sets all GPIO pins (PA-PC) to OUTput and LOW (GND). This turns on a few LEDs on the board. This debug application does nothing else and yet when I pull out power and turn it on, the LEDs do not come back on.

    I want to know if there is any case in which the MSP would mark the Flash as corrupt or erase it due to power supply issues or any such possible circuit problem.

  • Mohammed Lokhandwala said:
    the LEDs do not come back on.

    This still does not prove that Flash is erased. Most probably your program does not run because CPU does not power-on reset properly. Actually problem "it works only while connected to FET" is very common here in this thread. Try using search.

    Usually it's reset circuit fault or running cpu out of spec which can happen if you don't wait for VCC to ramp-up to nominal level before changing it's clock frequency.

    Mohammed Lokhandwala said:
    I want to know if there is any case in which the MSP would mark the Flash as corrupt or erase it due to power supply issues or any such possible circuit problem.

    To verify that you indeed lost flash, use your debugger in "attach to target without flash programming" mode and look - does flash is erased indeed. Most probably you will find your program there :)

  • The problem is persisting, I have this additional information :

    1. The original application uses Sys/BIOS. So it would be initializing everything properly and we have to note that it does work fine on other boards.

    2. The Debug application is practically 10 lines with no clock changes. Just GPIO set to low and Select set to 0. and Direction set to out for all ports all pins.

    3. We removed 1 connection at at time and noted that the MCU freezes when the SBWTCK (Spy by wire - Clock signal pin) is removed. If all other pins are removed (+VE, GND, SBWTDIO) there is no effect.  Does this indicate anything? The pins are directly connected to the MCU. 

    4. The board works as long as the SBWTCK is attached even if the power source is from the boards LDO and not from launchpad (as explained in 3 above also).

    Any help or hints would be highly appreciated.

  • Did you look at program flash using debugger in "attach to target, don't flash code" mode?

    Please describe reset and test/sbwtck pin circuits.

    Mohammed Lokhandwala said:
    3. We removed 1 connection at at time and noted that the MCU freezes when the SBWTCK (Spy by wire - Clock signal pin) is removed. If all other pins are removed (+VE, GND, SBWTDIO) there is no effect.  Does this indicate anything?

    Indeed. You possibly let msp430 to go into BSL sequence by doing this. No wonder your code stops

  • I will look into the Attach to Target and post an update, however even assuming that removing the SBWTCK while the program is running does cause problems, it does not explain why this problem is seen if the program has been installed. and then the board is powered down and then all connections from Launchpad removed and then powered back up! As stated previously the power supplied from Launchpad is not needed to keep the circuit running because when we remove the +ve & gnd but keep the SBWTCK connected, the board works fine. Not to mention that other physical boards do not show this problem at all.

  • Mohammed Lokhandwala said:
    it does not explain why this problem is seen if the program has been installed. and then the board is powered down and then all connections from Launchpad removed and then powered back up!

    Sure. Because cause of the problem "does not work" could be different. Removing sbwtck possibly causes BSL but powering on possibly causes other issue like improperly reset microcontroller. Indications are the same - it does not work.

**Attention** This is a public forum