您尚未登录。

楼主 # 昨天 16:06:18

zm
会员
注册时间: 2023-09-28
已发帖子: 14
积分: 20

t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

最近一直在研究openocd + jlink方式调试t113裸机,
目前t113s3 如果使用sd0引脚作为jtag引脚的话,看下面的打印应该算是连上了。

C:\msys64\mingw64\bin>openocd.exe -f t113s3-mangguo.cfg -f t113s3.cfg -d -s E:\资料\T113S3\
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 3 3 options.c:52 configuration_output_handler(): debug_level: 3
User : 4 5 options.c:52 configuration_output_handler():
Debug: 5 7 configuration.c:33 add_script_search_dir(): adding E:\资料\T113S3\
Debug: 6 9 options.c:233 add_default_dirs(): bindir=D:/a/msys64/mingw64/bin
Debug: 7 11 options.c:234 add_default_dirs(): pkgdatadir=D:/a/msys64/mingw64/share/openocd
Debug: 8 13 options.c:235 add_default_dirs(): exepath=C:/msys64/mingw64/bin
Debug: 9 15 options.c:236 add_default_dirs(): bin2data=../share/openocd
Debug: 10 17 configuration.c:33 add_script_search_dir(): adding C:/Users/17204/AppData/Roaming/OpenOCD
Debug: 11 19 configuration.c:33 add_script_search_dir(): adding C:/msys64/mingw64/bin/../share/openocd/site
Debug: 12 24 configuration.c:33 add_script_search_dir(): adding C:/msys64/mingw64/bin/../share/openocd/scripts
Debug: 13 26 command.c:155 script_debug(): command - ocd_find t113s3-mangguo.cfg
Debug: 14 28 configuration.c:88 find_file(): found E:\资料\T113S3\/t113s3-mangguo.cfg
Debug: 15 31 command.c:155 script_debug(): command - ocd_find interface/jlink.cfg
Debug: 16 33 configuration.c:88 find_file(): found C:/msys64/mingw64/bin/../share/openocd/scripts/interface/jlink.cfg
Debug: 17 36 command.c:155 script_debug(): command - adapter driver jlink
Debug: 18 39 command.c:155 script_debug(): command - adapter speed 1000
Debug: 19 41 adapter.c:251 adapter_config_khz(): handle adapter khz
Debug: 20 42 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 21 45 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 22 47 command.c:155 script_debug(): command - transport select jtag
User : 23 49 options.c:52 configuration_output_handler(): jtagUser : 24 50 options.c:52 configuration_output_handler():
Debug: 25 51 command.c:155 script_debug(): command - ocd_find t113s3.cfg
Debug: 26 55 configuration.c:88 find_file(): found E:\资料\T113S3\/t113s3.cfg
Debug: 27 57 command.c:155 script_debug(): command - reset_config none srst_pulls_trst
Debug: 28 59 command.c:155 script_debug(): command - jtag newtap t113s3 cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id 0x5ba00477
Debug: 29 62 tcl.c:557 jim_newtap_cmd(): Creating New Tap, Chip: t113s3, Tap: cpu, Dotted: t113s3.cpu, 8 params
Debug: 30 65 tcl.c:582 jim_newtap_cmd(): Processing option: -irlen
Debug: 31 67 tcl.c:582 jim_newtap_cmd(): Processing option: -ircapture
Debug: 32 70 tcl.c:582 jim_newtap_cmd(): Processing option: -irmask
Debug: 33 72 tcl.c:582 jim_newtap_cmd(): Processing option: -expected-id
Debug: 34 74 core.c:1474 jtag_tap_init(): Created Tap: t113s3.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
Debug: 35 76 command.c:155 script_debug(): command - dap create t113s3.dap -chain-position t113s3.cpu
Debug: 36 79 command.c:155 script_debug(): command - target create t113s3.cpu cortex_a -dap t113s3.dap
Info : 37 82 server.c:297 add_service(): Listening on port 6666 for tcl connections
Info : 38 85 server.c:297 add_service(): Listening on port 4444 for telnet connections
Debug: 39 88 command.c:155 script_debug(): command - init
Debug: 40 89 command.c:155 script_debug(): command - target init
Debug: 41 91 command.c:155 script_debug(): command - target names
Debug: 42 92 command.c:155 script_debug(): command - t113s3.cpu cget -event gdb-flash-erase-start
Debug: 43 95 command.c:155 script_debug(): command - t113s3.cpu configure -event gdb-flash-erase-start reset init
Debug: 44 97 command.c:155 script_debug(): command - t113s3.cpu cget -event gdb-flash-write-end
Debug: 45 102 command.c:155 script_debug(): command - t113s3.cpu configure -event gdb-flash-write-end reset halt
Debug: 46 105 command.c:155 script_debug(): command - t113s3.cpu cget -event gdb-attach
Debug: 47 107 command.c:155 script_debug(): command - t113s3.cpu configure -event gdb-attach halt 1000
Debug: 48 110 target.c:1657 handle_target_init_command(): Initializing targets...
Debug: 49 111 semihosting_common.c:109 semihosting_common_init():
Debug: 50 114 jlink.c:635 jlink_init(): Using libjaylink 0.4.0 (compiled with 0.4.0)
Debug: 51 130 jlink.c:514 jaylink_log_handler(): Found device (VID:PID = 1366:0105, bus:address = 002:055)
Debug: 52 133 jlink.c:514 jaylink_log_handler(): Device: USB address = 0
Debug: 53 135 jlink.c:514 jaylink_log_handler(): Device: Serial number = 4294967295
Debug: 54 137 jlink.c:514 jaylink_log_handler(): Allocating new device instance
Debug: 55 139 jlink.c:514 jaylink_log_handler(): Found 1 USB device(s)
Debug: 56 141 jlink.c:514 jaylink_log_handler(): Trying to open device (bus:address = 002:055)
Debug: 57 143 jlink.c:514 jaylink_log_handler(): Using endpoint 83 (IN) and 02 (OUT)
Debug: 58 147 jlink.c:514 jaylink_log_handler(): Device opened successfully
Info : 66 149 jlink.c:707 jlink_init(): J-Link V1n compiled Feb 13 2023 17:39:21
Info : 79 152 jlink.c:748 jlink_init(): Hardware version: 11.00
Info : 88 153 jlink.c:789 jlink_init(): VTarget = 3.321 V
Debug: 94 155 jlink.c:514 jaylink_log_handler(): Last read operation left 16 bytes in the buffer
Debug: 104 158 jlink.c:942 jlink_reset(): TRST: 0, SRST: 0
Debug: 124 174 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 125 178 adapter.c:219 adapter_khz_to_speed(): have adapter set up
Debug: 132 180 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 133 183 adapter.c:219 adapter_khz_to_speed(): have adapter set up
Info : 134 185 adapter.c:179 adapter_init(): clock speed 1000 kHz
Debug: 135 187 openocd.c:134 handle_init_command(): Debug Adapter init complete
Debug: 136 191 command.c:155 script_debug(): command - transport init
Debug: 137 193 transport.c:219 handle_transport_init(): handle_transport_init
Debug: 138 195 jlink.c:942 jlink_reset(): TRST: 0, SRST: 0
Debug: 143 196 core.c:830 jtag_add_reset(): SRST line released
Debug: 144 198 core.c:855 jtag_add_reset(): TRST line released
Debug: 145 199 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 146 201 command.c:155 script_debug(): command - jtag arp_init
Debug: 147 203 core.c:1509 jtag_init_inner(): Init JTAG chain
Debug: 148 207 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 158 209 core.c:1234 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 159 212 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 169 215 core.c:1133 jtag_examine_chain_display(): JTAG tap: t113s3.cpu tap/device found: 0x5ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x5)
Debug: 170 219 core.c:1364 jtag_validate_ircapture(): IR capture validation scan
Debug: 180 222 core.c:1421 jtag_validate_ircapture(): t113s3.cpu: IR capture 0x01
Debug: 181 224 command.c:155 script_debug(): command - dap init
Debug: 182 226 arm_dap.c:97 dap_init_all(): Initializing all DAPs ...
Debug: 183 228 arm_dap.c:121 dap_init_all(): DAP t113s3.cpu configured by default to use ADIv5 protocol
Debug: 184 230 arm_adi_v5.c:679 dap_dp_init(): t113s3.dap
Debug: 185 232 arm_adi_v5.c:711 dap_dp_init(): DAP: wait CDBGPWRUPACK
Debug: 186 233 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000
Debug: 205 239 arm_adi_v5.c:719 dap_dp_init(): DAP: wait CSYSPWRUPACK
Debug: 206 241 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000
Debug: 243 244 openocd.c:151 handle_init_command(): Examining targets...
Debug: 244 246 target.c:1843 target_call_event_callbacks(): target event 19 (examine-start) for core t113s3.cpu
Debug: 245 250 arm_adi_v5.c:1095 dap_get_ap(): refcount AP#0x0 get 1
Debug: 264 253 arm_adi_v5.c:1120 dap_put_ap(): refcount AP#0x0 put 0
Debug: 265 255 arm_adi_v5.c:1095 dap_get_ap(): refcount AP#0x1 get 1
Debug: 284 258 arm_adi_v5.c:1038 dap_find_get_ap(): Found MEM-AP APB2 or APB3 at AP index: 1 (IDR=0x44770002)
Debug: 321 263 arm_adi_v5.c:825 mem_ap_init(): MEM_AP Packed Transfers: disabled
Debug: 322 267 arm_adi_v5.c:836 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0
Debug: 323 270 cortex_a.c:2901 cortex_a_examine_first(): t113s3.cpu's dbgbase is not set, trying to detect using the ROM table
Debug: 576 308 arm_adi_v5.c:2200 dap_lookup_cs_component(): CS lookup found at 0x81410000
Debug: 577 313 cortex_a.c:2911 cortex_a_examine_first(): Detected core 0 dbgbase: 0x81410000
Debug: 614 318 cortex_a.c:2934 cortex_a_examine_first(): didr = 0x3515f005
Debug: 615 320 cortex_a.c:2935 cortex_a_examine_first(): cpuid = 0x410fc075
Debug: 634 324 cortex_a.c:2944 cortex_a_examine_first(): target->coreid 0 DBGPRSR  0x2b
Debug: 635 327 cortex_a.c:2953 cortex_a_examine_first(): target->coreid 0 was reset!
Debug: 654 330 cortex_a.c:2960 cortex_a_examine_first(): target->coreid 0 DBGOSLSR 0xa
Debug: 655 332 cortex_a.c:2966 cortex_a_examine_first(): target->coreid 0 OSLock set! Trying to unlock
Debug: 710 337 cortex_a.c:2991 cortex_a_examine_first(): target->coreid 0 has security extensions
Debug: 711 341 cortex_a.c:2996 cortex_a_examine_first(): target->coreid 0 has virtualization extensions
Info : 712 344 arm_dpm.c:1100 arm_dpm_setup(): t113s3.cpu: hardware has 6 breakpoints, 4 watchpoints
Debug: 713 347 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 81410140
Debug: 732 350 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 81410144
Debug: 751 353 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 81410148
Debug: 770 357 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 8141014c
Debug: 789 361 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 81410150
Debug: 808 364 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 81410154
Debug: 827 367 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 814101c0
Debug: 846 371 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 814101c4
Debug: 865 375 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 814101c8
Debug: 884 378 cortex_a.c:595 cortex_a_bpwp_disable(): A: bpwp disable, cr 814101cc
Debug: 903 381 cortex_a.c:3030 cortex_a_examine_first(): Configured 6 hw breakpoints
Debug: 904 383 cortex_a.c:3044 cortex_a_examine_first(): Configured 4 hw watchpoints
Debug: 977 391 target.c:1843 target_call_event_callbacks(): target event 21 (examine-end) for core t113s3.cpu
Debug: 978 394 command.c:155 script_debug(): command - flash init
Debug: 979 395 tcl.c:1375 handle_flash_init_command(): Initializing flash devices...
Debug: 980 397 command.c:155 script_debug(): command - nand init
Debug: 981 399 tcl.c:487 handle_nand_init_command(): Initializing NAND devices...
Debug: 982 402 command.c:155 script_debug(): command - pld init
Debug: 983 404 pld.c:194 handle_pld_init_command(): Initializing PLDs...
Debug: 984 407 command.c:155 script_debug(): command - tpiu init
Info : 985 409 gdb_server.c:3791 gdb_target_start(): starting gdb server for t113s3.cpu on 3333
Info : 986 412 server.c:297 add_service(): Listening on port 3333 for gdb connections

