Error: Halt timed out, wake up GDB

Error: Halt timed out, wake up GDB

我在使用 OpenOCD 刷新 at91sam7s512 微控制器上的固件时遇到问题。

每当我发送 halt 命令(通过 telnet)时,它都会抛出以下错误:

Halt timed out, wake up GDB.
timed out while waiting for target halted
in procedure 'halt'

棋盘是Proxmark3 Easy

下面是正在使用的配置文件:

# Ports
telnet_port 4444
gdb_port 3333

# Interface
interface buspirate
buspirate_port /dev/ttyUSB0
adapter_khz 1000

# Communication speed
buspirate_speed normal # or fast

# Voltage regulator: enabled = 1 or disabled = 0
buspirate_vreg 1

# Pin mode: normal or open-drain
buspirate_mode normal

# Pull-up state: enabled = 1 or disabled = 0
buspirate_pullup 1

# use combined on interfaces or targets that can't set TRST/SRST separately
reset_config srst_only srst_pulls_trst

jtag newtap sam7x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3f0f0f0f 

target create sam7x.cpu arm7tdmi -endian little -chain-position sam7x.cpu 

sam7x.cpu configure -event reset-init { 
    soft_reset_halt
    mww 0xfffffd00 0xa5000004   # RSTC_CR: Reset peripherals
    mww 0xfffffd44 0x00008000   # WDT_MR: disable watchdog
    mww 0xfffffd08 0xa5000001   # RSTC_MR enable user reset
    mww 0xfffffc20 0x00005001   # CKGR_MOR : enable the main oscillator
    sleep 10
    mww 0xfffffc2c 0x000b1c02   # CKGR_PLLR: 16MHz * 12/2 = 96MHz
    sleep 10
    mww 0xfffffc30 0x00000007   # PMC_MCKR : MCK = PLL / 2 = 48 MHz
    sleep 10
    mww 0xffffff60 0x00480100   # MC_FMR: flash mode (FWS=1,FMCN=72)
    sleep 100

}

gdb_memory_map enable
#gdb_breakpoint_override hard
#armv4_5 core_state arm

sam7x.cpu configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x10000 -work-area-backup 0
flash bank sam7x512.flash.0 at91sam7 0 0 0 0 sam7x.cpu 0 0 0 0 0 0 0 18432
flash bank sam7x512.flash.1 at91sam7 0 0 0 0 sam7x.cpu 1 0 0 0 0 0 0 18432

可以采取哪些步骤来解决此问题

交换 MISO 和 MOSI 线。对于我的 Bus Pirate v3 和 Proxmark3 Easy,正确的连接是:

TMS <-> CS
TDI <-> MOSI
TDO <-> MISO
TCK <-> CLK
GND <-> GND
+3.3 <-> +3.3

有两种选择可供您选择,JTAG 和 USB。

JTAG

JTAG 接口在某些 CPU 上默认禁用,由于它们的代码读出保护 (CRP),需要手动启用。

为此,您需要在设备开启时通过将 PIN 55 (ERASE) 与 3.3V 短接来擦除芯片。

此后内存将被擦除并关闭保护。然后就可以正常刷机了。

来源

Proxmark 论坛

http://www.proxmark.org/forum/viewtopic.php?id=6306

官方 CPU 文档,第 4.9.3 节

http://www.equinox-tech.com/downloads/equinox/ApplicationNotes/AN122%20Atmel%20AT91SAM7%20ISP%20Programming_V1-13_250110.pdf

USB

或者,您可以尝试通过 USB 执行此过程。

首先检查插入时是否检测到Proxmark。

运行 watch命令,看你插上有没有变化

watch ls -l /dev/ttyACM0

按住 Proxmark 侧面的按钮,然后通过 USB 连接并检查 watch 的命令输出是否发生变化。如果确实如此并且文件出现,您可以继续进行此操作。

请务必按住按钮直到闪烁过程完成。

您需要编译在官方仓库 https://github.com/Proxmark/proxmark3 中找到的 Proxmark3 源代码才能获得刷机工具 (flasher) 和刷机映像(bootrom.elf 和 fullimage.elf) .如果您已经继续 Flashing,否则请先执行下面的 Compilation 步骤。

闪烁

刷机过程中不要按回车

./client/flasher /dev/ttyACM0 -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf

启动 Proxmark 客户端并测试是否有效

./client/proxmark3 /dev/ttyACM0

编译

将当前用户添加到拨出组

sudo adduser $USER dialout

注销并重新登录以使更改生效

安装必要的组件

sudo apt-get install p7zip git build-essential libreadline5 libreadline-dev libusb-0.1-4 libusb-dev libqt4-dev perl pkg-config wget libncurses5-dev gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib

克隆存储库

git clone https://github.com/proxmark/proxmark3.git

cd proxmark3

添加 Udev 规则

sudo cp -rf driver/77-mm-usb-device-blacklist.rules /etc/udev/rules.d/77-mm-usb-device-blacklist.rules

sudo udevadm control --reload-rules

制作

make clean && make all

在 tty 接口上识别 Proxmark3(通常这是 ttyACM0,这是我将在 Flashing 中使用的)

dmesg | grep -i usb

继续闪烁

来源https://wiki.elvis.science/index.php?title=Proxmark3:_Debricking(Linux安装)