1
\$\begingroup\$

I'm trying to flash a CC2652 chip from TI with OpenOCD via Raspberry's GPIO (or SPI, or whatever suitable).

This doesn't seem to be straightforward, and I also have a Launchpad, which you can imagine as a 2-component board:

  1. XDS110 flasher with USB interface
  2. CC2652 target chip

It's designed pretty well, you can use those two components together or separately:

  • On the right side (blue area) is the XDS110 flasher
  • On the left side (green area) is the target CC2652 chip
  • In the middle (yellow area) there is a pin-header where you can connect the two parts to make the XDS110 flashing this CC2652 (and not an external one)

enter image description here

This is how it's jumpered when of interconnecting the two onboard components (please note the jumpers, it's a bit hard to see): signals connected: GND, 3V3, RESET, TMS, TCK.

enter image description here

If I remove the jumpers, and wire these signals (GND, 3V3, RESET, TMS, TCK) to an external CC2652, I can easily flash it with the official TI's tool called Uniflash (on Windows).

Now, to the real question: How can I program the onboard CC2652 (or any external CC2652) with OpenOCD by using Raspberry's GPIOs?

Because in raspberrypi-native.cfg (in interfaces):

# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
# Header pin numbers: 23 22 19 21
bcm2835gpio_jtag_nums 11 25 10 9

So, it seems it also need TDI and TDO. And while I can connect those to RXD and TXD, I don't want to.

I have created a config file for OpenOCD:

source [find interface/raspberrypi-native.cfg]
transport select jtag
adapter speed 1000
source [find target/ti_cc26x2.cfg]
init
targets
reset halt

And wired PI<->Launchpad by using GND, 3V3, GPIOs (9,10,11,25).

When I run openocd:

# openocd 
Open On-Chip Debugger 0.10.0+dev-00114-g41bcbc67d-dirty (2021-01-18-16:43)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 1006 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: cc26x2.jrc: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : starting gdb server for cc26x2.cpu on 3333
Info : Listening on port 3333 for gdb connections
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: cc26x2.jrc: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections

How can I use OpenOCD on a Raspberry Pi to program a CC2652 chip the same way as the XDS110 does (by using only RESET, TCK and TMS pins)?

\$\endgroup\$
1
  • \$\begingroup\$ From a brief Google, you may need to wire tdi and tdo as you may need 4 wire jtag. You may need to do some research. \$\endgroup\$
    – Kartman
    Sep 9, 2021 at 21:46

1 Answer 1

2
\$\begingroup\$

What I needed is a cJTAG programming mode. CC2652 uses that by default. (This mode doesn't need TDI and TDO).

However, OpenOCD doesn't support cJTAG at the moment, and when it starts flashing the CC2652, it sends it a magic byte array to switch it into normal JTAG flashing mode.

But now it needs TDI and TDO, and if the target has JTAG disabled, the magic command may fail.

Also, reset line seems impossible to handle correctly so you have to disable the automatic reset assertation befofe flashing, and assert the reset manually.

\$\endgroup\$
1
  • \$\begingroup\$ So did you figure out how to flash cc2652 using raspberry? Thanks! \$\endgroup\$ Sep 3, 2022 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.