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.

Flashing CC2650 sensortag with CCS Uniflash

Other Parts Discussed in Thread: UNIFLASH, CC2650

Hi, I have been following this guide www.ti.com/.../swra446.pdf with the goal to use Uniflash to program a CC2650 sensortag on linux command-line. Installation and configuration goes smoothly up to the point of flashing:

sudo /opt/ti/uniflash_3.3/ccs_base/scripting/examples/uniflash/cmdLine/uniflash.sh -verbose 1 -ccxml ~/cc26xxF128XDS110c3fromuniflash33.ccxml -program myprogram.elf

(...)

> Connecting to the target for Flash operations ...

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x9ea29502, pid=30843, tid=2661145408
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14)
# Java VM: Java HotSpot(TM) Client VM (25.45-b02 mixed mode linux-x86 )
# Problematic frame:
# C 0x9ea29502
(...)

I always get this error, but actually sometimes (maybe 1 of 5) I can see from the output of the node that it has been programmed. When using GUI I see no error messages, but I see same results on the actual flashing (~1 out of 5 is actually flashed).

I have tried several different versions of java (8 and 7) and I tried both Uniflash 3.3 and 3.0, focused on 3.3.0.00053. For target configuration I used connection XDS110 USB Debug probe and Board CC2650F128. Doing this on a 32-bit Ubuntu 14.04. Sensortag is connected via a debugger devpack - flashing works fine using Flash Programmer v2 in Windows, I also get serial output from it in Linux.

Anyone tried this successfully before, or have any ideas? If more logs or dumps are needed, please let me know. Also tried digging in the Java dumps, but found nothing useful.

Regards,

