From 7db10a048fa448468d11dd9eba20a013f2e2409e Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 14 Dec 2022 20:56:54 -0500 Subject: [PATCH] armcm_canboot: Rename CONFIG_APPLICATION_START to CONFIG_LAUNCH_APP_ADDRESS Rename the build symbol to better distinguish it from the start address of the deployer app. Signed-off-by: Kevin O'Connor --- Makefile | 2 +- scripts/buildbinary.py | 4 ++-- src/flashcmd.c | 4 ++-- src/generic/armcm_canboot.c | 4 ++-- src/generic/armcm_deployer.lds.S | 4 ++-- src/lpc176x/Kconfig | 2 +- src/rp2040/Kconfig | 2 +- src/rp2040/Makefile | 2 +- src/rp2040/armcm_canboot.c | 4 ++-- src/stm32/Kconfig | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index edb1066..3fe8592 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ $(OUT)canboot.elf: $(OBJS_canboot.elf) $(OUT)canboot.bin: $(OUT)canboot.elf ./scripts/buildbinary.py @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 $@ + $(Q)$(PYTHON) ./scripts/buildbinary.py -b $(CONFIG_FLASH_START) -s $(CONFIG_LAUNCH_APP_ADDRESS) $(BUILDBINARY_FLAGS) $(OUT)canboot.work -c $(OUT)canboot_payload.c $@ $(OUT)canboot_payload.o: $(OUT)canboot.bin @echo " Compiling $@" diff --git a/scripts/buildbinary.py b/scripts/buildbinary.py index af18f58..86b8280 100644 --- a/scripts/buildbinary.py +++ b/scripts/buildbinary.py @@ -7,9 +7,9 @@ import sys, argparse, struct ERR_MSG = """ -The CanBoot binary is too large for the configured APPLICATION_START. +The CanBoot binary is too large for the configured LAUNCH_APP_ADDRESS. -Rerun "make menuconfig" and either increase the APPLICATION_START or +Rerun "make menuconfig" and either increase the LAUNCH_APP_ADDRESS or disable features to reduce the final binary size. """ diff --git a/src/flashcmd.c b/src/flashcmd.c index 4db7fe5..9ca9615 100644 --- a/src/flashcmd.c +++ b/src/flashcmd.c @@ -21,7 +21,7 @@ command_connect(uint32_t *data) uint32_t out[6 + mcuwords]; memset(out, 0, (6 + mcuwords) * 4); out[2] = cpu_to_le32(PROTO_VERSION); - out[3] = cpu_to_le32(CONFIG_APPLICATION_START); + out[3] = cpu_to_le32(CONFIG_LAUNCH_APP_ADDRESS); out[4] = cpu_to_le32(CONFIG_BLOCK_SIZE); memcpy(&out[5], CONFIG_MCU, strlen(CONFIG_MCU)); command_respond_ack(CMD_CONNECT, out, ARRAY_SIZE(out)); @@ -83,7 +83,7 @@ command_write_block(uint32_t *data) if (command_get_arg_count(data) != (CONFIG_BLOCK_SIZE / 4) + 1) goto fail; uint32_t block_address = le32_to_cpu(data[1]); - if (block_address < CONFIG_APPLICATION_START) + if (block_address < CONFIG_LAUNCH_APP_ADDRESS) goto fail; int ret = flash_write_block(block_address, &data[2]); if (ret < 0) diff --git a/src/generic/armcm_canboot.c b/src/generic/armcm_canboot.c index 331c1b4..6a8256c 100644 --- a/src/generic/armcm_canboot.c +++ b/src/generic/armcm_canboot.c @@ -51,7 +51,7 @@ application_read_flash(uint32_t address, uint32_t *dest) int application_check_valid(void) { - uint32_t *app = (void*)CONFIG_APPLICATION_START; + uint32_t *app = (void*)CONFIG_LAUNCH_APP_ADDRESS; return *app != 0 && *app != 0xffffffff; } @@ -68,7 +68,7 @@ static void start_application(void) { set_bootup_code(0); - uint32_t *vtor = (void*)CONFIG_APPLICATION_START; + uint32_t *vtor = (void*)CONFIG_LAUNCH_APP_ADDRESS; #if __CORTEX_M > 0 || __VTOR_PRESENT SCB->VTOR = (uint32_t)vtor; #endif diff --git a/src/generic/armcm_deployer.lds.S b/src/generic/armcm_deployer.lds.S index bda416f..0361e37 100644 --- a/src/generic/armcm_deployer.lds.S +++ b/src/generic/armcm_deployer.lds.S @@ -22,8 +22,8 @@ SECTIONS _text_vectortable_start = .; KEEP(*(.vector_table)) _text_vectortable_end = .; -#if CONFIG_APPLICATION_START > CONFIG_DEPLOYER_START - . = CONFIG_APPLICATION_START - CONFIG_DEPLOYER_START ; +#if CONFIG_LAUNCH_APP_ADDRESS > CONFIG_DEPLOYER_START + . = CONFIG_LAUNCH_APP_ADDRESS - CONFIG_DEPLOYER_START ; #endif *(.text .text.*) *(.rodata .rodata*) diff --git a/src/lpc176x/Kconfig b/src/lpc176x/Kconfig index 26a9323..627d30c 100644 --- a/src/lpc176x/Kconfig +++ b/src/lpc176x/Kconfig @@ -100,7 +100,7 @@ endchoice # Flash settings ###################################################################### -config APPLICATION_START +config LAUNCH_APP_ADDRESS hex default 0x4000 diff --git a/src/rp2040/Kconfig b/src/rp2040/Kconfig index 13c89bf..08e6790 100644 --- a/src/rp2040/Kconfig +++ b/src/rp2040/Kconfig @@ -40,7 +40,7 @@ config FLASH_START hex default 0x10000000 -config APPLICATION_START +config LAUNCH_APP_ADDRESS default 0x10004000 hex diff --git a/src/rp2040/Makefile b/src/rp2040/Makefile index f2984c1..391fdcf 100644 --- a/src/rp2040/Makefile +++ b/src/rp2040/Makefile @@ -46,7 +46,7 @@ $(OUT)canboot.uf2: $(OUT)canboot.elf $(OUT)lib/rp2040/elf2uf2/elf2uf2 @echo " Creating uf2 file $@" $(Q)$(OUT)lib/rp2040/elf2uf2/elf2uf2 $(OUT)canboot.elf $(OUT)canboot.uf2 ifeq ($(CONFIG_RP2040_ADD_BOOT_SIGNATURE), y) - $(Q)$(PYTHON) ./scripts/uf2_append_boot_signature.py --address $(CONFIG_APPLICATION_START) --input $(OUT)canboot.uf2 --output $(OUT)canboot.uf2 + $(Q)$(PYTHON) ./scripts/uf2_append_boot_signature.py --address $(CONFIG_LAUNCH_APP_ADDRESS) --input $(OUT)canboot.uf2 --output $(OUT)canboot.uf2 endif lib/rp2040_flash/rp2040_flash: diff --git a/src/rp2040/armcm_canboot.c b/src/rp2040/armcm_canboot.c index f573488..8f271a4 100644 --- a/src/rp2040/armcm_canboot.c +++ b/src/rp2040/armcm_canboot.c @@ -51,7 +51,7 @@ application_read_flash(uint32_t address, uint32_t *dest) int application_check_valid(void) { - uint32_t *app = (void*)CONFIG_APPLICATION_START; + uint32_t *app = (void*)CONFIG_LAUNCH_APP_ADDRESS; return *app != 0 && *app != 0xffffffff; } @@ -68,7 +68,7 @@ static void start_application(void) { set_bootup_code(0); - uint32_t *vtor = (void*)CONFIG_APPLICATION_START; + uint32_t *vtor = (void*)CONFIG_LAUNCH_APP_ADDRESS; SCB->VTOR = (uint32_t)vtor; asm volatile("MSR msp, %0\n bx %1" : : "r"(vtor[0]), "r"(vtor[1])); } diff --git a/src/stm32/Kconfig b/src/stm32/Kconfig index 02a9c24..d38ed90 100644 --- a/src/stm32/Kconfig +++ b/src/stm32/Kconfig @@ -376,7 +376,7 @@ choice bool "4KiB offset" if MACH_STM32F0 || MACH_STM32F1 || MACH_STM32G0 endchoice -config APPLICATION_START +config LAUNCH_APP_ADDRESS hex default 0x8008000 if STM32_APP_START_8000 default 0x8004000 if STM32_APP_START_4000