mirror of
https://github.com/pine64/blisp.git
synced 2025-03-13 10:28:57 +00:00
Print flash address
This commit is contained in:
parent
342a43b071
commit
6724a9c682
@ -192,7 +192,7 @@ blisp_return_t blisp_flash_firmware() {
|
|||||||
// Create a default boot header section in ram to be written out
|
// Create a default boot header section in ram to be written out
|
||||||
struct bfl_boot_header boot_header;
|
struct bfl_boot_header boot_header;
|
||||||
fill_up_boot_header(&boot_header);
|
fill_up_boot_header(&boot_header);
|
||||||
printf("Erasing flash to flash boot header\r\n");
|
printf("Erasing flash to flash boot header\n");
|
||||||
ret = blisp_device_flash_erase(&device, 0x0000,
|
ret = blisp_device_flash_erase(&device, 0x0000,
|
||||||
sizeof(struct bfl_boot_header));
|
sizeof(struct bfl_boot_header));
|
||||||
if (ret != BLISP_OK) {
|
if (ret != BLISP_OK) {
|
||||||
@ -226,7 +226,7 @@ blisp_return_t blisp_flash_firmware() {
|
|||||||
goto exit2;
|
goto exit2;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Flashing the firmware...\n");
|
printf("Flashing the firmware @ 0x%08X...\n", parsed_file.payload_address);
|
||||||
struct blisp_easy_transport data_transport =
|
struct blisp_easy_transport data_transport =
|
||||||
blisp_easy_transport_new_from_memory(parsed_file.payload,
|
blisp_easy_transport_new_from_memory(parsed_file.payload,
|
||||||
parsed_file.payload_length);
|
parsed_file.payload_length);
|
||||||
|
@ -16,8 +16,7 @@ ssize_t get_file_contents(const char* file_path_on_disk,
|
|||||||
|
|
||||||
f = fopen(file_path_on_disk, "rb");
|
f = fopen(file_path_on_disk, "rb");
|
||||||
if (f <= 0) {
|
if (f <= 0) {
|
||||||
fprintf(stderr, "Could not open file %s for reading\r\n",
|
fprintf(stderr, "Could not open file %s for reading\n", file_path_on_disk);
|
||||||
file_path_on_disk);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@ int parse_firmware_file(const char* file_path_on_disk,
|
|||||||
const char* ext = get_filename_ext(file_path_on_disk);
|
const char* ext = get_filename_ext(file_path_on_disk);
|
||||||
int res = PARSED_ERROR_INVALID_FILETYPE;
|
int res = PARSED_ERROR_INVALID_FILETYPE;
|
||||||
if (strncmp(ext, "dfu", 3) == 0 || strncmp(ext, "DFU", 3) == 0) {
|
if (strncmp(ext, "dfu", 3) == 0 || strncmp(ext, "DFU", 3) == 0) {
|
||||||
printf("Input file identified as a .dfu file\r\n");
|
printf("Input file identified as a .dfu file\n");
|
||||||
// Handle as a .dfu file
|
// Handle as a .dfu file
|
||||||
res = dfu_file_parse(file_path_on_disk, &parsed_results->payload,
|
res = dfu_file_parse(file_path_on_disk, &parsed_results->payload,
|
||||||
&parsed_results->payload_length,
|
&parsed_results->payload_length,
|
||||||
&parsed_results->payload_address);
|
&parsed_results->payload_address);
|
||||||
} else if (strncmp(ext, "bin", 3) == 0 || strncmp(ext, "BIN", 3) == 0) {
|
} else if (strncmp(ext, "bin", 3) == 0 || strncmp(ext, "BIN", 3) == 0) {
|
||||||
printf("Input file identified as a .bin file\r\n");
|
printf("Input file identified as a .bin file\n");
|
||||||
// Raw binary file
|
// Raw binary file
|
||||||
res = bin_file_parse(file_path_on_disk, &parsed_results->payload,
|
res = bin_file_parse(file_path_on_disk, &parsed_results->payload,
|
||||||
&parsed_results->payload_length,
|
&parsed_results->payload_length,
|
||||||
|
Loading…
Reference in New Issue
Block a user