minor documentation cleanups

This commit is contained in:
Brian S. Stephan 2023-06-20 12:59:47 -05:00
parent 24617bf920
commit 8891dcc2f4
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
2 changed files with 5 additions and 18 deletions

View File

@ -7,6 +7,8 @@ Tools for working with GP2040-CE binary dumps.
```
% git clone [URL to this repository]
% cd gp2040ce-binary-tools
% python -m venv venv
% source ./venv/bin/activate
% pip install -e .
```

View File

@ -1,20 +1,4 @@
"""Interact with the protobuf config from a picotool flash dump of a GP2040-CE board.
This is more manual than I'd like at the moment, but this demonstrates/documents the means
to display the config on a board. It requires a checkout that matches the version of the
firmware on the board (so that the protobuf messages match the flash, though protobuf
tolerates differences well, so it'll probably work, just be misnamed or incomplete).
Generating the Python proto code:
[env setup]
% protoc ../../proto/* -I../../proto/ -I../../lib/nanopb/generator/proto --python_out=build
Usage:
[env setup]
% picotool save -r 101FE000 101FFFF4 build/memory.bin # 101FE000 = storage start, 101FFFF4 storage end - footer
% export PYTHONPATH=../../lib/nanopb/generator/proto:build
% python visualize.py
"""
"""Interact with the protobuf config from a picotool flash dump of a GP2040-CE board."""
import argparse
import pprint
@ -44,7 +28,8 @@ def visualize():
description="Read a the configuration storage section from a GP2040-CE board dump and print out its contents.",
parents=[core_parser],
)
parser.add_argument('filename', help=".bin file of a GP2040-CE board's storage section, bytes 101FE000-101FFFF4")
parser.add_argument('filename', help=".bin file of a GP2040-CE board's storage section, bytes 101FE000-101FFFF4 "
"(e.g. picotool save -r 101FE000 101FFFF4 memory.bin")
args, _ = parser.parse_known_args()
config = get_config(args.filename)