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/F28M35H52C: File Loader: Memory write failed: Unknown error (Linux)

Part Number: F28M35H52C
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

Hello!

To get straight to the point, I cannot load firmware on my target device using CCSv7 or UniFlash on Linux; I've tried on both Ubuntu 16.04.3 LTS and CentOS 7.4. However, I am able to load the same firmware files to the same target using CCSv7 and UniFlash on a Windows 10 machine running the same versions of CCSv7 and UniFlash. In all cases, I've tested with both an XDS100v3 and USB560v2.

Setup:

Host OS: CentOS Linux 7.4.1708.x86_64 running kernel 4.14.14-1.el7.elrepo.x86_64
Code Composer Studio Version: 7.4.0.00015
UniFlash Version: 4.2.1.1562
Debugger: XDS100v3 and USB560v2
Target: F28M35H52

Steps and logs:

  1. Connected USB to XDS100v3
  2. Check the USB dmesg logs via 'dmesg | grep -i usb':
    [15211.852945] usb 3-2.1.1: new high-speed USB device number 8 using xhci_hcd
    [15211.953637] usb 3-2.1.1: New USB device found, idVendor=0403, idProduct=a6d1
    [15211.953641] usb 3-2.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [15211.953643] usb 3-2.1.1: Product: Texas Instruments XDS100 Ver 3.0
    [15211.953644] usb 3-2.1.1: Manufacturer: TI
    [15211.953646] usb 3-2.1.1: SerialNumber: FTWQ56MD
    [15211.957698] ftdi_sio 3-2.1.1:1.0: FTDI USB Serial Device converter detected
    [15211.957748] usb 3-2.1.1: Detected FT2232H
    [15211.958632] usb 3-2.1.1: FTDI USB Serial Device converter now attached to ttyUSB0
    [15211.962069] ftdi_sio 3-2.1.1:1.1: FTDI USB Serial Device converter detected
    [15211.962129] usb 3-2.1.1: Detected FT2232H
    [15211.962706] usb 3-2.1.1: FTDI USB Serial Device converter now attached to ttyUSB1
  3. Attempt to load image (in this case the Cortex_M0_0, however loading to the Cortex_M3_0 core produces the same result). Here is the resulting output logs:
    [1/24/2018, 12:21:55 PM] [INFO] Cortex_M3_0: GEL Output: Memory Map Initialization Complete
    [1/24/2018, 12:21:56 PM] [INFO] Cortex_M3_0: GEL Output: Watchdog Timers Enabled
    [1/24/2018, 12:21:56 PM] [INFO] Cortex_M3_0: GEL Output: UARTs Enabled
    [1/24/2018, 12:21:59 PM] [INFO] Cortex_M3_0: Writing Flash @ Address 0x00200000 of Length 0x00000034
    [1/24/2018, 12:22:01 PM] [INFO] Cortex_M3_0: PLL configuration status = 1. PLL configured successfully.
    [1/24/2018, 12:22:01 PM] [INFO] Cortex_M3_0: Erasing Flash Bank 0, Sector N
    [1/24/2018, 12:22:01 PM] [ERROR] Cortex_M3_0: Flash Programmer: Error erasing Sector N. FMSTAT value = 0. Operation Cancelled (0).
    [1/24/2018, 12:22:01 PM] [ERROR] Cortex_M3_0: File Loader: Memory write failed: Unknown error
  4. Check for new messages in the USB dmesg logs via 'dmesg | grep -i usb':
    [15260.321047] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0

Here is the UniFlash gui debug log:

12:21:36:829 error - {}
12:21:36:976 log - NWAgentAPI: dinfraConfigue resolved successfully.
12:21:49:286 debug - Target Configuration. Device: f28m35h52c1, Connection: TIXDS100v3_Dot7_Connection, LP: false
12:21:49:549 debug - ufDS, session.configured, partnum of current session = f28m35h52c1
12:21:49:597 debug - addTargetStateListener on Cortex_M3_0
12:21:49:597 debug - addTargetStateListener on C28xx_0
12:21:55:173 debug - returning new configure
12:21:55:874 debug - configured
12:21:58:378 debug - connect to core Cortex_M3_0
12:22:01:996 error - File: /home/tpierson/Development/fw_ifp_gate_drive/ifp_gate_drive_m3/ccs/Release/ifp_gate_drive_m3.out: Load failed.

