Skip to main content

Crate tag_peek

Crate tag_peek 

Source
Expand description

tag-peek: read words of live tag memory or peripheral space.

Port of host/commandline/tag-peek.cc. A diagnostic tool: reads one or more words in a single attach, between monitor RPCs, without halting the core (unlike STM32_Programmer_CLI -r32, which needs connect-under-reset). Uses Tag::read_memory, so addresses must be word aligned. Not for shipping.

“Live” means the running monitor firmware answers the read: the core is not halted. It still follows the attach, which resets the tag, so what is read is the state after that reset and the monitor’s start-up, not the state of a run in progress.

Usage: tag-peek [-d] [-b BUS:DEVICE] [--addr ADDR...] [ADDR...]. Each address prints as 0xAAAAAAAA: 0xVVVVVVVV, the word read little-endian.

§Exit status

0 if every address was read; 1 if no address was given, no base matches, the attach fails, or any address does not parse or fails to read (the others are still read). Option errors exit 2 (clap).

Structs§

Cli 🔒
read one or more words of live tag memory/peripheral space in a single attach (one attach/detach disturbs the tag less than several separate invocations)

Functions§

main 🔒
Attaches once and reads every address given, in order (--addr values first, then positional ones).
parse_address 🔒
Parses an address as strtoull(text, &end, 0) would, but only when the whole argument is a number that fits in 32 bits: 0x hex, leading-0 octal or decimal, no sign. None for anything else, rather than the address 0 that strtoul returns for text it cannot parse.