From 2990480d25ddd4e3c62ca3f376ab85fc2e5e0e98 Mon Sep 17 00:00:00 2001 From: sh83 Date: Sun, 30 Oct 2022 21:51:44 +0300 Subject: [PATCH] common: misc fixes: - moved external files to lib folder - fixed typos - added optional "sudo" to flash command - fixed redundant file close in script - fixed compilation warning --- Makefile | 2 +- {src/rp2040 => lib/rp2040/pico/bootrom}/bootrom.h | 0 {src/rp2040 => lib/rp2040/pico/flash}/hw_flash.c | 0 {src/rp2040 => lib/rp2040/pico/flash}/hw_flash.h | 0 lib/rp2040_flash/main.c | 2 +- scripts/uf2_append_boot_signature.py | 2 -- src/rp2040/Makefile | 8 ++++---- 7 files changed, 6 insertions(+), 8 deletions(-) rename {src/rp2040 => lib/rp2040/pico/bootrom}/bootrom.h (100%) rename {src/rp2040 => lib/rp2040/pico/flash}/hw_flash.c (100%) rename {src/rp2040 => lib/rp2040/pico/flash}/hw_flash.h (100%) diff --git a/Makefile b/Makefile index 7dc67a3..edb1066 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ $(OUT)canboot.elf: $(OBJS_canboot.elf) $(Q)scripts/check-gcc.sh $@ $(OUT)compile_time_request.o $(OUT)canboot.bin: $(OUT)canboot.elf ./scripts/buildbinary.py - @echo " Creating hex file $@" + @echo " Creating bin file $@" $(Q)$(OBJCOPY) -O binary $< $(OUT)canboot.work $(Q)$(PYTHON) ./scripts/buildbinary.py -b $(CONFIG_FLASH_START) -s $(CONFIG_APPLICATION_START) $(BUILDBINARY_FLAGS) $(OUT)canboot.work -c $(OUT)canboot_payload.c $@ diff --git a/src/rp2040/bootrom.h b/lib/rp2040/pico/bootrom/bootrom.h similarity index 100% rename from src/rp2040/bootrom.h rename to lib/rp2040/pico/bootrom/bootrom.h diff --git a/src/rp2040/hw_flash.c b/lib/rp2040/pico/flash/hw_flash.c similarity index 100% rename from src/rp2040/hw_flash.c rename to lib/rp2040/pico/flash/hw_flash.c diff --git a/src/rp2040/hw_flash.h b/lib/rp2040/pico/flash/hw_flash.h similarity index 100% rename from src/rp2040/hw_flash.h rename to lib/rp2040/pico/flash/hw_flash.h diff --git a/lib/rp2040_flash/main.c b/lib/rp2040_flash/main.c index 1c11195..e938eb3 100644 --- a/lib/rp2040_flash/main.c +++ b/lib/rp2040_flash/main.c @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) { rc = 1; goto do_exit; } - fprintf(stderr, "Loaded UF2 image with %lu pages\n", image->num_blocks); + fprintf(stderr, "Loaded UF2 image with %zu pages\n", image->num_blocks); bool has_target = false; uint8_t target_bus = 0; diff --git a/scripts/uf2_append_boot_signature.py b/scripts/uf2_append_boot_signature.py index 4c2c797..320e89c 100755 --- a/scripts/uf2_append_boot_signature.py +++ b/scripts/uf2_append_boot_signature.py @@ -12,7 +12,6 @@ def renumerate(content): result.extend(block[ : 20]) result.extend(struct.pack("