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.

Erasing Flash failed when debugging using the ICDI

Other Parts Discussed in Thread: LMFLASHPROGRAMMER, EK-TM4C1294XL

Hi,

Iam using TM4C1294XL Launchpad and ICDI for debugging purpose.

I am suppose to write SysCtlClockFreqSet() function and 25MHz crystal freq. but I wrote SysCtlClockSet() function and 16Mhz crystal freq.

Below are the function calls - 

SysCtlClockSet(SYSCTL_SYSDIV_5 |SYSCTL_USE_PLL |SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);   // Wrong instruction

SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);   //Correct instruction

 

Now after loading the code with wrong instruction, board is not allowing to load any other code. Showing "CORTEX_M$_0: Flash Programmer: Erasing all of the flash contents failed !" this error while debugging.

How to resolve this problem?

  • sandeep choudhary said:
    How to resolve this problem?

    Try using the "Debug Port Unlock" facility in LMFLASHPROGRAMMER.

    It sounds like the code which has mis-configured the system clock has locked-up the device, and the "Debug Port Unlock" performs a complete erase of all non-volatile data which should allow you to recover the device.

    Note that a "Debug Port Unlock" will erase the non-volatile registers which store the Ethernet MAC address. LMFLASHPROGRAMMER allows to you re-program the MAC address after the Debug Port Unlock has been completed.

  • Hi Chester,

    I tried the solution provided by you. Following are the steps I performed -

    1)Connected the Launchpad using the USB cable for debug.
    2) Started LM Flash Programmer
    3) Opened the other utilities tab and pressed the Unlock button.
    4) After the message is prompt, I asserted the Reset button and power it up.
    5) I released the Reset button when the respective message is displayed.
    6) After that I power cycled the launchpad.

    After performing above steps , still the launchpad is showing same errors during debugging. Can you tell me If any step in my procedure is wrong or missing.
  • sandeep choudhary said:
    After performing above steps , still the launchpad is showing same errors during debugging. Can you tell me If any step in my procedure is wrong or missing.

    I can't see any step missing. After performing step 6, if you attempt a "Blank Check" of the Entire Flash from LM Flash Programmer does LM Flash Programmer report if the flash is blank or something else?

    If the Unlock was successfully LM Flash Programmer should report the flash is blank.

  • sandeep choudhary said:

    SysCtlClockSet(SYSCTL_SYSDIV_5 |SYSCTL_USE_PLL |SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);   // Wrong instruction

    SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);   //Correct instruction

     Now after loading the code with wrong instruction, board is not allowing to load any other code. Showing "CORTEX_M$_0: Flash Programmer: Erasing all of the flash contents failed !" this error while debugging.

    I tried repeating the fault, by taking a working program for a EK-TM4C1294XL and changing the call from SysCtlClockFreqSet() to SysCtlClockSet().

    While using the wrong call stopped the program from working I wasn't able to repeat the "CORTEX_M4_0: Flash Programmer: Erasing all of the flash contents failed !" error, and after reinstating the correct call to SysCtlClockFreqSet was then able to use the CCS debugger to reflash the program.