What strikes me as odd is in the USB message logs. Why is it that the FTDI USB Serial Device converter is getting disconnected after attempting to load the firmware image?! Is this normal behavior? At this point I cannot tell if this is a problem with my system or the development tools.

Thanks,

Tristen

  • Hi Tristen,
    I tried this out on my Ubuntu 16.04.3 LTS laptop without issue. I used the F28M35 control card with the onboard XDS100v2.

    When you are using CCS Linux, are you able to connect to the target successfully but it is during program flash that you have an issue?

    Thanks
    ki
  • Hi Ki. Yes I was able to connect. I can even read the target memory. The problem occurs only when I attempt to flash.

    Tristen

  • Can you provide a screenshot with the errors when you try flashing from CCS Linux?
  • Ki,

    I will tomorrow morning. The error popup is basically the same as step 3 line 8 of the original post:

    Cortex_M3_0: File Loader: Memory write failed: Unknown error

    Tristen
  • Thanks. Can you also reproduce the error on CCS while generating a debug server log?

    Please see:
    processors.wiki.ti.com/.../Troubleshooting_CCSv7

    Thanks!
    ki
  • Ki,

    I was unable to get CCSv7 to just connect without flashing. However I was able to enable the debug server logging with UniFlash and capture the logs at the point of failure.

    First of all, here is the UniFlash screenshot at the point of failure.

    The ds log file is attached here: 8750.ds.log

    Something else interesting is that this morning I was able to occasionally load the firmware to the target with CCS. The steps were to unplug the debugger, wait, plug in the debugger, and load the firmware as soon as the driver enumerates. This works half the time or so, but only with CCS, not UniFlash. When it does fail, the failure looks to be the same as the UniFlash failure.

    Tristen

  • Thank you for the log. We are investigating.

    Can you confirm that you have the same exact settings between your working and non-working environments (passwords, etc)?

    If everything is identical, can you erase any other flash sectors?

    Thanks
    ki
  • Ki,

    Yes, the settings between both environments are the same. I attempted to erase other sectors on both C28 and M3 cores with no success.

    Thanks,

    Tristen

  • Tristen,

    To confirm, you are not able to erase any of the sectors on either the C28 or M3 core on your Linux machine (Flash Programmer: Error erasing Sector 'x'. FMSTAT value = 0. Operation Cancelled (0)), but is able to erase successful on your Windows machine on the same F28M35 board? Did you get a chance to try this on both the XDS100v3 and USB560v2 debug probe?

    Also, has any of the security fields been programmed on your F28M35H52?

    We do have a newer version of UniFlash available (4.2.2), but I'm not aware of any new fixes that is related to the problem you are seeing.

    Thanks,
    Ricky
  • Ricky,

    You are correct. And yes, I've been trying with both the XDS100v3 and USB560v2. None of the security fields have been programmed. Has UniFlash or CCSv7 been tested on CentOS 7.x yet? Perhaps there's some kind of USB permissions issue? I've dealt with that with other hardware in the past.

    Tristen
  • Tristen,

    I'm not aware of any testing on CentOS with UniFlash or CCS, so I supposed there could be USB permission or similar issues related to that.

    But you mentioned that you tried it on Ubuntu 16.04.3 LTS as well, which has definitely been tested, and as Ki noted, he was not able to reproduce the issue in the same environment.

    Thanks,
    Ricky
  • Ricky,

    That is right. This makes me wonder if it is linux/hardware related on my end. All these tests have been on the same machine.

    Tristen
  • Tristen Pierson13 said:
    All these tests have been on the same machine.

    Does this include the Win 10 environment also? Are you using VMs?

  • Ki,

    I started with a Windows 10 environment and replaced it with Ubuntu and then CentOS in order to support other design software I'm currently using. No VM's have been used. The original Windows 10 environment was able to flash.

    Tristen

  • Tristen,

    Do you have access to any other machine you can connect your device and install CCS or UniFlash on? I want to see if we can eliminate your device being the problem.

    If you are able to flash the device on another machine, we can say that the device is fine.

    One theory is that maybe the USB port is not providing enough power for flash programming, but I'm not sure if it would be a problem specifically with CentOS or not. You can also try another USB cable if you haven't do so already.

    Thanks,
    Ricky
  • Ricky,

    Yes I am able to program the device on three other machines using CCS and UniFlash (all Windows 7 machines).

    I tried plugging into other USB ports with different cables with no success.

    Tristen
  • Hi all!
    I can confirm the issue on my linux box. I have the same microcontroller and the same error messages. Everything were working file until the previous version which couldn't be even installed due to libc issue. The last version (7.4.0.00015) can't write flash.
    I downloaded and installed UniFlash. It says everything is OK, both MCU core are flashed, but it's a lie. Nothing actually happened. MCU's memory remains the same.
    Currently I'm forced to use windows machine to flash MCUs :(((
  • av_beregovoy,

    Can you try generating the Debug Server logs for the UniFlash case? To generate the logs, start UniFlash, configure for you device, click on "Settings" (top right corner), find the "Debug Server Logging" section and click on Enable. After that, try programming your device. And then disable the logging, and attach it here.

    Your bug sounds a little different to what Tristen was seeing so I want to see if the logs provide any additional information.

    Can you also try using the UniFlash command line to see if the behaviour is the same?

    Lastly, what Linux distribution are you using?

    Thanks,
    Ricky
  • av_beregovoy - just wanted to follow up with you to see if you are still having the issue and if so, if you can provide the information requested by Ricky Lau in the post above.

    Thanks
    ki
  • Sorry guys for the delay, was on vacation.

    My OS is Arch linux 64bit (with last updates of course).

    UniFlash seems to work for me now. Can live with it now but I used to use loadti.sh which was perfect (unlike UniFlash), but now it shows next:

    ***** DSS Generic Loader *****

    START: 13:41:16 GMT+0300 (MSK)

    Configuring Debug Server for specified target...

    Done

    TARGET: Texas Instruments XDS100v2 USB Debug Probe_0

    Connecting to target...

    Cortex_M3_0: GEL Output: Watchdog Timers Enabled

    Cortex_M3_0: GEL Output: UARTs Enabled

    Resetting target...

    testEnv.outFiles: ../thermcam/m3/out/m3.out

    Loading ../thermcam/m3/out/m3.out

    SEVERE: Cortex_M3_0: Flash Programmer: Error erasing Sector N. FMSTAT value = 0. Operation Cancelled (0).

    SEVERE: Cortex_M3_0: File Loader: Memory write failed: Unknown error

    SEVERE: Cortex_M3_0: GEL: File: /home/anatoly/agp/thermcam/m3/out/m3.out: Load failed.

    SEVERE: File: /home/anatoly/agp/thermcam/m3/out/m3.out: Load failed.

    SEVERE: Error loading "../thermcam/m3/out/m3.out": File: /home/anatoly/agp/thermcam/m3/out/m3.out: Load failed.

    Error code #4011, ../thermcam/m3/out/m3.out load failed!

    Aborting!

    And for C2800:

    ***** DSS Generic Loader *****

    START: 13:46:11 GMT+0300 (MSK)

    Configuring Debug Server for specified target...

    Done

    TARGET: Texas Instruments XDS100v2 USB Debug Probe_0

    Connecting to target...

    C28xx_0: GEL Output:

    Memory Map Initialization Complete

    C28xx_0: GEL Output:

    RAM Initialization Complete

    Resetting target...

    testEnv.outFiles: ../thermcam/c28/out/c28.out

    Loading ../thermcam/c28/out/c28.out

    SEVERE: C28xx_0: Flash Programmer: Error erasing Sector N. FMSTAT value = 0. Operation Cancelled (0).

    SEVERE: C28xx_0: File Loader: Memory write failed: Unknown error

    SEVERE: C28xx_0: GEL: File: /home/anatoly/agp/thermcam/c28/out/c28.out: Load failed.

    SEVERE: File: /home/anatoly/agp/thermcam/c28/out/c28.out: Load failed.

    SEVERE: Error loading "../thermcam/c28/out/c28.out": File: /home/anatoly/agp/thermcam/c28/out/c28.out: Load failed.

    Error code #4011, ../thermcam/c28/out/c28.out load failed!

    Aborting!

    Since loadti.sh is part of CCS, CCS behaves exactly the same. But on Win7_64 loadti.sh works well.

    Debug Server log is attached just in case.

    For standalone command line I can't figure out how to pack two images (for both of cores).

    ds.log.zip

  • Just installed CCS v8. Everything works fine now! UniFlash can be wiped.