; -------------------------------------------------------------------------------- ; @Title: Example for manual JTAG access, Debugger in DOWN Mode ; @Description: ;This script reads out the IDCODE of an ARM7 core when the debugger is in ;DOWN mode. ;Detailed knowledge about JTAG is required to use manual JTAG control signals! ;Tested on an ARM7 target board. ; @Keywords: idcode ; @Author: PEG ; @Props: Template ; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only ; -------------------------------------------------------------------------------- ; $Id: example1.cmm 6982 2023-02-22 11:10:17Z kjmal $ ; @Copyright: Semidrive semiconductor ; @Title: Semidrive Secure Debug logic. ; The debugger is in DOWN mode, the JTAG driver is tristated. area SYStem.CPU CortexR5 SYStem.CONFIG.apbaccessport 0 SYStem.CONFIG.apbap1.base 0x2000 SYStem.CONFIG.debugaccessport 0 SYStem.CONFIG.debugap1.base 0x2000 SYStem.CONFIG.COREDEBUG.Base 0xF2081000 ;e3 ;SYStem.CONFIG.COREDEBUG.Base 0xF0a01000 SYStem.Option.TRST OFF SYStem.JtagClock 1MHz JTAG.PIN ENable ; enable JTAG output driver JTAG.SHIFTTMS 1 1 1 1 1 ; soft reset of the JTAG interface, goto Test-Logic Reset state JTAG.SHIFTTMS 0 1 1 0 0 ; goto Shift-IR state JTAG.SHIFTREG 1 1 1 1 ; shift in UID instruction, goto exit1-ir JTAG.SHIFTTMS 1 1 0 0 ; goto Shift-DR state JTAG.SHIFTREG %long 0x0 0x0 ; shift in 64bit dummy code. shift out our uid, goto exit1-dr PRINT JTAG.SHIFT() ; print the UID JTAG.SHIFTTMS 1 1 0 0 ; goto Shift-DR state JTAG.SHIFTREG %long 0x74657374 0x6b657930 ; Note: 0x74657374 --> SEC_DBG_CFG[31, 0]!!, 0x6b657930 --> SEC_DBG_CFG[63, 32]!! ; shift in the corresponding key .shift out our uid, goto exit1-dr PRINT JTAG.SHIFT() JTAG.SHIFTTMS 1 1 1 1 1 ; goto Test-Logic Reset state JTAG.SHIFTTMS 0 1 0 0 ; goto Shift-DR state JTAG.SHIFTREG %long 0x0 ; shift our IDCODE, goto exit1-dr PRINT JTAG.SHIFT() JTAG.PIN Disable ; Disable JTAG output driver SYStem.Mode Attach ;attach ENDDO