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.

CCS/F28M36P63C2: Firmware update with DDS API Fails on C28 core

Part Number: F28M36P63C2
Other Parts Discussed in Thread: UNIFLASH, , CCSTUDIO

Tool/software: Code Composer Studio

Hello everyone,

I have written a small Java program, which is utilizing the DSS API from Uniflash 3.4.1.00012

This small program updates both the M3 and the C28 cores of a F28M36P63C2 microcontroller with a Texas Instruments XDS100v2 USB Debug Probe. However in some cases the C28 core update fails with the following error:

SEVERE: C28xx_0: Error during Flash programming (Flash algorithm returned error code). Operation cancelled.
SEVERE: C28xx_0: File Loader: Memory write failed: Unknown error
SEVERE: C28xx_0: GEL: File: C:\program_c28.out: Load failed.
SEVERE: File: C:\program_c28.out: Load failed.
SEVERE: Error loading “C:\program_c28.out”: File: C:\program_c28.out: Load failed.

com.ti.ccstudio.scripting.environment.ScriptingException: Error loading “C:\program_c28.out”: File: C:\program_c28.out: Load failed.

Here is the code snipet, which does the update.:

ScriptingEnvironment env = ScriptingEnvironment.instance();

DebugServer debugServer;
DebugSession dsM3;
DebugSession dsC28;
	
try {
    debugServer = (DebugServer) env.getServer("DebugServer.1");
        
    if (null != debugServer) {
        debugServer.setConfig(target_cfg_path);
    
        dsM3 = debugServer.openSession("Texas Instruments XDS100v2 USB Debug Probe_0/Cortex_M3_0");
        dsC28 = debugServer.openSession("Texas Instruments XDS100v2 USB Debug Probe_0/C28xx_0");
               
       dsM3.target.connect(true);
       dsM3.flash.erase();
       dsM3.memory.loadProgram(file_path_m3);
       dsM3.memory.verifyProgram(file_path_m3);
    
       dsC28.target.connect(true);
       dsC28.flash.erase();
       dsC28.memory.loadProgram(file_path_c28);	// <--The problem occurs during this call
       dsC28.memory.verifyProgram(file_path_c28);
		
       dsC28.target.runAsynch();
       dsC28.target.disconnect();
       dsM3.target.runAsynch();
       dsM3.target.disconnect();
   }
} catch (Exception e){}

On my PC it works fine most of the time. However on customer PCs and on Virtual PCs with the combination of some microcontroller instances the problem reported above occurs.

Do you have any idea what could cause this problem, or could you give me any hint regarding to this?

Thank you in advance!

Best regards,
Tamas

  • Tamas,

    The data verification error can be caused by a number of factors, especially when writing to Flash, which requires a complete Erase before write (which you are doing).

    Intermittent program load problems are usually tied to hardware - in my experience this is more common when:
    - communications are intermittent between the Debug Probe and the device (check cables and pull ups/downs)
    - power fluctuations on the target board (use an oscilloscope to track this)
    - ground loops between the host and the target board (use an isolated power supply or tie both GNDs)

    Uncommon scenarios are problems in the connection between the PC and the Debug Probe or an overall CPU load on the PC, which can affect "host-based" Debug Probes such as XDS100 or XDS510 (which have part of its logic done in the host).

    Your script looks fine but you can add an extra dose of safety by enabling the Full Verification to the code loading as shown below:

    debugSession.options.setString("VerifyAfterProgramLoad","Full verification");

    Despite this may bring additional occurrences of the error message, it will help fully validate your setup where the code may apparently load fine but it fails in an intermediate block of data. This will take some extra time to flash and can be disabled after the process is fully stabilized.

    Hope this helps,
    Rafael
  • Tamas,

    Few other things to consider:

    1) In cases when it fails, does it succeed with CCS or UniFlash instead of script?

    2) Unlock the zone first, if it is locked.

    3) Make sure the voltage lines are in correct range when the erase/program is in progress.

    4) Try below steps:

    Try connecting both cores first.

    Then issue a debug reset on both cores so that security initialization is done by gel file.

    Then do erase on both cores.

    Then try loading.

    Try adding some delay in between the steps to see if it helps.

    5) Also check this post:  https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/534630/1964695#pi316717=1 

    Thanks and regards,
    Vamsi

  • Hi Rafael,

    Thank you for your hints! They are using an isolated power supply. This could not be an issue. In the meantime I also got back some boards which were problematic on their side, however I was not able to reproduce the problem on my machine, except when I performed the update with a virtual PC (which is on my machine).

    Best regards,
    Tamas
  • Hi Vamsi,

    1) With CCS and UniFlash the update does always succeed. That is the workaround we apply currently.
    2) No zones are locked.
    3) Voltage lines seems to be in the correct range.
    4) I have tried your update sequence and it is very promissing. On a virtual PC which is installed on my machine I had the problem from time to time, but with your recommended update sequence I am not able to reproduce the error.

    Thank you for your help!

    Best regards,
    Tamas
  • Tamas,

    Glad that it is working now.

    Best regards,
    Vamsi