环境:MQ芒果派; JLINKV11 ;openocev0.12.0
a95a1ff07469f19b38171c18bdc5dd71_compress.jpg
但是由于我想将sd卡用起来,所以想将t113的jtag引脚重映射成pe8 pe9 pe10 pe11。
datasheet明确说了jtag引脚是可以重映射成pe引脚的
%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-07-08%20fff.png
尝试步骤:
1.电平问题
%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-07-08%20153515.png
可能jtag的电平需要3.3v,所以我将电阻R56扣下来焊到了R57处,使PE引脚输出3.3v
2.重写xfel payload
xfel可以直接设置jtag,发现xfel的jtag配置默认使用pf引脚,于是重新改写了jtag的payload
payloads/r528_t113/jtag/source/sys-jtag.c

#include <xboot.h>

void sys_jtag_init(void)
{
	virtual_addr_t addr;
	u32_t val;

	/* Config GPIOF0, GPIOF1, GPIOF3 and GPIOF5 to JTAG mode */
	addr = 0x020000f0 + 0x00;
	val = read32(addr);
	val &= ~(0xf << ((0 & 0x7) << 2));
	val |= ((0x3 & 0xf) << ((0 & 0x7) << 2));
	write32(addr, val);

	val = read32(addr);
	val &= ~(0xf << ((1 & 0x7) << 2));
	val |= ((0x3 & 0xf) << ((1 & 0x7) << 2));
	write32(addr, val);

	val = read32(addr);
	val &= ~(0xf << ((3 & 0x7) << 2));
	val |= ((0x3 & 0xf) << ((3 & 0x7) << 2));
	write32(addr, val);

	val = read32(addr);
	val &= ~(0xf << ((5 & 0x7) << 2));
	val |= ((0x3 & 0xf) << ((5 & 0x7) << 2));
	write32(addr, val);
}



