Commit Graph

41 Commits

Author SHA1 Message Date
Brian S. Stephan 2bb049c442
take multiple binary arguments to convert_binary_to_uf2
this is in preparation for making smaller .uf2 files buy not needing
padding, instead passing multiple location+binary combos to the
converter

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-14 22:54:05 -05:00
Brian S. Stephan ea4d4be709
fix bad loading of .uf2 files in summarize-gp2040ce
the UF2 file wasn't converted to binary format before searching for the
board/user config sections, so it was reading the middle of the UF2 file
instead of the end of the binary file and returning that there were no
configs

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-14 11:21:55 -05:00
Brian S. Stephan eb95c80815
unsatisfyingly fix a mypy bytes vs. bytearray issue
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -05:00
Brian S. Stephan e35d8dbf3d
add some more UF2 tests and sanity checks
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -05:00
Brian S. Stephan 4a7203d969
dump the board config via --board-config
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -05:00
Brian S. Stephan 6bc93f148b
allow for reading UF2 files in visualize-config
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 16:21:20 -05:00
Brian S. Stephan 449812f1df
optionally dump config to a .uf2 file
this allows for creating a UF2 that writes the user config to the whole
user config section of flash, allowing for easy copying/juggling of
configurations by just maintaining a library of .uf2 files you like to
apply

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-25 10:03:54 -05:00
Brian S. Stephan a3f9f12e74
move UF2 converter to storage, allow specifying start address
the former is to avoid an upcoming circular dependency, the latter is to
allow for creating an e.g. user-config-only .uf2 by specifying the
proper offset to start the UF2 addressing at.

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-25 09:19:58 -05:00
Brian S. Stephan b900e1dd04
relicense as GPLv3
prior MIT-licensed versions can be obtained from the Git history; this
does not revoke those versions

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-08 00:02:43 -06:00
Brian S. Stephan 314fc909ff
flag and method to visualize the board config
via file dump or via USB. used to test the writing of the board config
to binary

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-06 17:27:33 -06:00
Brian S. Stephan ef71db6f5e
methods to add/retrieve board config to binary
with this, the combining methods can combine both a board and user
config into one binary, which is a step closer to having a command that
does it, and then we can start removing BoardConfig.h from the firmware
build and replace it with patched binaries.

to test it, another retrieval method was added too, and this will
probably be used for more dump commands or a better info or something
like that

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-06 11:43:54 -06:00
Brian S. Stephan bc64a6531b
add a method to pad a binary to the spot of the board config
the board config will be the same space as the user config, directly in
front of it in the flash

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-05 23:42:45 -06:00
Brian S. Stephan 841c3a38c3
s/get_storage_section/get_user_storage_section/
more renaming to make room for future methods

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-05 21:13:14 -06:00
Brian S. Stephan 578fd416da
rename get_config_from_usb as get_user_config_from_usb
this is to distinguish from the board config later

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-05 21:13:10 -06:00
Brian S. Stephan 05228b9f62
s/STORAGE_/USER_CONFIG_/
more address define renames to make an upcoming feature clearer

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-03 18:27:16 -06:00
Brian S. Stephan 416157663d
STORAGE_BOOTSEL_ADDRESS is a better name than _MEMORY_
this is also just a different addressing mode with the same binary
offset from the start, so derive it from the binary location
2024-01-03 12:24:05 -06:00
Brian S. Stephan f2ed281053
test parsing config as JSON into a message
this also bumps the proto files in the test directory as a matter of
convenience, so some tests got updated accordingly

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-03 12:20:54 -06:00
Brian S. Stephan 23cb5c9e5a
add SPDX-FileCopyrightText
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-02 15:15:55 -06:00
Brian S. Stephan b2bf7984b0
add SPDX-License-Identifier: MIT to all source
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2023-12-18 10:17:35 -06:00
Brian S. Stephan fc022452f5
replace most references to pico with RP2040 2023-11-07 00:26:51 -06:00
Brian S. Stephan fcb1297139
test with 0.7.5 files, which has an expanded config section 2023-11-06 23:55:01 -06:00
Brian S. Stephan d2ef3efa3b
trivial reordering of command line flags 2023-07-12 18:32:05 -05:00
Brian S. Stephan 8c5bd4397f
allow edit-config to fallback to new config if old doesn't exist 2023-07-12 00:08:55 -05:00
Brian S. Stephan baa3959e8a
dump-config's filename argument is not optional 2023-07-11 16:32:46 -05:00
Brian S. Stephan 7a9d5ad1d1
dump-config tool to easily backup a board's config section
doesn't require picotool, doesn't include padding, does include the
footer
2023-07-07 20:09:00 -05:00
Brian S. Stephan e2ad75371e
DRY: convenience method to get config from USB 2023-07-07 20:03:41 -05:00
Brian S. Stephan 70d3ce8be0
--usb flag to visualize-storage direct off the board 2023-07-07 18:31:13 -05:00
Brian S. Stephan 7aee99ef4f
allow for "opening" an empty config from file 2023-06-30 23:12:53 -05:00
Brian S. Stephan cbf0f52841
add method to generate a serialized + footer config 2023-06-28 19:21:27 -05:00
Brian S. Stephan 1345e8b18d
add length info to exceptions complaining about length 2023-06-28 14:38:13 -05:00
Brian S. Stephan 39fa558741
check the config's CRC32 checksum while reading 2023-06-28 14:38:10 -05:00
Brian S. Stephan 095fac19f1
properly account for combining config section with firmware
prior to this, the concatenate assumed it was concatenating a firmware
with a full *storage section*, e.g. the already-padded 8192 bytes, but
it's equally valuable now that I'm creating configs to have just a
config section + footer, which needs to be padded 8192. now concatenate
supports both
2023-06-28 12:52:49 -05:00
Brian S. Stephan 229092dd66
custom config validation exceptions
might be useful when allowing for ignoring specific sanity checks
2023-06-22 00:08:12 -05:00
Brian S. Stephan 1b02e458e2
visualize-storage flag to print as JSON
closes #3
2023-06-21 18:21:22 -05:00
Brian S. Stephan 88ca5c5152
more tests for command invocations 2023-06-21 17:54:27 -05:00
Brian S. Stephan 5b8dc456f1
option to get the config out of a whole board dump
now you don't need to fiddle with specific byte ranges of a dump, you
can just dump the whole board if that's more convenient, and
visualize-storage will parse that

also more testing in general
2023-06-21 15:20:21 -05:00
Brian S. Stephan d31c451d0c
tox for local CI, with coverage and bandit checks added 2023-06-21 12:31:58 -05:00
Brian S. Stephan 0c7ed1fcea
improve storage parsing by using footer for sanity
magic is checked for sanity, and then the size is used for reading the
whole section rather than simply ignoring null bytes

closes #2
2023-06-20 19:57:28 -05:00
Brian S. Stephan 35abad327e
dynamically generate version number based on git 2023-06-20 15:43:21 -05:00
Brian S. Stephan 8891dcc2f4
minor documentation cleanups 2023-06-20 12:59:47 -05:00
Brian S. Stephan 24617bf920
visualize-storage tool --- read GP2040-CE config
this also comes with a lot of project scaffolding for (IMO) a
well-organized python project. this should get the ball rolling for
other devs
2023-06-20 12:52:22 -05:00