Files
uv-k5-v3-emulator/tools/gpiob_dump.sh
T
mckero 542515d5ad Finish the portability sweep: one firmware resolver, no author paths
The probe scripts, run.sh, trace_run.sh, webui.py and two emulator tests each named the same hardcoded firmware from a source tree that is not in this repository. They now resolve QEMU and the firmware the way tools/uvk5_testenv.py does -- environment, then PATH, then whatever the checkout has -- and skip with a reason when there is nothing.

webui.py's --qemu and --elf lost their author defaults too: a bare qemu-system-arm through PATH, and no firmware until one is uploaded, which the page already reports.
2026-10-01 15:15:31 +08:00

32 lines
961 B
Bash
Executable File

#!/usr/bin/env bash
# Dump every GPIOB register, to see how the port is actually configured.
#
# Layout from py32f071xB.h: MODER 0x00, OTYPER 0x04, OSPEEDR 0x08, PUPDR 0x0C,
# IDR 0x10, ODR 0x14.
set -uo pipefail
# shellcheck source=tools/uvk5_elf.sh
. "$(dirname "$0")/uvk5_elf.sh"
ELF=$(uvk5_find_elf) || { echo "SKIP no firmware found; set ELF or put one in assets/firmware" >&2; exit 0; }
BASE=0x50000400
SCRIPT=$(mktemp --suffix=.gdb)
trap 'rm -f "$SCRIPT"' EXIT
{
echo "set confirm off"
echo "set pagination off"
echo "target remote :1234"
echo "printf \"MODER \""
echo "x/1xw $((BASE + 0x00))"
echo "printf \"PUPDR \""
echo "x/1xw $((BASE + 0x0c))"
echo "printf \"IDR \""
echo "x/1xw $((BASE + 0x10))"
echo "printf \"ODR \""
echo "x/1xw $((BASE + 0x14))"
echo "detach"
echo "quit"
} >"$SCRIPT"
gdb-multiarch -batch -x "$SCRIPT" "$ELF" 2>/dev/null | grep -E "MODER|PUPDR|IDR|ODR|0x5000"