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 Remote network-connected debugging -- DSS and CCS Debugging sessions

Other Parts Discussed in Thread: LAUNCHXL-F280039C

It appears that CCS supports some kind of "remote debugging" using the DSS tools ( https://dev.ti.com/tirex/explore/node?node=AEvH2m2WktsK7yoAuLqLWA__FUz-xrs__LATEST ).

[ Machine 1 : CCS IDE + Debugger  ] ---> [ Machine 2 :DSS + Debugger + USB Debugger ] |--USB--| [ LAUNCHXL-F280039C ] 

I am able to launch the "test_server.js" , and it's listening on port 4444 as a server on machine 2 in this example ^ :

:~/work/debug_server/ccs_base/scripting/examples/TestServer$ ../../bin/dss.sh test_server.js

Server startup...

  Server started.

  Session[0] opened on port 4444.

Error: 'bug_cmd' is not a function and will not be added.

TestServer is ready.

I have confirmed that the server is responding properly by connecting with a RAW TCP socket (telnet) and sending junk messages.

However, it's not clear how I connect the IDE to the debugger on machine 1.  All debuggers seem to need a .ccxml file -- I seem to be missing one that goes with the DSS (maybe?).  How do I add the 1.2.3.4:4444 (ip:port) to the CCS IDE so this can program and debug ?

  • Hello,

    [ Machine 1 : CCS IDE + Debugger  ]
    However, it's not clear how I connect the IDE to the debugger on machine 1

    Please note that you are not connecting the CCS IDE on machine 1 to a remote DSS session on machine 2. There is no CCS/DSS involved on machine 1. Machine 1 is simply sending commands via JSON format(via open socket) to machine 2 which translate to DSS actions executed by the open DSS session on machine 2.

    The TestServer is for remote control of a headless debug session on a remote machine. if you want to use the actual CCS IDE locally with a remote machine, then you would need to use a XDS based LAN debug probe.

    Thanks

    ki

  • I see.  Then DSS is pretty complex for just executing debug sessions with CCS.

    Regarding the XDS LAN probe, that would also be very expensive for what it is. ( $2000+ ? )

    I will be investigating Linux NBD (network block device), which I would use to link a network port and send traffic to/from the USB XDS Probe.  Have you tried this before ?

  • Then DSS is pretty complex for just executing debug sessions with CCS.

    DSS is for headless automation of the CCS debugger. However DSS is used under the hood with the TestServer example. The user just needs to send the desired debug commands to the running DSS server.

    Regarding the XDS LAN probe, that would also be very expensive for what it is. ( $2000+ ? )

    The XDS LAN probes can indeed get a bit pricey

    I will be investigating Linux NBD (network block device), which I would use to link a network port and send traffic to/from the USB XDS Probe.  Have you tried this before ?

    I have no experience with this.

    ki

  • >>The user just needs to send the desired debug commands to the running DSS server

    Yes, however, this requires a machine that runs CCS.  Something x86_64, and does not appear to integrate to the CCS debugger ?

    >> I have no experience with this.

    Have since dropped NBD since the TI Debuger is : 1. offering up multiple TTY interfaces , and 2. switching between different configurations on USB, presenting different active devices (FU and "normal" being 2 of these ).

    I was able to configure usbip to shuttle the usb connection back and forth - and CCS detects it.  I am just at a point where the I need to switch usbip to pickup the DFU when it the LAUNCHXL switches to that mode, and when it flips back to normal mode.  Looking for tricks to detect this change, and I believe it's in systemctl ..  keep reading if you could advise on the right triggers with systemd here .. 

    So far --- 

    Install software
    apt install usbip
    modprobe usbip_host
    echo 'usbip_host' >> /etc/modules

    List USB devices and note down the product/vendor
    usbip list -l

    Create start script
    nano /usr/sbin/usbip_start.sh

    #!/bin/bash

    # TI 0039C -- serial 00B
    usb1='0451:bef3'

    # TI 0039C -- serial 00B -- DFU
    # Bus 001 Device 005: ID 1cbe:00ff Luminary Micro Inc. Stellaris ROM DFU Bootloader
    usb2='1cbe:00ff'

    /usr/sbin/usbip bind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb1'#' | cut '-d#' -f1)
    /usr/sbin/usbip bind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb2'#' | cut '-d#' -f1)

    Make this executable
    chmod +x /usr/sbin/usbip_start.sh

    Create stop script
    nano /usr/sbin/usbip_stop.sh

    #!/bin/bash

    # TI 0039C -- serial 00B
    usb1='0451:bef3'

    # TI 0039C -- serial 00B -- DFU
    # Bus 001 Device 005: ID 1cbe:00ff Luminary Micro Inc. Stellaris ROM DFU Bootloader
    usb2='1cbe:00ff'

    /usr/sbin/usbip unbind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb1'#' | cut '-d#' -f1)
    /usr/sbin/usbip unbind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb2'#' | cut '-d#' -f1)
    killall usbipd

    Make this executable
    chmod +x /usr/sbin/usbip_stop.sh

    Create service
    nano /lib/systemd/system/usbipd.service

    [Unit]
    Description=usbip host daemon
    After=network.target

    [Service]
    Type=forking
    ExecStart=/usr/sbin/usbipd -D
    ExecStartPost=/bin/bash -c '/usr/sbin/usbip_start.sh'
    ExecStop=/bin/bash -c '/usr/sbin/usbip_stop.sh'

    [Install]
    WantedBy=multi-user.target

    systemctl --system daemon-reload
    systemctl enable usbipd.service
    systemctl start usbipd.service

    Check what USB devices are found
    usbip list -p -l

    ---

    Linux Client
    Switch to root account
    su -

    Check USB device is attached
    lsusb

    Install software and create a service
    apt install usbip hwdata usbutils -y
    modprobe vhci-hcd
    echo 'vhci-hcd' >> /etc/modules

    Create start script
    nano /usr/sbin/usbip_start.sh

    #!/bin/bash

    server1='192.168.200.7'

    # TI 0039C DevKit -- serial 000B
    usb1='0451:bef3'

    # TI 0039C -- serial 00B -- DFU
    # Bus 001 Device 005: ID 1cbe:00ff Luminary Micro Inc. Stellaris ROM DFU Bootloader
    usb2='1cbe:00ff'

    /usr/bin/usbip attach -r $server1 -b $(/usr/bin/usbip list -r $server1 | grep $usb1 | cut -d: -f1)
    /usr/bin/usbip attach -r $server1 -b $(/usr/bin/usbip list -r $server1 | grep $usb2 | cut -d: -f1)

    Make this executable
    chmod +x /usr/sbin/usbip_start.sh

    Create stop script
    nano /usr/sbin/usbip_stop.sh

    #!/bin/bash

    /usr/bin/usbip detach --port=$(/usr/bin/usbip port | grep '<Port in Use>' | sed -E 's/^Port ([0-9][0-9]).*/\1/')
    /usr/bin/usbip detach --port=$(/usr/bin/usbip port | grep '<Port in Use>' | sed -E 's/^Port ([0-9][0-9]).*/\1/')

    Make this executable
    chmod +x /usr/sbin/usbip_stop.sh

    Create service
    nano /lib/systemd/system/usbip.service

    [Unit]
    Description=usbip client
    After=network.target

    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStartPost=/bin/bash -c '/usr/sbin/usbip_start.sh'
    ExecStop=/bin/bash -c '/usr/sbin/usbip_stop.sh'

    [Install]
    WantedBy=multi-user.target

    systemctl --system daemon-reload
    systemctl enable usbip.service
    systemctl start usbip.service

    Check USB device is attached
    usbip port
    lsusb

  • Yes, however, this requires a machine that runs CCS.  Something x86_64, and does not appear to integrate to the CCS debugger ?

    Just the second machine that is acting as the server and connected to the target board. The first (client) machine has no CCS dependency and can be any machine as long as it can send JSON commands over a socket.

    I was able to configure usbip to shuttle the usb connection back and forth - and CCS detects it.  I am just at a point where the I need to switch usbip to pickup the DFU when it the LAUNCHXL switches to that mode, and when it flips back to normal mode.  Looking for tricks to detect this change, and I believe it's in systemctl ..  keep reading if you could advise on the right triggers with systemd here .. 

    Thanks for sharing your progress. Hopefully there are others more experienced that can chime in with more insight.

  • >>Just the second machine that is acting as the server and connected to the target board. The first (client) machine has no CCS dependency and can be any machine as long as it can send JSON commands over a socket.

    Yes, however, I WANT to use CCS as a debugger on machine 1 (test cases should be written with the same tools that are used to develop, for cross-team improvements when DEV or QA improves the toolchain.).  I don't particularly care that Machine 2 is running CCS, it has no need to since code is developed on machine 1.

    >> Hopefully there are others more experienced that can chime in with more insight.

    Yes.  I will keep plugging away.