diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-10-25 21:54:31 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-11-14 11:17:52 -0500 |
commit | 64ba37c02e3bfa290321713aa4e5a082993ff65e (patch) | |
tree | 6d6cd17ed24fdc4703c64a7f2bcfbf288244f1d2 /lib/rp2040_flash/main.c | |
parent | 06bb49f135ccedcebf7aa01896cba13f0d5d1145 (diff) | |
download | kutter-64ba37c02e3bfa290321713aa4e5a082993ff65e.tar.gz kutter-64ba37c02e3bfa290321713aa4e5a082993ff65e.tar.xz kutter-64ba37c02e3bfa290321713aa4e5a082993ff65e.zip |
lib: Update rp2040_flash to upstream picotool.git v2.0.0
This is in preparation for adding rp2350 flash support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'lib/rp2040_flash/main.c')
-rw-r--r-- | lib/rp2040_flash/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rp2040_flash/main.c b/lib/rp2040_flash/main.c index e938eb35..69ea168d 100644 --- a/lib/rp2040_flash/main.c +++ b/lib/rp2040_flash/main.c @@ -12,7 +12,7 @@ #include "picoboot_connection.h" #include "boot/uf2.h" -#define FLASH_MAX_SIZE (FLASH_END - FLASH_START) +#define FLASH_MAX_SIZE (FLASH_END_RP2350 - FLASH_START) #define FLASH_NUM_WRITE_BLOCKS (FLASH_MAX_SIZE / PAGE_SIZE) #define FLASH_NUM_ERASE_BLOCKS (FLASH_MAX_SIZE / FLASH_SECTOR_ERASE_SIZE) @@ -62,7 +62,7 @@ int load_flash_data(const char *filename, struct flash_data *target) { // Bounds and alignment checking if (block.target_addr != (block.target_addr & ~(PAGE_SIZE-1))) continue; - if (block.target_addr > FLASH_END - PAGE_SIZE) continue; + if (block.target_addr > FLASH_END_RP2350 - PAGE_SIZE) continue; if (block.target_addr < FLASH_START) continue; uint32_t offset = block.target_addr - FLASH_START; @@ -209,7 +209,8 @@ int main(int argc, char *argv[]) { if (target_bus != libusb_get_bus_number(*dev)) continue; if (target_address != libusb_get_device_address(*dev)) continue; } - enum picoboot_device_result res = picoboot_open_device(*dev, &handle); + model_t model; + enum picoboot_device_result res = picoboot_open_device(*dev, &handle, &model, -1, -1, ""); if (res == dr_vidpid_bootrom_ok) { break; } |