mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
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
This commit is contained in:
parent
0a24cd4502
commit
2990480d25
2
Makefile
2
Makefile
@ -80,7 +80,7 @@ $(OUT)canboot.elf: $(OBJS_canboot.elf)
|
|||||||
$(Q)scripts/check-gcc.sh $@ $(OUT)compile_time_request.o
|
$(Q)scripts/check-gcc.sh $@ $(OUT)compile_time_request.o
|
||||||
|
|
||||||
$(OUT)canboot.bin: $(OUT)canboot.elf ./scripts/buildbinary.py
|
$(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)$(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_APPLICATION_START) $(BUILDBINARY_FLAGS) $(OUT)canboot.work -c $(OUT)canboot_payload.c $@
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ int main(int argc, char *argv[]) {
|
|||||||
rc = 1;
|
rc = 1;
|
||||||
goto do_exit;
|
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;
|
bool has_target = false;
|
||||||
uint8_t target_bus = 0;
|
uint8_t target_bus = 0;
|
||||||
|
@ -12,7 +12,6 @@ def renumerate(content):
|
|||||||
result.extend(block[ : 20])
|
result.extend(block[ : 20])
|
||||||
result.extend(struct.pack("<II", current, total))
|
result.extend(struct.pack("<II", current, total))
|
||||||
result.extend(block[ 28 : ])
|
result.extend(block[ 28 : ])
|
||||||
# print("address " + hex(int.from_bytes(block[12:16], "little")))
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def add_signature(content, address):
|
def add_signature(content, address):
|
||||||
@ -42,7 +41,6 @@ def main():
|
|||||||
content = renumerate(content)
|
content = renumerate(content)
|
||||||
with open(args.output, 'wb') as f:
|
with open(args.output, 'wb') as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
f.close()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
# Setup the toolchain
|
# Setup the toolchain
|
||||||
CROSS_PREFIX=arm-none-eabi-
|
CROSS_PREFIX=arm-none-eabi-
|
||||||
|
|
||||||
dirs-y += src/rp2040 src/generic lib/rp2040/elf2uf2 lib/fast-hash lib/can2040
|
dirs-y += src/rp2040 src/generic lib/rp2040/elf2uf2 lib/fast-hash lib/can2040 lib/rp2040/pico/flash/
|
||||||
|
|
||||||
CFLAGS += -mcpu=cortex-m0plus -mthumb -Ilib/cmsis-core
|
CFLAGS += -mcpu=cortex-m0plus -mthumb -Ilib/cmsis-core
|
||||||
CFLAGS += -Ilib/rp2040 -Ilib/rp2040/cmsis_include -Ilib/fast-hash -Ilib/can2040
|
CFLAGS += -Ilib/rp2040 -Ilib/rp2040/cmsis_include -Ilib/fast-hash -Ilib/can2040 -Ilib/rp2040/pico/flash/ -Ilib/rp2040/pico/bootrom/
|
||||||
|
|
||||||
CFLAGS_canboot.elf += --specs=nano.specs --specs=nosys.specs
|
CFLAGS_canboot.elf += --specs=nano.specs --specs=nosys.specs
|
||||||
CFLAGS_canboot.elf += -T $(OUT)src/rp2040/rp2040_link.ld
|
CFLAGS_canboot.elf += -T $(OUT)src/rp2040/rp2040_link.ld
|
||||||
|
|
||||||
# Add source files
|
# Add source files
|
||||||
mcu-y = rp2040/main.c rp2040/gpio.c rp2040/timer.c rp2040/flash.c rp2040/hw_flash.c
|
mcu-y = rp2040/main.c rp2040/gpio.c rp2040/timer.c rp2040/flash.c ../lib/rp2040/pico/flash/hw_flash.c
|
||||||
mcu-y += generic/armcm_irq.c generic/crc16_ccitt.c
|
mcu-y += generic/armcm_irq.c generic/crc16_ccitt.c
|
||||||
|
|
||||||
src-y += rp2040/armcm_canboot.c $(mcu-y)
|
src-y += rp2040/armcm_canboot.c $(mcu-y)
|
||||||
@ -56,7 +56,7 @@ lib/rp2040_flash/rp2040_flash:
|
|||||||
# Flash rules
|
# Flash rules
|
||||||
flash: $(OUT)canboot.uf2 lib/rp2040_flash/rp2040_flash
|
flash: $(OUT)canboot.uf2 lib/rp2040_flash/rp2040_flash
|
||||||
@echo " Flashing $< "
|
@echo " Flashing $< "
|
||||||
$(Q)./lib/rp2040_flash/rp2040_flash $(OUT)canboot.uf2
|
$(Q) $(if $(NOSUDO),,sudo) ./lib/rp2040_flash/rp2040_flash $(OUT)canboot.uf2
|
||||||
|
|
||||||
# Deployer build
|
# Deployer build
|
||||||
deployer-y += generic/armcm_boot.c generic/armcm_reset.c $(mcu-y)
|
deployer-y += generic/armcm_boot.c generic/armcm_reset.c $(mcu-y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user