From 8891dcc2f4ba9493247aee900a2c1b1a4e0f5d7d Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Tue, 20 Jun 2023 12:59:47 -0500 Subject: [PATCH] minor documentation cleanups --- README.md | 2 ++ gp2040ce_bintools/storage.py | 21 +++------------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4783f79..dfe70be 100644 --- a/README.md +++ b/README.md @@ -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 . ``` diff --git a/gp2040ce_bintools/storage.py b/gp2040ce_bintools/storage.py index f2ba9bd..b2ee81d 100644 --- a/gp2040ce_bintools/storage.py +++ b/gp2040ce_bintools/storage.py @@ -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)