• Not Answered

How to erase flash memory after a mistake ?

Hi,

I have made a board with a MSP430F1222. Everything was going right but while doing some modifycation of the software, le MSP430F1222 stopped to respond to BSL request and to J-Tag.

I think I have find out why : I have enable WDTNMI on the WDTCTL register so now the RST/NMI is not used for the reset... And it is enable right at the start.

Is there a way to erase the flash memory in this condition ?

There is always the possibility to replace the MSP430F1222 by a new one but I will have to send it back to my subcontractor, and I want to save some time.

Thanks.

21 Replies

  • Expert 1620 points

    Do you have a LaunchPad and a spare G2xxx (any one of them) chip?

    If so, I think I have a way to erase your F1222 (or other similar chips) using the above.

  • Bruce ROLLAND
    I think I have find out why : I have enable WDTNMI on the WDTCTL register so now the RST/NMI is not used for the reset... And it is enable right at the start.

    This is bad, so the BSL cannot reset the chip (RST is not recognized).

    The only way out is some additional hardware on the RST pin. It needs to hold RST low after power-on until the 'real' RST signal is pulled low and released.

    This way you can do a power cycle (which will keep the MSP in reset afterwards) and when the BSL scripter finally toggles the RST line, it will release teh MSP at the same moment it will get the BSL entry sequence.

    Alternatively, a change of BSL scripter would do that keeps the reset lien low, waits for a keypress (allowign you to do a power cycle while RST is still pulled low) and then enters BSL sequence. But AFAIK, nobody wrote this or extended the scripting protocol to support such a behavior.

    _____________________________________
    Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
    If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

  • In reply to Jens-Michael Gross:

    JMG,

    You are correct. The LaungchPad and the code I wrote do precisely that.

    OCY

  • In reply to old_cow_yellow:

    HI,

    Since the MSP430 is soldered on the card, I will need to remove it to use a LaunchPad or to do any hardware modification. It will be more simple to just change the chip for a new one.

    At least, now I'm sure of the problem so I will not be worry to try out the corrected program.

    Thanks for all the answers.

  • In reply to Bruce ROLLAND:

    I know your MSP430 is already soldered to a board. And I think you can connect that board to a PC with some kind of external hardware interface for BSL or JTAG. But both BSL and JTAG do not work anymore due to the code in FLASH that assigns nRST/NMI to NMI mode. Is my understanding correct?

    If so, you can use the LaunchPad with its own G2xxx chip running my code as that external hardware interface, and you can run PC BSLDEMO2 to re-program your MSP430 chip while it is still soldered on your board. The LaunchPad is used is not used to hold your MSP430 chip. It is used as an interface between your board and the PC.

  • In reply to old_cow_yellow:

    I just made the same mistake on MSP430F1611. So the conclusion is that it cannot be reprogrammed without external hardware?

  • In reply to Xiaohui Liu1:

    Xiaohui Liu1

    I just made the same mistake on MSP430F1611. So the conclusion is that it cannot be reprogrammed without external hardware?

    Any MSP430 cannot be programmed or re-programmed without external hardware. Most, if not all, "programmable device" cannot be programmed without external hardware.

  • In reply to old_cow_yellow:

    Hi OCY,

    I guess you are hinting at app note "SLAA535 - MSP430 Launchpad UART BSL Interface".

    i read in one of the forums where you've mentioned that you had written a similar code to the above app note which can be used to program MSP430s which support UART BSL thru launchpad.

    Can you post your code, it can benefit others.

    Regards,

    Nura

  • In reply to old_cow_yellow:

    Sorry about the confusion. I'm using a sensor platform called TelosB, based on MSP430F1611By "without external hardware", I mean with usb cable only as shown here. Normally, TelosB can be programmed using bsl with usb cable connected. I'm just wondering if it is still possible to program it in the presence of the mistake using the same tools (i.e., bsl and usb).

  • In reply to Xiaohui Liu1:

    Both the "BSL Scripter" and the "BSLdemo2" PC programs from TI cannot handle chips that has existing Flash images with certain problems (such as yours). You can modify those PC programs and then BSL will work.

    I did not try to modify the PC programs, but use the $4.30 LaunchPad to work-around it.