Commit Graph

26 Commits

Author SHA1 Message Date
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 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 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 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 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 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 b3f6f86950
ship precompiled protobuf files for convenience
current libraries seem to have problems on Windows with thinking files
are duplicated when they are not, making it impossible to compile .proto
files at runtime in this tool on that platform. this adds a fallback of
using shipped, precompiled files in the package. I was already intending
on providing this as an option anyway, so might as well start doing it
now.

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-01-09 09:40:07 -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 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 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 fcb1297139
test with 0.7.5 files, which has an expanded config section 2023-11-06 23:55:01 -06:00
Brian S. Stephan 2c446f595a
a bit more coverage around USB interactions (aka lots of mocks) 2023-07-09 10:41:40 -05:00
Brian S. Stephan 91db1b169c
update test .protos with main + repeated example 2023-07-01 14:45:32 -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 9b43ac824d
add more methods for writing a config to file
these allow for adding a config to the proper section of an existing
binary file, or writing a config to a new config-only binary file
2023-06-29 14:43:46 -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 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 c9b443f993
test/check to make sure I don't check in PS4 stuff 2023-06-26 14:53:37 -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 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 a088cdcd73
unit tests for config parsing out of storage
closes #1
2023-06-20 20:01:22 -05:00