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.

MSP430F5638: MSP430 Load Program Error

Part Number: MSP430F5638
Other Parts Discussed in Thread: MSP-FET, , UNIFLASH

Using CCS ver. 12.8.1 & MSP-FET

Custom SBC using MSP430F5638. Built two PCB’s about 5 years ago. Have been doing all software development as needed on these two boards. Software includes different versions of the larger overall application, and a smaller testbed where I can test just specific MCU peripherals, or external hardware on the SBC. I’m only using about half of the FLASH, and data RAM capacity.

In the past, I sometimes would get Load Program errors < 5% of the time. Retry loading, or power everything down & back up, normally fixed the problem.

In the past few months, I can only load programs successfully about 5-10% of the time. Have tried numerous things to fix this, and occasionally they work, but usually only one or two successful loads, then it’s back to the Load Program error.

Write / Erase cycles for the MSP430 is supposed to be 10,000 to 100,000 cycles. I may have hit 10,000 program loads, but I’m sure I’ve not hit the 100.000 mark.

Typical error message (usually without the halting CPU error) - the reported address varies.

MSP430: Trouble Halting Target CPU: Internal error

MSP430: File Loader: Verification failed: Could not write 0x08000: execution state prevented access

MSP430: GEL: File: D:\Product\DIGS\Code\DC2\MCU1-430\430-Main\DC2-430-All-02\Release\DC2-430-All-02.out: Load failed.

Some Tests

Checked power supply voltage, it’s good = 3.30v

Tried a fresh download & install of an older version of CCS 12.7.0 - worked perfectly one or two times, then get Load Errors.

Tried two different MSP-FET’s, both work the same.

Questions

1 - Have these MSP430’s reached FLASH end of life?

2 - If so, why doesn’t it fail 100% of the time, instead of 90 - 95%?

3 - Only fix is to replace the MCUs?

4 - Could be a partial erase problem. How can I do a mass erase of FLASH, to ensure that isn’t the problem?

5 - Would CCS 20.3 help with this problem?

  • Erase/write cycles is 10K minimum, 100K typical. It could go for a lot more but 10K is all you can count on. But randomly being able to program the device suggests this isn't the problem.

    More likely is some aspect of the programming interface that was marginal and only now is reaching up to bite you. I see that this part does both standard JTAG and Spy-By-Wire. The later has a sharp limit on capacitance on the reset pin. In any case, if the hardware supports it, try both.

  • Thanks for the info, will look into Spy-By-Wire. How do I do a mass erase of flash, would like to try that too.

  • I know nothing about CCS but the mspdebug erase command has options to control what is erased including "all". For some value of all. I would be very careful with that. Verifying that it doesn't erase something useful like calibration constants first.

    Default is to erase all of code memory. Which is the normal thing to do. 

  • Hi Ted,

    To issue a Mass Erase to the device using CCS Eclipse please refer to this E2E thread.

    In CCS Theia, the view can be accessed from the following:

    • Go to Project->Properties->Debug->Category: MSP430 Flash Settings

    Best Regards,
    Brian

  • HI Brian,

    Thanks for the info, but I looked at the link and I don't see anywhere in CCS 12.8.1 where I can do a Mass Erase?

  • Hi Ted,

    My apologies for the confusion, this appears to be a limitation of CCS 12.8.1. I did find an alternative way to perform a mass erase. This involves using Uniflash. After a session is started, you can perform a Mass Erase from within the "Settings and Utilities" tab.

    Best Regards,
    Brian

  • Thanks Brian, I'll look into that

  • Downloaded & installed Uniflash, connect to my SBC via USB & MSP-FET. It sees the MSP430F5638 and can do a Mass Erase. But I'm still getting the Load Program Error with Uniflash when I load, or verify

  • Hi Ted,

    Can you try the loading the following SDK example?
    MSP430F66xx_1.c.zip

    Best Regards,
    Brian

  • Hi Ted,

    Can you try to read back all flash data after mass erase?

    I am think if the flash endurance exhausted, they the flash not all 0xFF, then when you download new image, maybe will trigger load error. 

    Another point, as Brian mentioned, you can try our example to see if image have some issue, but I think this probability of this is very low.

    Thanks!

    Best Regards

    Johnson

  • Thanks Brian & Johnson,

    I've run into another problem - CCS can't find make - but I fixed that (another E2E post). At this point, I've tried so many things to fix the Load Program Error, the project is corrupted, CCS builds can't see any changes - so I will have to recreate the project. When done, I will try loading the SDK example above.

    I suspect the resistor & cap in the reset circuit, will try replacing them.

    What would memory look like, if the MCU has reached write / erase EOL?

  • Hi Ted,

    When surpassing the 10K W/E cycles, the flash is not guaranteed, and write/erase/read times will go out of specs.

    Best Regards,
    Brian

  • I suspect the resistor & cap in the reset circuit, will try replacing them.

    What would memory look like, if the MCU has reached write / erase EOL?

    F5xx are with internal pull up on reset pin, so it should work without external one. Also capacitor on RESET pin will "fight" against SBW signal. Without both (RC combination) SBW should work just fine.

    F5xx are with marginal read support, so in case of some problems during flashing (for example bad flash cells, even verify after flashing is just fine without errors) there will be marginal read errors. Don't know if this is supported by tools that you are using.

  • Thanks Zmo,

    Please clarify, I'm using JTAG not SBW, are you saying I do NOT need the resistor & capacitor in the Reset circuit?

  • RESET pin is used for data exchange between SBW master and target device. Every time during state change from zero to one or opposite, capacitor on target device RESET pin is charged / discharged. Higher capacitance in combination with higher SBW interface speed will fail.

    5xx/6xx family should work just fine in not noisy environment with stable power supply without RC combination on RESET pin.

    However, you are using JTAG and my notes (related to RC on RESET pin) are irrelevant in this case. Still marginal read can be used for checking if after mass erase or writing all flash memory cells are OK (data retention). Even if marginal read is not supported by JTAG master (or msp430.dll), marginal read program can be downloaded to device RAM, and executed from there. It is covered by slaa729.

  • Thanks Zmo,

    I have a 3rd PCB which is working fine with CCS 12.8.1 & my MSP-FET for both my main & testbed MSP430 code - no Load Program Errors. I'm going to experiment with removing & replacing both the resistor & capacitor in the Reset circuit on the 2 problem PCB's. If that does not work, I'll replace the MSP430's.

**Attention** This is a public forum