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.

How to erase flash memory after a mistake ?

Other Parts Discussed in Thread: MSP430F1222, MSP430F1611

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.

  • 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 said:
    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.

  • JMG,

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

    OCY

  • 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.

  • 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.

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

  • Xiaohui Liu1 said:

    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.

  • 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

  • Sorry about the confusion. I'm using a sensor platform called TelosB, based on MSP430F1611. By "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).

  • 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.

  • Seems LaunchPad is the way to go.

    After I get the launchpad, how can I use it to reprogram my TelosB mote, on which MSP430F1611 is soldered? Is there any other tool I need, software or hardware? My background is from Computer Science and I don't have much experience dealing with hardware. I would greatly appreciate if anyone can offer me some detailed instructions.

  • Leo ( http://e2e.ti.com/members/1631351/default.aspx ) is the author of "SLAA535 - MSP430 Launchpad UART BSL Interface". I will send my code to him to handle it.

  • I bought the launchpad and am following slaa535a, but I cannot find any pin in the MSP430 target as shown in Figure 5, such as /RST and TCK, on my sensor platform. Does this method of reprogramming MSP430 apply for my platform? If yes, can anyone please give me some suggestions on how to reprogram? Thanks.

  • For MSP430F1611, the /RST pin is pin #57. If your "platform" works at all with a MSP430F1611, it must have that signal somewhere.

    BTW, the firmware of slaa535a has the same defects as other BSL and cannot do BSL with your MSP. I have a different firmware and have already informed Leo. He said he will update slaa535 when he gets a chance to do it.

  • I find it through the expansion pin. 

    Can you please share a copy of the firmware to xiaohui@wayne.edu? Also, in slaa535a, I didn't find 1611 in test devices, only 1612. Are their connections the same? If not, what is the connection for 1611?

    Thanks.

  • For MSP430F1611, I want to connect it to the launchpad, however, I can't find the hole in EXPANSION or JTAG that connected to pin # 13(P1.1) and #22(P2.2) which I should use to connect the launchpad.  There are only UART1TX and UART1RX in MCU, while UART0TX and UART0RX in EXPANSION. How could I do with this?








  • Qing Ai said:

    For MSP430F1611, I want to connect it to the launchpad, however, I can't find the hole in EXPANSION or JTAG that connected to pin # 13(P1.1) and #22(P2.2) which I should use to connect the launchpad.  There are only UART1TX and UART1RX in MCU, while UART0TX and UART0RX in EXPANSION. How could I do with this? 

    You only identified MSP430F1611. It is a chip and has 64 pins. There are no hole or EXPANSION on this chip. You must meant some kind of board with a MAP430F1611 on it. There are many such boards. Without identifying the board you are using, no one can help you. You need to find the schematics, layout and other documents.

  • If the BSLRX (F1611 Pin#22) is already driven by NC7WZ126 Pin#6, how could it be disconnected before driven by the BSL-Bridge?

  • So, you are talking about the telos-verv-20040-9-27 board. Are you take for granted that others must know about that?

    I have no idea how that board is constructed physically. Conceivable you can do one of the following:

    (a) unsolder and lift pin #6 from its solder pad to disconnect -- and re-solder it back to restore the connection

    (b) cut the PCB trace leading to that pin to disconnect -- and patch it up later to restore the connection

    (c) unsolder and lift pin #1 and connect pin #1 to ground to disable pin #6 -- reconnect pin #1 to Vcc to re-enable pin #6

    (d) cut PCB trace of pin #1 and connect pin #1 to ground to disable pin #6 -- reconnect pin #1 to Vcc to re-enable pin #6

  • Sorry, I have no idea about all these. I actually even don't know how to ask questions properly since I never use it. But the problem happened to me. However, thank you very much for your advises

  • Thanks for all who participate in this discussion. It works for my MSP430F1611 and I list the complete guide to recover here. Can someone please mark this question as answered?

**Attention** This is a public forum