Need help with a bricked LinkSYS E8450

Regarding 'halt' command failing, this is most likely due to nSRST not being setup properly, I've also struggled with this problem for a bit and realized I needed to properly setup the pins on my adapter for things to work.

Why are you entering all this stuff manually on the OpenOCD shell? I've just put it all into a .cfg fine loaded on start, then just issue


and you should find yourself in RAM-loaded U-Boot which allows you to write fixed bootloader to flash.

My reason for typing each command is due to crashing when I try to run:

./src/openocd -f tumpa-lite.cfg -f openocd.cfg
Open On-Chip Debugger 0.12.0+dev-00044-g4cb1fdb14 (2023-01-23-20:12)
Licensed under GNU GPL v2
For bug reports, read
adapter speed: 200 kHz

Info : linux os creation

Segmentation fault (core dumped)

What do you enable when you run make on openocd? This command fails and I think it's due to something I'm not running.

jtag_tdo_sample_edge falling

Also, I've been connecting to the JTAG pins on the Tumpa-Lite. Will this work or should I use GPIO?

I edited these lines to set up the nTrst & nSrst

ftdi layout_init 0x0038 0x087b
ftdi layout_signal nTRST -data 0x0003 -oe 0x0003
ftdi layout_signal nSRST -data 0x000F -oe 0x000F

I hope I'm not too aggravating. Thank you for helping, I mean doing most of it. :slight_smile:

Oh, I never saw that happening. Maybe try with the latest release of OpenOCD (still with the patch from mtk-openwrt on top) rather than the development version...

I need you to see what I'm doing.

Will this work? Do I need to use GPIO pins instead?

I don't know this specific adapter, but in theory yes, this looks good and should work.
Make sure the relevant signals and GND are connected, and you should be good to go.
I suppose this adapter board will have appropriate pull-up and pull-down resistors in place when using the connector with JTAG label... (?)

I removed line feed from all commands to allow me to cut/paste and see the output of each. It still crashed with seg fault.

openocd -f tumpa-lite.cfg  -f openocd.cfg 
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
Info : linux os creation

Segmentation fault (core dumped)

> adapter speed 10000
adapter speed: 10000 kHz

> transport select jtag
Transport "jtag" was already selected

************changed from jtag_tdo_sample_edge falling****************

> ftdi
ftdi samples TDO on falling edge of TCK

> adapter srst delay 750
adapter srst delay: 750

> jtag_ntrst_assert_width 100
jtag_ntrst_assert_width: 100

> jtag_ntrst_delay 50
jtag_ntrst_delay: 50

> reset_config trst_and_srst separate srst_gates_jtag srst_open_drain
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst

> if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME } else { set _CHIPNAME mt7622 }
> if { [info exists DAP_TAPID] } { set _DAP_TAPID $DAP_TAPID } else { set _DAP_TAPID 0x4ba00477 }
> jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_DAP_TAPID
The 'jtag newtap' command must be used before 'init'.


> dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
Invalid command argument
-chain-position is invalid


> target create $_CHIPNAME.ahb mem_ap -dap $_CHIPNAME.dap -ap-num 0 -dbgbase 0x80070000
The 'target create' command must be used before 'init'.

> # declare the 2 main application cores
> set _smp_command ""
> set $_TARGETNAME.base(0) 0x80810000
> set $_TARGETNAME.base(1) 0x80910000
> set $_TARGETNAME.cti(0) 0x80820000
> set $_TARGETNAME.cti(1) 0x80920000
> set _cores 2
> proc mmu_off {} { set cp [aarch64 mrc 15 0 1 0 0] set cp [expr ($cp & ~1)] aarch64 mcr 15 0 1 0 0 $cp }
> proc mmu_on {} { set cp [aarch64 mrc 15 0 1 0 0] set cp [expr ($cp | 1)] aatch64 mcr 15 0 1 0 0 $cp }

> proc mt7622_reset {} { # # halt target # poll sleep 2 halt wait_halt # # disable wdt # mww 0x10212000 0x22000000 mmu_off mt7622.core0 configure -work-area-phys 0x101000 -work-area-size 8096 # switch to AArch64 mode reg cpsr 0x1d3 load_image /usr/src/mtk-openocd-scripts/mt7622/switch_mode_32_64.bin 0x100000 bin load_image /usr/src/mtk-openocd-scripts/mt7622/aarch64_stall.bin 0x100100 bin reg pc 0x100000 resume }
> proc mt7622_ddrinit {} { # initialize DDR with for 1 chip load_image /usr/src/mtk-openocd-scripts/mt7622/bl2-1c.bin 0x201000 bin # initialize DDR with for 2 chip #load_image /usr/src/mtk-openocd-scripts/mt7622/bl2-2c.bin 0x201000 bin reg pc 0x201000 resume }
> proc mt7622_uboot {} { # load U-Boot and ATF load_image /usr/src/mtk-openocd-scripts/mt7622/fip-snand-no-bmt.bin 0x40020000 bin mww 0x100200 1 resume }


> for { set _core 0 } { $_core < $_cores } { incr _core 1 } { cti create cti$_core -dap $_CHIPNAME.dap -baseaddr [set $_TARGETNAME.cti($_core)] -ap-num 1 set _command "target create ${_TARGETNAME}$_core aarch64 \ -dap $_CHIPNAME.dap -coreid $_core -cti cti$_core \ -dbgbase [set $_TARGETNAME.base($_core)]" if { $_core != 0 } { set _smp_command "$_smp_command ${_TARGETNAME}$_core" set _command "$_command -defer-examine" } else { # uncomment to use hardware threads pseudo rtos set _command "$_command -rtos linux" set _command "$_command -work-area-size 0x40000 -work-area-phys 0xfff80000 \ -work-area-backup 0" set _smp_command "target smp ${_TARGETNAME}$_core" } eval $_command }
can't read "_command": no such variable
>  eval $_smp_command


> targets ${_TARGETNAME}0
Invalid command argument
Target: mt7622.core0 is unknown, try one of:

    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------

More info:
Since OpenOCD version 0.11.0, the Debug Access Port (DAP) is no longer implicitly created together with the target. It must be explicitly declared using the dap create command. For all ARMv6-M, ARMv7 and ARMv8 targets, the option "-dap dap_name" has to be used instead of "-chain-position" when the target is created.

> dap create -dap mt7622.dap  mt7622.cpu           
Unknown param: mt7622.dap, try one of: -chain-position, -ignore-syspwrupack, -dp-id, -instance-id, -adiv6, or -adiv5

> dap create -dap mt7622.dap            
wrong # args: should be "-dap ?name? ..options..."

Oh well... :slight_smile:

I can tell you that I was using OpenOCD commit 427552c078 (ie. before v0.11.0) with patch from mtk-openwrt on top, and that worked nicely with the configuration I have posted before (on my x86_64 host running ArchLinux)

In that case the problem must be in my board, configuration, wiring, or bad solder connections. I’ll keep working on it.

Thank you.

The first thing I’ll try is to download the same OpenOCD commit version you have.

1 Like