Andreas

  • Hello Andreas,
    I can also reproduce this on my Ubuntu 14.04 machine. I have filed a bug for this. Tracking ID: SDSCM00051862

    Thanks
    ki
  • Andreas,

    UniFlash should be shipped with it's own JRE (1.6, 32bit version), so it is weird that you are getting errors with using your own JRE 1.8.

    Can you make sure that the UniFlash JRE is available in <installDir>/eclipse/jre/?

    When UniFlash CLI is started, the dss.sh script in <installDir>/ccs_base/scripting/bin/ is supposed to set up the required environment variables to use the provided JRE, so we might need to debug why this is not working properly.

    There's actually another potential problem that might be affecting 3.3, but lets resolve the JRE version issue first.

    Thanks,
    Ricky
  • Hi Ricky, yes a JRE is in the location you specified. But the version is:

    /opt/ti/uniflash_3.3/eclipse/jre/bin$ java -version
    java version "1.8.0_45"
    Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
    Java HotSpot(TM) Client VM (build 25.45-b02, mixed mode)

    I tried changing JAVA_HOME manually to this JRE, but result is still the same.

    Andreas
  • Andreas,

    You might need to run './java -version' in the UniFlash /jre/bin/ folder to get the version of the included JRE. For me, if I just run 'java -version', it will still find the java specified by the PATH.

    Can you try setting both the JAVA_HOME as well as the PATH? Like this:
    export JAVA_HOME=/opt/ti/uniflash_3.3/eclipse/jre/
    export PATH=/opt/ti/uniflash_3.3/eclipse/jre/bin/:$PATH

    dss.sh is supposed to set this up for you, but it might be worth a try to see if helps.

    Thanks,
    Ricky
  • Ah, my mistake, the version is indeed 1.6 when executed correctly. Actually I had to set the java file executable, and I think this now makes dss.sh work properly and uniflash run with the correct Java version. I believe this because the error output has changed (JRE version no longer displayed, VM version much older):

    An unexpected error has been detected by Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0xa7c31502, pid=407, tid=2814270272
    #
    # Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode linux-x86)
    # Problematic frame:
    # C 0xa7c31502

    However, If I do java -version I still get 1.8. I tried setting the variables manually as you specified, and get the same error as above. So I am guessing any dss.sh changes are only valid for the execution context.

    Andreas
  • Thanks Andreas,

    Yes, dss.sh only modifies the necessary variables temporary for running the command.

    As for java binary not having executable permissions, I'll see if we can update the UniFlash installer to fix this problem.

    And for the new error you are seeing, can you try renaming the following binary (to something like libctools.so.bak) in your UniFlash install and try running command line again?

    /ccs_base/emulation/analysis/bin/libctools.so

    Thanks,
    Ricky
  • Hi Ricky,

    Your solution solved it. Can I use this workaround safely in my dev. environment?

    Regards,

    Andreas

  • Andreas,

    For now, you can safely use this workaround in your environment. The component that you removed is mostly used for setting hardware breakpoints for debugging purposes, and therefore is not needed for Flash Programming.

    We will work on an official fix for this for the next UniFlash update.

    Thanks,
    Ricky
  • Thanks!

    Probably not related, but I also have problem with GDB on the sensortag, following same guide www.ti.com/.../swra446.pdf
    gdb_agent launches fine, but when connecting client (tried both via eclipse as in guide, and manually on command line), I get the following on the agent:

    cortex_m3_0 Client connected...Connecting to Target
    FAILED! GTI_CONNECT(hpid=0x8436b88)=-1
    (Error -6306) Failed to connect to PRSC module.
    (Emulation package 5.1.641.0)

    Tried both xds100v3 dat-file from guide, and xds110 dat-file from guide below -both with same result
    processors.wiki.ti.com/.../CC13xx_CC26xx_Tools_Overview

    Any ideas? (should I open separate post?)

    Setup/environment is same as before, CC2650 sensortag connected via Debugger DevPack.
  • Probably out of scope of my expertise, so I recommend you start a new thread for this new topic.

    Thanks.
  • Hi,

    A quick reply: I am able to connect to my CC2650 Evaluation Module on my SmartRF06 board without a problem (I am using the attached .dat file). However, if I turn of power to the Module by removing the "VDD TO EM" jumper I can reproduce the same issue as yours.

    In this case, please double-check the power connections to your CC device.

    Hope this helps,

    Rafael

    CC2650_XDS100v3.dat

  • Thanks for your reply Rafael. I have a sensortag powered via the Debugger DevPack (+battery). With regards to power I now tried with and without the battery (both using your DAT file and the xds110), but still the same result.

    Andreas
  • Andreas,

    Sorry, I missed from the original post you were using the DevPack. The file I sent is for a XDS100v3, which is part of the SmartRF06 board (so it would never work in your setup).

    Since it seems you have Uniflash installed for Windows as well, can you try to connect to your board using GDB Agent and a GDB client this OS? It may be something linked to the Linux environment (a big maybe).

    Also, since you are past the Java error, are you able to flash your board from Linux? The reason is the flash operation would need to have a stable JTAG connection and the PRSC error prevents that.

    At last, I created a .dat file for the XDS110, but it is identical to the one available at the wiki page. Unfortunately I can't test this in deep detail as I do not have this DevPack.

    Regards,

    Rafael

  • Yes, I am able to flash from Linux.

    I don't have uniflash for Windows, I use Flash programmer 2. I could try doing the debug via Windows, however I am not able to get a stable serial output (if disconnect I am not allowed to reconnect) in Windows, so I prefer having the node connected to Linux.

    Regards,
    Andreas
  • Andreas,

    Sorry, I got a bit confused now. You are able to flash your code using Uniflash, but unable to connect the GDB agent to the CC2650, is that so?

    If so, I suspect the issue at hand is related to the .dat file or to the GDB agent itself, unless your code somehow powers down the device during normal operation and potentially kills the JTAG circuitry, making the XDS110 think the device is powered down. Keep in mind I am not very experienced with the CC devices yet, therefore this suspicion comes from similar scenarios with other processors.

    Unfortunately I do not have the same kit as you (I ordered it but it is out of stock momentarily). Perhaps you could also get some additional help from the experts at the LPRF Tools forum.

    Hope this helps,
    Rafael
  • Sorry for not being clear. Yes, I am able to flash using Uniflash in Linux, but not connect the GDB agent. In Windows I am able to flash using Flash Programmer 2, but have not tried GDB there yet.

    I am testing this with the TI Contiki web-demo examples with some small modifications. There are no explicit power-downs in this code, but the tag will go into different sleep modes in between tasks. I believe the XDS110 dat file from the wiki is the correct, so I guess I will re-post this in another forum and/or try Windows GDB just to narrow it down.

    Regards,

    Andreas

  • Andreas,

    I verified the GDB agent connects fine to my SmartRF06 board + CC2650 module on my Linux machine (Ubuntu 14.04/64), therefore this rules out any potential issues intrinsic with the tool. 

    However I would like to ask to try one last time with the XDS110 dat file attached. I know it is probably moot, but since I couldn't find any online source for the Linux-based dat file for this particular debug probe I think it is worth a shot.

    Hope this helps,

    Rafael

    CC2650_XDS110_linux.dat

  • Thx, I tried but with same result. Btw, from the guide I am also setting this:
    (gdb) mem 0x00 0x20000 ro 32 nocache
    (gdb) mem 0x10000000 0x10020000 ro 32 nocache
    (gdb) mem 0x20000000 0x20005000 rw 32 nocache
    (gdb) mem 0x40000000 0x400E1028 rw 32 nocache
    (gdb) mem 0xE000E000 0xE000F000 rw 32 nocache

    Do you see any mistake ref. your trials? (get same error if I don't input any of them though)
    In eclipse there are a few more settings (ref. the guide). You use the same config?

    FYI, output:
    ./gdb_agent_console CC2650_XDS110_linux.dat
    Successfully configured CC2650_XDS110_linux.dat
    CPU Name Port
    -------- ----
    cortex_m3_0 :55000

    Starting all cores
    CPU Name Status
    -------- ------
    cortex_m3_0 Waiting for client
    cortex_m3_0 Client connected...Connecting to Target
    FAILED! GTI_CONNECT(hpid=0x8a44b70)=-1
    (Error -6306) Failed to connect to PRSC module.
    (Emulation package 5.1.641.0)
  • Hi,

    I know it has been a while, but I just received the SensorTag DevPack to try this out in Linux, and I was able to make it work on my system without a problem.

    I am using the same board as you (CC2650 SensorTag Development Kit) and the XDS110 .dat file I sent before.

    One detail, though: the instructions mention you must leave the battery on the SensorTag Development Kit. When I removed the battery on mine, I got the exact same error as you.

    Therefore I would double check the power to the target board before proceeding.

    Hope this helps,

    Rafael

  • Hi Rafael,

    I just tried again, and now it works! But I have been aware of the battery-issue for a long time and I am almost certain I always had a battery in my tests (I believe you will also get problems with flashing if no battery present). I have updated to new cc26xxware + a lot of cc26xx related contiki commits since last time, could these have effect on this level? 

    Anyway, I appreciate you following up, and happy it works now.

    Regards,

    Andreas

  • Hi Desouza,

    I am also trying to follow the same pdf for CC2650 STK debugging with GCC/GDB.
    Machine is Ubuntu 14.04 , Eclipse Neon, CCS Uniflash 3.4. The problem I am facing is that when i try to flash the "blink_led.elf" on cc2650 stk using CCS Uniflash, I am getting an error as "Error -1170 @ 0x0, Unable to access DAP". Howsoever when I used The blink_led.bin with Smartrf Flash programmer on windows. It worked fine.
    Can you help me for this issue?