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.
Hi, I'm a command-line user rather than CSC or IAR. Targeting the CC3220SF on the LAUNCH-CC3220MODASF, I can use uniflash_5.2.0/dslite.sh to build a project and program it and it runs. I'd now like to use the gdb that's supplied by TI as part of the tool-chain. The agent to sit between gdb and the XDS110, ti/ccs920/ccs/ccs_base/common/uscif/gdb_agent_console, takes a mandatory argument of a board data file. Where is this within the SDK, etc., for the LAUNCH-CC3220MODASF? Thanks, Ralph.
Hi Rafael, Thanks. I stole the .dat from under CCS's feet and gdb_agent_console is happy as long as I run it from its directory under ti/ccs920/ccs/ccs_base/common/uscif.
I can now run the tool-chain's arm-none-eabi-gdb using -se to specify the a.out that's been flashed earlier. A 'target remote :55000' has gdb connect to the agent and show where it happens to halt execution. a.out is using FreeRTOS and its pthreads. My next problem is a 'next' steps on as expected once, but a second attempt gives 'Cannot execute this command without a live selected thread' and 'info thread' shows the sole thread listed has had its ID incremented by one; it's still marked as current with an asterisk. Having run 'info thread' then 'next' will work for one more go and again fail in the same way on the second attempt. 'info thread' fixes things once more.
Clearly, gdb's thread detection within FreeRTOS is out of tune. Multi-threading support would be nice, but I'd be happy with gdb presenting just a single thread of execution if that's simpler. Ideas welcome. Meanwhile, I'm going to look at the build configuration of FreeRTOSv10.1.1/FreeRTOS/Demo/CORTEX_M4_SimpleLink_CC3220SF_CCS for clues.
Thanks, Ralph.
Ralph,
Unfortunately I am not the most familiar with the FreeRTOS in combination with the CC3220 device but, given the GDB Agent Console support shifted focus to OpenOCD, perhaps you may have better luck with this alternative?
If you are interested in investigating this route, there were several Simplelink improvments merged to the main OpenOCD project tree since the last official version was out, thus I would check one of the "bleeding edge" versions (check the mirror repo, but precompiled binaries are available in other servers).
This is the commit that added CC3220 internal Flash support.
A few notes:
- You need to choose the CMSIS connection (the XDS110 is CMSIS compliant)
- The external SPI Flash is not supported
Hope this helps,
Rafael
Hi Rafael, I don't think it's FreeRTOS specific. Here's the start of the protocol between gdb and the agent, both TI supplied.
(gdb) set debug remote 1 (gdb) target remote :55000 Remote debugging using :55000 cortex_m4_0 Client connected...Connecting to Target Sending packet: $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df...cortex_m4_0 - Processor type =CORTEX_MXX (Little endian) cortex_m4_0 - Target device is connected Using ctools hardware breakpoint support. Target connected...Starting server Ack Packet received: QStartNoAckMode+;PacketSize=4000 Packet qSupported (supported-packets) is supported Sending packet: $vMustReplyEmpty#3a...Ack Packet received: Sending packet: $QStartNoAckMode#b0...Ack Packet received: OK Sending packet: $Hg0#df...Packet received: OK Sending packet: $qTStatus#49...Packet received: Packet qTStatus (trace-status) is NOT supported Sending packet: $?#3f...Packet received: T050f:fe170001; Sending packet: $qfThreadInfo#bb...Packet received: m0 Sending packet: $qsThreadInfo#c8...Packet received: l Sending packet: $qAttached#8f...Packet received: 1 Packet qAttached (query-attached) is supported Sending packet: $Hc-1#09...Packet received: OK Sending packet: $qC#b4...Packet received: QC0
According to the authors on the #gdb IRC channel, the answer to qfThreadInfo of m0 is confusing gdb. It's saying there's only one thread and its ID is 0. But -1 and 0 are special values. A plain thread ID would be 1 or more. What do you see on a successful gdb+agent run? explains the possible values.
This misuse of thread ID 0 repeats at the end of that paste with the QC0 answer from the stub saying the current thread ID is 0.
Is this agent deprecated? If so, it seems odd that doesn't say so or mention OpenOCD.
Thanks, Ralph.
Hi,
I edited the standalone gdb_agent_console Linux executable to use thread ID 1 rather than the special ID 0 in the opening protocol with gdb(1) and the debugger is a lot happier. Still doesn't work though because before long the agent hits code I didn't modify and moves back to 0, but it confirms the source of gdb's unhappiness.
Is gdb_agent_console deprecated? It's annoying I've wasted time trying to get it to work by following the still current TI documentation if that's the case.
I understand CCS uses gdb behind the scenes? What agent/stub does CCS use to sit between gdb and the XDS110?
Thanks, Ralph.
Ralph,
Ralph Corderoy said:Is gdb_agent_console deprecated? It's annoying I've wasted time trying to get it to work by following the still current TI documentation if that's the case.
I talked to the dev team and they did confirm this tool is currently unsupported for the Cortex M devices (MSP430 still has limited support). Please apologize for the inconvenience. I will update the documentation accordingly.
Your best choice at this time is the OpenOCD route I mentioned before.
Ralph Corderoy said:I understand CCS uses gdb behind the scenes? What agent/stub does CCS use to sit between gdb and the XDS110?
We use a fully proprietary debugger in CCS - the Debug Server. Obviously that, being Eclipse-based, CCS can also use GDB if properly configured to do so, but a flavour of GDB Server is still required to connect to the target.
Again, I apologize for the inconvenience.
Rafael
Hi desouza, Thanks for confirming it does not work and taking on getting the documentation updated. After spending time on this I'm after the quickest solution for the occasional bit of debug where printing to the UART doesn't suffice so I'll see if I can get CCS on Linux to play ball, given I'm not using it to develop the project, and if not look at OpenOCD when I've time. Cheers, Ralph.
Ralph,
Ralph Corderoy said:I'll see if I can get CCS on Linux to play ball
When you decide to make the move, the first reference to look at is the CCS Linux Host Support page at:
https://software-dl.ti.com/ccs/esd/documents/ccs_linux_host_support.html
Due to popularity, we officially support the Ubuntu distro but Debian-based distros usually work well.
I am also able to install on CentOS 8, but for some yet unknown reason I couldn't make the built-in jxbrowser work well (to access TI Resource Explorer, CCS App Center, et. al.). I couldn't spend more time yet investigating this, though.
Also, to reduce the overall install size, you can select only the device families you want to use.
Regards,
Rafael