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.

UniFlash on Linux: missing libFlashFTDStellaris.so, libFlashDFUStellaris.so - Unable to recover device

Other Parts Discussed in Thread: EK-TM4C1294XL, UNIFLASH

Hello,


I locked myself out of my tm4c1294 and decided to try and use UniFlash to recover it, since I have been unable to program it with either lm4flash or UniFlash (more on that later).

The 'Debug Port Unlock' operation fails with this message:

SEVERE: Error executing Flash operation "NCO_DebugPortUnlock": Failed to load flash dll: /home/odougs/bin/uniflash_3.3/ccs_base/DebugServer/bin/libFlashFTDStellaris.so: cannot open shared object file: No such file or directory

The 'ICDI Firmware Update' operation fails with this message:

SEVERE: Error executing Flash operation "NCO_ICDIFirmwareUpdate": Failed to load flash dll: /home/odougs/bin/uniflash_3.3/ccs_base/DebugServer/bin/libFlashDFUStellaris.so: cannot open shared object file: No such file or directory

This is a fresh install of UniFlash, version 3.3.0.00067, with The 'Tiva/Stellaris Cortex-M JTAG' and 'Tiva/Stellaris Cortex-M Serial' options enabled. Up until now I have been using lm4flash exclusively, and had no problems programming the device. Google searches for 'libFlashFTDStellaris.so' and 'libFlashDFUStellaris.so' produce zero results. What is going on?

Thanks!

My system: Debian 8, 64-bit, x86

Target board: EK-TM4C1294XL

UniFlash: 3.3.0.00067 (Linux)

*Note: this is a repost from the TM4C forum; I realized this is a better place for it.

  • Oliver,

    It looks like the 2 features you are using, Debug Port Unlock and ICDI Firmware Update, are only support on the Windows version for now. I will need to check if it is possible to support these features for Linux as well, or if it is relying on underlying drivers/libraries that are only available on Windows.

    If you have a Windows machine available, please try to use UniFlash on that and try to recover your device this way.

    Sorry for the inconvenience.

    Thanks,
    Ricky
  • Ricky,


    Thanks for your reply. Fortunately, I just found a different way to access the Debug Port Unlock, by modifying the open-source lm4flash tool. I will post the patch file below so that it may be helpful to other Linux users (warning: very quick and dirty fix)!

    Still, I do hope the CCS team adds this feature to the Linux version at some point, -- official support is always a good thing to have!


    --- lm4flash.c	2015-08-26 15:10:08.457847302 -0400
    +++ /home/odougs/code/arm/lm4flash_mod.c	2015-08-26 15:09:03.501496443 -0400
    @@ -29,7 +29,7 @@
     
     #include <libusb.h>
     
    -//#define DEBUG 1
    +#define DEBUG 1
     
     #define ICDI_VID 0x1cbe
     #define ICDI_PID 0x00fd
    @@ -114,6 +114,7 @@
     	return _tmp.b32;
     }
     
    +static int do_unlock = 0;
     static int do_verify = 0;
     static int erase_used = 0;
     static uint32_t start_addr = 0;
    @@ -470,6 +471,18 @@
     		return LIBUSB_ERROR_OTHER; \
     } while (0)
     
    +
    +
    +static int unlock_device(libusb_device_handle *handle)
    +{
    +  print_icdi_version(handle);
    +  printf("Attempting device unlock...");
    +
    +  SEND_COMMAND("debug unlock");
    +  
    +  return 1;
    +}
    +
     /*
      *  This flow is of commands is based on an USB capture of
      *  traffic between LM Flash Programmer and the Stellaris Launchpad
    @@ -763,14 +776,18 @@
     		goto done;
     	}
     
    -	f = fopen(rom_name, "rb");
    -	if (!f) {
    -		perror("fopen");
    -		retval = 1;
    -		goto done;
    -	}
    +	if (do_unlock == 0) {
    +	  f = fopen(rom_name, "rb");
    +	  if (!f) {
    +	    perror("fopen");
    +	    retval = 1;
    +	    goto done;
    +	  }
     
    -	retval = write_firmware(handle, f);
    +	  retval = write_firmware(handle, f);
    +	}
    +	else
    +	  retval = unlock_device(handle);
     
     done:
     	if (f)
    @@ -792,7 +809,7 @@
     	const char *rom_name = NULL;
     	int opt;
     
    -	while ((opt = getopt(argc, argv, "VES:hvs:")) != -1) {
    +	while ((opt = getopt(argc, argv, "UVES:hvs:")) != -1) {
     		switch (opt) {
     		case 'V':
     			show_version();
    @@ -814,12 +831,18 @@
     		case 's':
     			serial = optarg;
     			break;
    +		case 'U':
    +		        do_unlock = 1;
    +			break;
     		default:
     			flasher_usage();
     			return EXIT_FAILURE;
     		}
     	}
     
    +	if (do_unlock == 1)
    +	  return flasher_flash(serial, rom_name);
    +	
     	if (optind >= argc) {
     		flasher_usage();
     		return EXIT_FAILURE;
    @@ -833,3 +856,4 @@
     
     	return flasher_flash(serial, rom_name);
     }
    + 
    

  • Hi Oliver,
    I found this your post on internet, because I'm the the same your situation.
    Due to a my mistake I locked the JTAG port of my TivaC.
    I'm a Linux user with an Ubuntu 15.10, and I really need your help, with your patch to use the lm4flash app to unlock my launchpad, so could you please help me?
    How can I deploy your patch in my lm4flash folder?
    Thank you so much !