DFU file support (#45)

* DFU file work

Just grabbing first one for now

Expose crc

Update CMakeLists.txt

Test DFU file

Split crc function

Fixup

Zero init struct
Dont null the pointer 🤦
correct fread

Adding tests

Create dfu_file.h

Format

Scratching out more parsing

Basic port parser

Scratching fread wrapper

* Relocate dfu parsing and link in

* Scratching out parsers

* Generic bin parser

* Pull out get file util

Update CMakeLists.txt

* Pull in the generic parser

Fixup

.

* Print flash address

* Rebase address

* stdlib

Update dfu_file.c

* FIXUP! flash offset

* Update dfu_file.c

* Improve logging

* Drop extra erase

* Adjust DFU to avoid goto

* Pragma -> ifndef

* Include Windows headers for missing data types

---------

Co-authored-by: Marek Kraus <gamelaster@outlook.com>
This commit is contained in:
Ben V. Brown
2023-08-01 22:43:56 +10:00
committed by GitHub
co-authored by Marek Kraus
parent 048a724082
commit f1b93a1881
19 changed files with 702 additions and 43 deletions
+7 -4
View File
@@ -354,13 +354,16 @@ int32_t blisp_easy_flash_write(struct blisp_device* device,
if (buffer_size > buffer_max_size) {
buffer_size = buffer_max_size;
}
blisp_easy_transport_read(data_transport, buffer,
buffer_size); // TODO: Error Handling
ret = blisp_easy_transport_read(data_transport, buffer, buffer_size);
if (ret < BLISP_OK) {
fprintf(stderr, "Failed to read firmware chunk! (ret:%d)\n ", ret);
return ret;
}
ret = blisp_device_flash_write(device, flash_location + sent_data, buffer,
buffer_size);
if (ret < BLISP_OK) {
// TODO: Error logigng: fprintf(stderr, "Failed to write firmware! (ret:
// %d)\n", ret);
fprintf(stderr, "Failed to write firmware! (ret:%d)\n ", ret);
return ret;
}
sent_data += buffer_size;