czak / bare-tinker

Bare metal experiments on Tinker Board
0 stars 0 forks source link

no comment section on blog, so a question #1

Open hanetzer opened 2 years ago

hanetzer commented 2 years ago

https://czak.pl/2020/05/10/bare-tinker-jtag.html reading this, fun stuff. Is my understanding that you write blinky in a rksd format for rk32 to an sdcard, load it over the breakout board, and then continue from there using openocd? I have a few rk3288/rk3399 devices, as well as allwinner and hisi that expose jtag over the microsd as well, so this is very relevant to my interests.

czak commented 2 years ago

Pretty much yes.

As soon as you're connected with OpenOCD through JTAG and halt-ed, you are free to inspect, load other binaries, step through etc.

For RK3288 this requires the GRF_GPIO6C_IOMUX modification because JTAG is not enabled by default.

hanetzer commented 2 years ago

Neat. Question two: does reset init/reset halt work with your current openocd setup? I've been tinkering with that hisi device and having issue getting that to work.

GMMan commented 9 months ago

There's no AICR on Cortex-A, and the NPOR pin isn't readily accessible, so there's nowhere you can indicate a reset. Even if you did connect it, the bootrom quickly runs through its boot device list, one of which is sdmmc0 and will mux the microSD slot back to SD functionality and you'll lose JTAG connection.

Edit: I played around with this more (on a different Rockchip SoC), and while you can poke CRU_GLB_SRST_FST_VALUE or CRU_GLB_SRST_SND_VALUE as a part of the reset-assert event, OpenOCD always complains about ran after reset and before halt, and the SoC seems to stop early enough before it muxes sdmmc0. So technically possible, just not in the way that you would usually want it.