10 Comments

  1. Patrick S.

    Great post. I just got a C2 myself and was hoping to get JTAG working. Haven’t tried it yet but these are some good tips. I’m currently trying to extract the usb drivers from the Hardkernal Linux build to see if I can get it running on bare metal, but still have a way to go. Do you think an older $15 JLink might work for debugging more recent chips? It only lists processors up to Cortex A17 and M33 but I’m not really familiar with JTAG.

    • ryan

      Thanks for the comment! I think more important than the adapter is the software support of a debugger for ARMv8/Aarch64. I know that OpenOCD has experimental support, which is what I was experimenting with. Realistically all that needs to happen is shifting in data to the instruction registers. I think most JTAG adapters would work fine, even if not “officially” supported.

      • Julius

        Nice article, a kind of kick starter 🙂

        I have segger Jlink, and segger doesn’t say that is supports cortex A53. What is JTAG adapter you have used.

  2. Lou

    Nice article, opens up a lot of perspectives. It seems that the master branch on openocd has some armv8 support already. Would you mind sharing your board config file for getting the A53 to work ?

    • ryan

      Sure, this is what I came up with (aml_gxbb.cfg):

      ############# config ################
      adapter_khz 2000
      debug_level 2
      reset_config none

      if { [info exists CHIPNAME] } {
      set _CHIPNAME $CHIPNAME
      } else {
      set _CHIPNAME aml
      }

      if { [info exists DAP_TAPID] } {
      set _DAP_TAPID $DAP_TAPID
      } else {
      set _DAP_TAPID 0x5ba00477
      }

      jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0x03 -expected-id $_DAP_TAPID

      set _TARGETNAME $_CHIPNAME.cpu0
      target create $_TARGETNAME aarch64 -chain-position $_CHIPNAME.dap -coreid 0 -dbgbase 0x80410000 -ctibase 0x80420000

      #set _TARGETNAME $_CHIPNAME.cpu1
      #target create $_TARGETNAME aarch64 -chain-position $_CHIPNAME.dap -coreid 1 -dbgbase 0x80510000 -ctibase 0x80520000

      #set _TARGETNAME $_CHIPNAME.cpu2
      #target create $_TARGETNAME aarch64 -chain-position $_CHIPNAME.dap -coreid 2 -dbgbase 0x80610000 -ctibase 0x80620000

      #set _TARGETNAME $_CHIPNAME.cpu3
      #target create $_TARGETNAME aarch64 -chain-position $_CHIPNAME.dap -coreid 3 -dbgbase 0x80710000 -ctibase 0x80720000

      init

      aarch64 dbginit

  3. H. Muller

    Great documentation. How did you determine the adapter_khz for both ap and pmu? I see you used 2000 KHz for the A53 and 4000 KHz for the M3.

    Every other example I have seen shows 1000 KHz. And other sources indicate that one should be able to use up to 1/6 the speed of the processor.

    Just curious if you can shed any light on that.

Leave a Reply

Your email address will not be published. Required fields are marked *