mirror of
https://github.com/pine64/blisp.git
synced 2026-09-18 15:51:32 +00:00
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:
co-authored by
Marek Kraus
parent
048a724082
commit
f1b93a1881
+7
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user