Unable to debug on TM4C123 platform / Windows

Hi All,

I’m basically an infant using Platform IO. I’m able to upload the image to my TI board but not able to do any debugging using JTAG. Any help would be greatly appreciated. I would much rather use this than Keil if at all possible. I’ve tried this on multiple systems and receive the exact same error.

Processing lptm4c1230c3pm (platform: titiva; board: lptm4c1230c3pm; framework: energia)
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION:
PLATFORM: TI TIVA > TI LaunchPad (Tiva C) w/ tm4c123 (80MHz)
HARDWARE: LPTM4C1230C3PM 80MHz 32KB RAM (256KB Flash)
DEBUG: CURRENT(ti-icdi) ON-BOARD(ti-icdi)
Library Dependency Finder →
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 22 compatible libraries
Scanning dependencies…
No dependencies
Checking size .pioenvslptm4c1230c3pm irmware.elf
Memory Usage → Redirecting...
DATA: [ ] 1.6% (used 528 bytes from 32768 bytes)
PROGRAM: [ ] 0.8% (used 2084 bytes from 262144 bytes)
[SUCCESS] Took 0.70 seconds

PlatformIO Unified Debugger >
PlatformIO: Initializing remote target…
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-15:03)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 500 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 4511445 kHz
Error: open failed
in procedure ‘init’
in procedure ‘ocd_bouncer’
.pioinit:10: Error in sourced command file:
Remote communication error. Target disconnected.: No error.

It works for me on macOS. Do we need install any drivers on Windows for this board?

Thanks for checking Ivan. Yeah I installed the icdi drivers from TI site. Are there any tips for troubleshooting the debug process? It uses OpenOCD to debug?

I’ve just released a new version of dev/platform. Please update via PIO IDE > PIO Home > Platforms > Updates.

Yes, we use openOCD.

2019-04-01%20(4)

I updated and restarted PlatformIO. Provided my launch.json (default) and the error text below. Thanks so much for investigating this. I can still upload to ROM but error on debug.

launch.json

{
“version”: “0.2.0”,
“configurations”: [
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug”,
“executable”: “c:/Users/xxxx/Documents/PlatformIO/Projects/190401-213901-energia-blink/.pioenvs/lplm4f120h5qr/firmware.elf”,
“toolchainBinDir”: “C:/Users/xxxx/.platformio/packages/toolchain-gccarmnoneeabi/bin”,
“svdPath”: “C:/Users/xxxx/.platformio/platforms/titiva/misc/svd/lm4f120h5qr.svd”,
“preLaunchTask”: {
“type”: “PlatformIO”,
“task”: “Pre-Debug”
},
“internalConsoleOptions”: “openOnSessionStart”
},
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug (skip Pre-Debug)”,
“executable”: “c:/Users/xxxx/Documents/PlatformIO/Projects/190401-213901-energia-blink/.pioenvs/lplm4f120h5qr/firmware.elf”,
“toolchainBinDir”: “C:/Users/xxxx/.platformio/packages/toolchain-gccarmnoneeabi/bin”,
“svdPath”: “C:/Users/xxxx/.platformio/platforms/titiva/misc/svd/lm4f120h5qr.svd”,
“internalConsoleOptions”: “openOnSessionStart”
}
]
}

Error

GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:42)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 500 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : RCLK (adaptive clock speed)
Error: open failed
.pioinit:10: Error in sourced command file:
Remote communication error. Target disconnected.: No error.

I think I may have discovered whats wrong. Upon some inspection, the launchpad I’m using has a tm4c123gh6pm microprocessor. I noticed the one PIO supports is tm4c1230c3pm. Do you think this would cause issues and is there any quick way to implement support for this older one?

Could you try to run the next in terminal?

C:/Users/xxxx/.platformio/packages/tool-openocd/openocd -s C:/Users/xxxx/.platformio/packages/tool-openocd -f scripts/board/ek-tm4c123gxl.cfg

What do you see?

C:\WINDOWS\system32>C:/Users/xxxx/.platformio/packages/tool-openocd/bin/openocd -s C:/Users/xxxx/.platformio/packages/tool-openocd -f scripts/board/ek-tm4c123gxl.cfg
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:42)
Licensed under GNU GPL v2
For bug reports, read

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 500 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : RCLK (adaptive clock speed)
Error: open failed

I see. So, openOCD does not see your board. AsI understand, it uses libusb. Could you try Zadig tool and play with drivers? See details here for FTDIChip => FTDI Chip — PlatformIO latest documentation

Still no luck. I cycled through all of the available drivers on Zadig. Do I need to change the board and framework to anything different in platformio.ini ?

No, there is no issue with PlatformIO. If you can see, we even can’t connect to board from openOCD. What is your board? Is this official TI Launchpad?

Yeah it’s an official launchpad. Tiva C Series. I bought it in 2014 though so it’s dated if that makes any difference. I have no problem downloading/debugging using Keil.

If you check the link, I took a picture of the launchpad.

Stellaris ICDI Settings

2019-04-02

Live Debug

The unusual thing is I tested this on a different machine at work and was receiving the same error message posted above. I’ve also tested it on a Linux VM with the device passed over to it.

Do you use Windows 10? See Redirecting…

Also, could you try this version of openOCD?

Ouch, I see the suggestion in the blog was implemented on http://openocd.zylin.com/#/q/status:open+2527 but it was never merged into any branches :frowning: . I was able to pull current git repo and commit that 2527 change but I’m not the greatest at compiling C on windows or any platform. Any tips?

See Unable to debug on TM4C123 platform / Windows - #15 by ivankravets

I took the bin and script directory from that link you sent and replaced it in the packages/tool-openocd folder . but still same error. was there anything else from that zip file I should perform?

I’ve just tried to debug my board in VM Windows 10 and experience the same issues as you. Please file an issue here Issues · platformio/platform-titiva · GitHub and put a link to this discussion. It seems that we should switch to another debugging server. Need to check what Composer Studio uses.

Ok I created it. Thank you!

1 Like