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.

Unable to erase flash

Other Parts Discussed in Thread: DRV8848

Hello there!

I have a problem with a board I developed based on F5659. It used to work very well
as it usually does. But since yesterday I experience problems when loading my program
to flash (I'm using IAR, the latest version).

Everyime I try to load my program to the chip, it says:
Could not erase device memory : (Erase) type = 0c01, address = 0x8000, length = 0x80000

I have verified that:

- the board voltage is fine (3.3V)
- the board voltage is fed back to the emulation tool
- the reset signal is sent (about 6 ~ 8 ms)
- There is a kind of signalling on TDI, TDO, TMS, TCK

Beside this, the same problem happens on all my boards (I have made 10 of them).

Another disturbing fact:
I have tried to modify the FET debugger preferences because I read some feedback about
it. It does nothing in my case. The voltage preferences have no invluence (override default
and set 3.3V), manual selection -> 4 wire JTAG.

I know that the boards are not fried because I can compile the program, make extra output,
and load the file using TI's field upgrade utility by USB.

And last thing I just noticed: If I select "attach to running target" in the preferences,
then connect (ctrl D), then the debugger is connected to the program. At that point, if I stop the
program, unselect "attach to running target" and then re connect (again ctrl-D), then
the new program is loaded (no erase problem anymore) and I can debug.
Then the subsequent stop, correct and reload all work as they used to.
But if I stop IAR completely or unplug the target, then I will back into the same
situation. So basically the IDE start up is as follows:

- Start IDE;
- Open preferences;
- Check "attach to running target"
- Control-D to go to debug mode
- Stop the program
- Reopen preferences
- Uncheck "attach to running target"
- Then ctrl-D to reload the new program

Does anyone know about this problem? Is there a better way than my workaround?

By the way, I have verified on CCS that I can't erase the flash either.


Thanks for any hint,

Pascal

  • Hi Pascal,

    Could you try reducing the Target Voltage and check, if it works.
    I think, a Target voltage of 2.7V should work (may be even 2.8V might work).
    Please let me know if it works.

    Regards,
    Venu
  • Hello Venu,

    Thanks for your reply, but... why should I reduce the target voltage?
    MSP430 is supposed to work at 3.3V, and there is nothing in the specs saying that I should program it at
    2.7 or 2.8 volts, is there?
    Beside this, the target voltage cannot be changed. I am also using peripheral circuits working at 3.3V, especially
    a motor driver DRV8848 (also from Texas), the voltage of which should be at least 3.13V and less than 3.47.
    And on the board itself, there is a 3.3V regulator (fixed) that powers MSP430.
    I have also tried to use a flash writer / reader from Elprotronic. In this case, I can perfectly program the chip,
    so I guess there should be a way to program the chip directly from IAR or CCS.

    Pascal
  • Pascal4275 said:
    I can perfectly program the chip, so I guess there should be a way to program the chip directly from IAR or CCS.

    To try and identify the cause of the problem in CCS you could enable Debug Server Logging, as explained at http://processors.wiki.ti.com/index.php/Troubleshooting_CCSv6#Debug_Server_Logging  and attach the log file for when CCS fails to erase the flash.

  • Hi Pascal,

             You are right in saying that the device is supposed to work fine at 3.3V (There is no restriction from spec).

    This was only a sanity check (which helped in a different case, where the issue is still under debug).

              I understand that you cannot change the Voltage.

    Could you please check if your problem is solved with the Debug stack v3.4.2.7?

    http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/DLLv2/3_04_001_000/index_FDS.html

    Regards,

    Venu

  • Hello!

    Sorry for the delay, I think I found the problem. I'm running programs from RAM.
    I made a kind of scripting language which converts an input file into pseudo-code,
    and then I'm running this pseudo code.
    The problem was (I think) that when powering the board, before the FET tool could
    reset the board and load the new program, the old one was already running something
    that prevented the program to load. Well, that's just a blind assumption, but
    if I use a board in which the faulty program has never been loaded, then I don't
    hace the problem. If I use the TI USB utility to remove the faulty program, then
    I can use the board again.

    That's about it. I will try to continue and enable run() when I have a stable script parser.

    Pascal

**Attention** This is a public forum