void sys_jtag_init2(void)
{
	virtual_addr_t addr;
	u32_t val;

	/* Config GPIOE8, GPIOE9, GPIOE10 and GPIOE11 to JTAG mode 
			  MS        DI      DO          CK*/
	addr = 0x020000c4 + 0x00;
	val = read32(addr);
	val &= ~(0xf << (((8-8) & 0x7) << 2));
	val |= ((0x6 & 0xf) << (((8-8) & 0x7) << 2));
	write32(addr, val);

	val = read32(addr);
	val &= ~(0xf << (((9-8) & 0x7) << 2));
	val |= ((0x6 & 0xf) << (((9-8) & 0x7) << 2));
	write32(addr, val);

	val = read32(addr);
	val &= ~(0xf << (((10-8) & 0x7) << 2));
	val |= ((0x6 & 0xf) << (((10-8) & 0x7) << 2));
	write32(addr, val);

	val = read32(addr);
	val &= ~(0xf << (((11-8) & 0x7) << 2));
	val |= ((0x6 & 0xf) << (((11-8) & 0x7) << 2));
	write32(addr, val);
} 

payloads/r528_t113/jtag/source/start.S

 /*
 * start.S
 *
 * Copyright(c) 2007-2021 Jianjun Jiang <8192542@qq.com>
 * Official site: http://xboot.org
 * Mobile phone: +86-18665388956
 * QQ: 8192542
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

	.global _start
_start:
	mov r0, #0
	mcr p15, 0, r0, c8, c7, 0
	mcr p15, 0, r0, c7, c5, 0
	mcr p15, 0, r0, c7, c5, 6
	mcr p15, 0, r0, c7, c10, 4
	mcr p15, 0, r0, c7, c5, 4
	b reset

reset:
	ldr r0, =0x00047fe0
	str sp, [r0, #0]
	str lr, [r0, #4]
	mrs lr, cpsr
	str lr, [r0, #8]
	mrc p15, 0, lr, c1, c0, 0
	str lr, [r0, #12]
	mrc p15, 0, lr, c12, c0, 0
	str lr, [r0, #16]
	mrc p15, 0, lr, c1, c0, 0
	str lr, [r0, #20]

	bl sys_jtag_init2

	ldr r0, =0x00047fe0
	ldr sp, [r0, #0]
	ldr lr, [r0, #4]
	ldr r1, [r0, #20]
	mcr p15, 0, r1, c1, c0, 0
	ldr r1, [r0, #16]
	mcr p15, 0, r1, c12, c0, 0
	ldr r1, [r0, #12]
	mcr p15, 0, r1, c1, c0, 0
	ldr r1, [r0, #8]
	msr cpsr, r1
	bx lr

进入jtag目录,编译,生成bin文件,再将bin文件翻译成数组,修改chips/r528_t113.c文件下chip_jtag函数中的payload数组,重新编译xfel,make install。
测试:

xfel ddr t113-s3
xfel jtag

输出报错:
Error: 169 227 core.c:1122 jtag_examine_chain_check(): JTAG scan chain interrogation failed: all zeroes
Error: 170 234 core.c:1124 jtag_examine_chain_check(): Check JTAG interface, timings, target power, etc.
Error: 171 237 core.c:1554 jtag_init_inner(): Trying to use configured scan chain anyway...
完整日志:

C:\msys64\mingw64\bin>openocd.exe -f t113s3-mangguo.cfg -f t113s3.cfg -d -s E:\资料\T113S3\
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 3 3 options.c:52 configuration_output_handler(): debug_level: 3
User : 4 5 options.c:52 configuration_output_handler():
Debug: 5 7 configuration.c:33 add_script_search_dir(): adding E:\资料\T113S3\
Debug: 6 10 options.c:233 add_default_dirs(): bindir=D:/a/msys64/mingw64/bin
Debug: 7 12 options.c:234 add_default_dirs(): pkgdatadir=D:/a/msys64/mingw64/share/openocd
Debug: 8 14 options.c:235 add_default_dirs(): exepath=C:/msys64/mingw64/bin
Debug: 9 16 options.c:236 add_default_dirs(): bin2data=../share/openocd
Debug: 10 18 configuration.c:33 add_script_search_dir(): adding C:/Users/17204/AppData/Roaming/OpenOCD
Debug: 11 22 configuration.c:33 add_script_search_dir(): adding C:/msys64/mingw64/bin/../share/openocd/site
Debug: 12 26 configuration.c:33 add_script_search_dir(): adding C:/msys64/mingw64/bin/../share/openocd/scripts
Debug: 13 29 command.c:155 script_debug(): command - ocd_find t113s3-mangguo.cfg
Debug: 14 31 configuration.c:88 find_file(): found E:\资料\T113S3\/t113s3-mangguo.cfg
Debug: 15 37 command.c:155 script_debug(): command - ocd_find interface/jlink.cfg
Debug: 16 40 configuration.c:88 find_file(): found C:/msys64/mingw64/bin/../share/openocd/scripts/interface/jlink.cfg
Debug: 17 45 command.c:155 script_debug(): command - adapter driver jlink
Debug: 18 47 command.c:155 script_debug(): command - adapter speed 1000
Debug: 19 50 adapter.c:251 adapter_config_khz(): handle adapter khz
Debug: 20 52 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 21 54 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 22 57 command.c:155 script_debug(): command - transport select jtag
User : 23 61 options.c:52 configuration_output_handler(): jtagUser : 24 63 options.c:52 configuration_output_handler():
Debug: 25 65 command.c:155 script_debug(): command - ocd_find t113s3.cfg
Debug: 26 68 configuration.c:88 find_file(): found E:\资料\T113S3\/t113s3.cfg
Debug: 27 70 command.c:155 script_debug(): command - reset_config none srst_pulls_trst
Debug: 28 72 command.c:155 script_debug(): command - jtag newtap t113s3 cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id 0x5ba00477
Debug: 29 78 tcl.c:557 jim_newtap_cmd(): Creating New Tap, Chip: t113s3, Tap: cpu, Dotted: t113s3.cpu, 8 params
Debug: 30 82 tcl.c:582 jim_newtap_cmd(): Processing option: -irlen
Debug: 31 83 tcl.c:582 jim_newtap_cmd(): Processing option: -ircapture
Debug: 32 85 tcl.c:582 jim_newtap_cmd(): Processing option: -irmask
Debug: 33 87 tcl.c:582 jim_newtap_cmd(): Processing option: -expected-id
Debug: 34 89 core.c:1474 jtag_tap_init(): Created Tap: t113s3.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
Debug: 35 93 command.c:155 script_debug(): command - dap create t113s3.dap -chain-position t113s3.cpu
Debug: 36 98 command.c:155 script_debug(): command - target create t113s3.cpu cortex_a -dap t113s3.dap
Info : 37 101 server.c:297 add_service(): Listening on port 6666 for tcl connections
Info : 38 103 server.c:297 add_service(): Listening on port 4444 for telnet connections
Debug: 39 105 command.c:155 script_debug(): command - init
Debug: 40 107 command.c:155 script_debug(): command - target init
Debug: 41 110 command.c:155 script_debug(): command - target names
Debug: 42 112 command.c:155 script_debug(): command - t113s3.cpu cget -event gdb-flash-erase-start
Debug: 43 114 command.c:155 script_debug(): command - t113s3.cpu configure -event gdb-flash-erase-start reset init
Debug: 44 117 command.c:155 script_debug(): command - t113s3.cpu cget -event gdb-flash-write-end
Debug: 45 119 command.c:155 script_debug(): command - t113s3.cpu configure -event gdb-flash-write-end reset halt
Debug: 46 122 command.c:155 script_debug(): command - t113s3.cpu cget -event gdb-attach
Debug: 47 126 command.c:155 script_debug(): command - t113s3.cpu configure -event gdb-attach halt 1000
Debug: 48 129 target.c:1657 handle_target_init_command(): Initializing targets...
Debug: 49 131 semihosting_common.c:109 semihosting_common_init():
Debug: 50 133 jlink.c:635 jlink_init(): Using libjaylink 0.4.0 (compiled with 0.4.0)
Debug: 51 149 jlink.c:514 jaylink_log_handler(): Found device (VID:PID = 1366:0105, bus:address = 002:055)
Debug: 52 152 jlink.c:514 jaylink_log_handler(): Device: USB address = 0
Debug: 53 154 jlink.c:514 jaylink_log_handler(): Device: Serial number = 4294967295
Debug: 54 158 jlink.c:514 jaylink_log_handler(): Allocating new device instance
Debug: 55 160 jlink.c:514 jaylink_log_handler(): Found 1 USB device(s)
Debug: 56 162 jlink.c:514 jaylink_log_handler(): Trying to open device (bus:address = 002:055)
Debug: 57 164 jlink.c:514 jaylink_log_handler(): Using endpoint 83 (IN) and 02 (OUT)
Debug: 58 167 jlink.c:514 jaylink_log_handler(): Device opened successfully
Info : 66 169 jlink.c:707 jlink_init(): J-Link V1n compiled Feb 13 2023 17:39:21
Info : 79 173 jlink.c:748 jlink_init(): Hardware version: 11.00
Info : 88 175 jlink.c:789 jlink_init(): VTarget = 3.322 V
Debug: 94 176 jlink.c:514 jaylink_log_handler(): Last read operation left 16 bytes in the buffer
Debug: 104 179 jlink.c:942 jlink_reset(): TRST: 0, SRST: 0
Debug: 124 185 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 125 188 adapter.c:219 adapter_khz_to_speed(): have adapter set up
Debug: 132 190 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 133 193 adapter.c:219 adapter_khz_to_speed(): have adapter set up
Info : 134 195 adapter.c:179 adapter_init(): clock speed 1000 kHz
Debug: 135 196 openocd.c:134 handle_init_command(): Debug Adapter init complete
Debug: 136 198 command.c:155 script_debug(): command - transport init
Debug: 137 202 transport.c:219 handle_transport_init(): handle_transport_init
Debug: 138 204 jlink.c:942 jlink_reset(): TRST: 0, SRST: 0
Debug: 143 206 core.c:830 jtag_add_reset(): SRST line released
Debug: 144 208 core.c:855 jtag_add_reset(): TRST line released
Debug: 145 210 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 146 212 command.c:155 script_debug(): command - jtag arp_init
Debug: 147 216 core.c:1509 jtag_init_inner(): Init JTAG chain
Debug: 148 219 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 158 222 core.c:1234 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 159 224 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Error: 169 227 core.c:1122 jtag_examine_chain_check(): JTAG scan chain interrogation failed: all zeroes
Error: 170 234 core.c:1124 jtag_examine_chain_check(): Check JTAG interface, timings, target power, etc.
Error: 171 237 core.c:1554 jtag_init_inner(): Trying to use configured scan chain anyway...
Debug: 172 239 core.c:1364 jtag_validate_ircapture(): IR capture validation scan
Error: 182 242 core.c:1413 jtag_validate_ircapture(): t113s3.cpu: IR capture error; saw 0x00 not 0x01
Debug: 183 248 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset
Warn : 193 252 core.c:1577 jtag_init_inner(): Bypassing JTAG setup events due to errors
Debug: 194 254 command.c:155 script_debug(): command - dap init
Debug: 195 256 arm_dap.c:97 dap_init_all(): Initializing all DAPs ...
Debug: 196 258 arm_dap.c:121 dap_init_all(): DAP t113s3.cpu configured by default to use ADIv5 protocol
Debug: 197 264 arm_adi_v5.c:679 dap_dp_init(): t113s3.dap
Debug: 198 266 arm_adi_v5.c:711 dap_dp_init(): DAP: wait CDBGPWRUPACK
Debug: 199 268 arm_adi_v5.h:638 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000
Error: 209 271 adi_v5_jtag.c:446 jtagdp_overrun_check(): Invalid ACK (0) in DAP response
Debug: 219 274 command.c:544 run_command(): Command 'dap init' failed with error code -107
User : 220 280 command.c:608 command_run_line():
Debug: 221 281 command.c:544 run_command(): Command 'init' failed with error code -4
User : 222 283 command.c:608 command_run_line():
Debug: 223 285 target.c:2199 target_free_all_working_areas_restore(): freeing all working areas
Debug: 229 288 jlink.c:514 jaylink_log_handler(): Last read operation left 16 bytes in the buffer
Debug: 231 292 jlink.c:514 jaylink_log_handler(): Closing device (bus:address = 002:055)
Debug: 232 296 jlink.c:514 jaylink_log_handler(): Device closed successfully
Debug: 233 299 jlink.c:514 jaylink_log_handler(): Device destroyed (bus:address = 002:055)

最后,又查看trm手册,是不是jtag需要重新复位一下,于是又操作了GIC_JTAG_RST_CTRL寄存器进行了jtag复位
%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-07-08%2011.png
%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-07-08%2022.png
,最终还是报错,依旧是相同的原因
Error: 169 227 core.c:1122 jtag_examine_chain_check(): JTAG scan chain interrogation failed: all zeroes
Error: 170 234 core.c:1124 jtag_examine_chain_check(): Check JTAG interface, timings, target power, etc.
Error: 171 237 core.c:1554 jtag_init_inner(): Trying to use configured scan chain anyway...

有没有大佬给指条明路啊?

离线

#1 昨天 16:11:04

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,393
积分: 9202

Re: t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

既然PF组可以进jtag,那执行上面的代码看下PE组IO的复用状态。





离线

楼主 #2 昨天 17:38:43

zm
会员
注册时间: 2023-09-28
已发帖子: 14
积分: 20

Re: t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

晕哥 说:

既然PF组可以进jtag,那执行上面的代码看下PE组IO的复用状态。

看了,确认了PE组是jtag模式了

离线

#3 昨天 18:19:46

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,393
积分: 9202

Re: t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

zm 说:
晕哥 说:

既然PF组可以进jtag,那执行上面的代码看下PE组IO的复用状态。

看了,确认了PE组是jtag模式了

那是不是还需要PF组的IO退出jtag复用?





离线

楼主 #4 昨天 18:45:44

zm
会员
注册时间: 2023-09-28
已发帖子: 14
积分: 20

Re: t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

哈哈,终于知道原因了,原来是t113s3上电默认pf组就是jtag模式,根本不需要软件进行配置,而我配置PE组为jtag模式时,此时PF组仍然占据着jtag,会配置失败,正确做法是上电先将PF0 PF1 PF3 PF5配置成io disabled ,然后再配置PE组io,这样就ok了!!!

离线

楼主 #5 昨天 18:48:37

zm
会员
注册时间: 2023-09-28
已发帖子: 14
积分: 20

Re: t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

晕哥 说:
zm 说:
晕哥 说:

既然PF组可以进jtag,那执行上面的代码看下PE组IO的复用状态。

看了,确认了PE组是jtag模式了

那是不是还需要PF组的IO退出jtag复用?

确实,确实。

离线

#6 昨天 19:03:17

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,393
积分: 9202

Re: t113 到底怎样才能将jtag引脚从pf重映射到pe啊?

zm 说:
晕哥 说:
zm 说:

看了,确认了PE组是jtag模式了

那是不是还需要PF组的IO退出jtag复用?

确实,确实。

感谢您分享宝贵经验!





离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn