Commit Graph

155 Commits

Author SHA1 Message Date
Brian S. Stephan 98a13cca90
put ancillary docs under the main license
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-21 18:55:39 -05:00
Brian S. Stephan 99504bfde6
support loading JSON files as configs to edit
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-20 21:31:14 -05:00
Brian S. Stephan 56eb65dd55
tweak the version flag output to show more package/system info
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-19 08:11:20 -05:00
Brian S. Stephan 2adb1540a1
include .json in the TUI Save As... prompt
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 23:22:18 -05:00
Brian S. Stephan b4ba27dda0
add customary EOF \n to written JSON
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 20:18:12 -05:00
Brian S. Stephan 58f2f38546
preliminary support for writing configs direct to JSON
I'm hoping this will allow for editing the JSON configs directly with
edit-config

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 20:14:08 -05:00
Brian S. Stephan 8ad9b10018
CHANGELOG updates for v0.8.3
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 10:18:51 -05:00
Brian S. Stephan 2648aebd4f
add --backup flag to concatenate
makes it so that we retain the old file, e.g. GP2040CE.uf2.old if we're
about to write GP2040CE.uf2

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 10:13:28 -05:00
Brian S. Stephan 6a802bb232
support reading segmented UF2 files
now that we create segmented UF2 files properly in concatenate, we need
the ability to read them, which we'd previously saved for later; that
time is now. the reader now supports jumps forward (but not backwards,
and I don't know how likely it is we'll ever see this)

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 09:25:26 -05:00
Brian S. Stephan 7d34a441f8
use the proper block count when publishing multipart UF2s
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-15 00:05:54 -05:00
Brian S. Stephan 3524e5aa54
changelog for v0.8.1
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-14 23:35:48 -05:00
Brian S. Stephan e133abc922
concatenate smaller UF2s by using indexed offsets
previous commit added the ability to pass a list of location+binary
combinations to create UF2s, meaning we no longer need to pad the
concatenated UF2 the same way we pad the raw binary output. this makes
for a more sanely-sized UF2 and faster write

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-14 23:26:50 -05:00
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 90a5f879df
specify to package the protobuf snapshot
the REUSE stuff made simple discovery not work, so setuptools had to be
corrected, this has probably been wrong since then
2024-04-13 23:29:05 -05:00
Brian S. Stephan 0a214cff42
changelog updates for 0.8.0
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-13 23:20:36 -05:00
Brian S. Stephan 5022616f1d
summarize-gp2040ce --- print information about firmware
can be read from a file or over USB

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:13:38 -05:00
Brian S. Stephan 300fdec86a
import the storage module directly
getting tired of updating the import and having to isort it, honestly

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -05:00
Brian S. Stephan a0734c9b48
add method to search for version strings in binaries
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -05:00
Brian S. Stephan 1f65f23a4f
clean up the huge import list in these tests
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:20 -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 2a40c70b56
cover a bit more TUI in tests, and remove dead branches
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 5b8396c097
update concatenate examples following rename of output flag
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 20:01:14 -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 2ce0c4d7df
don't "optimize" the UF2 until the combination is fixed
naively adding UF2 blocks together is at least wrong by spec; it
produces one file with wrong block counts --- say I'm writing 3770
blocks, the naive uf2(firmware) + uf2(config) solution yields a file
that says it's 3642 blocks for a while, then 128 blocks. picotool kind
of does a "wtf" at this but writes it anyway, but I am not confident
this is safe, so I'll just do the dumb thing again for now (meaning we
pretty much always write 8128 or 8192 blocks when concatenating configs)

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 15:27:58 -05:00
Brian S. Stephan 8e6a203398
improve concatenate to create smaller UF2s
the prior version, for the board/user configs, took the whole ~2MB
binary file and converted it to a UF2, which made for a lot of chunks
that were just writing 0s, between the end of the firmware and the start
of the config(s). this changes the logic to build each portion as
separate UF2 chunks and then combine them.

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 13:09:02 -05:00
Brian S. Stephan 65ae51af72
rename visualize-storage as visualize-config
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 10:39:29 -05:00
Brian S. Stephan 79ea02a968
confirm the v0.7.8-RC2 protobuf configs are also v0.7.8
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 10:33:48 -05:00
Brian S. Stephan e8c854b9ea
backfill the CHANGELOG
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 10:29:28 -05:00
Brian S. Stephan ffbc3cc0d7
check REUSE as part of tox
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 10:26:28 -05:00
Brian S. Stephan ba620c87ca
fix pyproject.toml package find the proper way
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 10:23:18 -05:00
Brian S. Stephan fc493c131f
replace LICENSE with LICENSE.md
now that we have the REUSE spec in place, we can use the root level
LICENSE to convey how this is distributed, and use the .md version for
readability

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 07:43:41 -05:00
Brian S. Stephan e0f5f8fb5a
rename output file argument to concatenate
to reduce confusion, now that this supports UF2 output, it's not
necessarily a new *binary* file

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 07:38:22 -05:00
Brian S. Stephan 0789dd8c9d
follow `reuse lint`
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 01:46:25 -05:00
Brian S. Stephan 9d964668dd
move the DCO into CONTRIBUTING.md
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 01:06:50 -05:00
Brian S. Stephan 624a7e72e3
use the SPDX descriptor for the license
seems to display better on PyPI

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-12 00:05:25 -05:00
Brian S. Stephan a1a3ebbbac
requirements bumps
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-08 09:07:50 -05:00
Brian S. Stephan 3e8209e2a5
update .proto snapshot for v0.7.8
this also clarifies the docs a bit regarding versions supported.

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-04-08 09:07:47 -05:00
Brian S. Stephan 3a55cad86f
implement Save As... in the TUI
this allows for loading an existing GP2040-CE dump or board in BOOTSEL
over USB and saving the parsed configuration to a new .bin/.uf2 file.
might be useful for making quick backups or variants of configs

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-26 13:47:30 -05:00
Brian S. Stephan f6d3ad02e0
support writing new configs as .uf2 files via the TUI
`edit-config --filename foo.uf2` can now create standalone config UF2
files. still working on reading UF2s, or maybe what edit-config needs is
a "Save As..." in order to read from a board/config and output it to a
new file, but this is a start

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-25 12:01:52 -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 610e1a2801
show a quick bit of copyright/license info
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-12 13:33:37 -05:00
Brian S. Stephan af46a0200b
version bumps
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-12 13:06:54 -05:00
Brian S. Stephan c1ab61c61e
improve the positioning of the edit dialog buttons
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-12 12:45:58 -05:00
Brian S. Stephan 1d887c9fdf
add MessageScreen back and tweak/enhance screen layouts
this will be used for a help screen, which isn't done yet, but this
makes the edit screen incrementally better too

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-11 12:59:58 -05:00
Brian S. Stephan 5fc2339c74
isort gp2040ce_bintools/gui.py
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-03-10 23:43:12 -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