Hi,
I’ve been trying to write bare metal code for the Radxa Zero and rather quickly realized that JTAG would be very beneficial. I looked at the schematics and saw that JTAG_B is exposed via the SD card slot.
So I wired up and connected an Olimex ARM-USB-OCD:
TDO -> SDCARD_D0 aka GPIOC_0
TDI -> SDCARD_D1 aka GPIOC_1
TCK -> SDCARD_CLK aka GPIOC_4
TMS -> SDCARD_CMD aka GPIOC_5
I used the datasheet of S905X3 to figure out what registers are available controlling the gpio pins, as I couldn’t find the complete datasheet for S905Y2. Most things seem to match the S905Y2. This way I managed to select functions, output enable, output, input, pull-up/down enable of each GPIO pin. This I’ve used so far to write to/read from UART and GPIO pins.
I selected function 2 on these pins (writing 0x00221122 to 0xFF6346E4, aka PERIPHS_PIN_MUX_9, aka 0xff634400+0xb9*4) then I also made sure that TDO, TDI and TMS were pull-up while TCK was pull-down (writing 0x000000ff to 0xFF634524, aka PAD_PULL_UP_EN_REG1, aka 0xff634400+0x49*4, and 0x000000ef to 0xFF6344EC, aka PAD_PULL_UP_REG1).
Then I’ve been attempting to connect with OpenOCD in many different configurations, either assuming a TAP of 0x5ba00477 (used in another openocd config for a S905-based SBC I found online) or 0x4ba00477 (same as RPi3), or attempting to have OpenOCD autoprobe the TAP, all ending with this error message:
Error: JTAG scan chain interrogation failed: all ones
Connecting an oscilloscope, TMS, TCK and TDI all have activity when I attempt to connect via OpenOCD, but as the above error suggests, there is absolutely no activity on TDO.
Any suggestions on what more to try, or anything obvious I’m doing wrong?
I’ve used the same JTAG debugger to successfully connect to an RPi3. One interesting note about that is that for the RPi3 it’s been necessary to tell OpenOCD to use TRST using “reset_config trst_only”, otherwise it fails to connect in the same way as with the Radxa Zero. I haven’t seen TRST be available anywhere on the Radxa Zero, is that correct?