From f088d4fa14c0fdcf8d833c81cbd4dcfcd387da7c Mon Sep 17 00:00:00 2001 From: Brad Campbell Date: Thu, 29 Aug 2024 13:41:29 -0400 Subject: [PATCH 1/3] boards: stm32discovery: tockloader works No need for the old .apps documentation. --- boards/stm32f3discovery/README.md | 40 ---------------------------- boards/stm32f412gdiscovery/README.md | 40 ---------------------------- boards/stm32f429idiscovery/README.md | 40 ---------------------------- 3 files changed, 120 deletions(-) diff --git a/boards/stm32f3discovery/README.md b/boards/stm32f3discovery/README.md index 51e6e8e05f..494bc62774 100644 --- a/boards/stm32f3discovery/README.md +++ b/boards/stm32f3discovery/README.md @@ -16,43 +16,3 @@ $ make flash $ make flash-debug ``` - -> **Note:** Unlike other Tock platforms, the default kernel image for this -> board will clear flashed apps when the kernel is loaded. This is to support -> the non-tockloader based app flash procedure below. To preserve loaded apps, -> comment out the `APP_HACK` variable in `src/main.rs`. - -## Flashing app - -Apps are built out-of-tree. Once an app is built, you can use -`arm-none-eabi-objcopy` with `--update-section` to create an ELF image with the -apps included. - -```bash -$ arm-none-eabi-objcopy \ - --update-section .apps=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf \ - target/thumbv7em-none-eabi/release/stm32f3discovery.elf \ - target/thumbv7em-none-eabi/release/stm32f3discovery-app.elf -``` - -For example, you can update `Makefile` as follows. - -``` -APP=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf -KERNEL=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/release/$(PLATFORM).elf -KERNEL_WITH_APP=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/release/$(PLATFORM)-app.elf - -.PHONY: program -program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) - $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $(KERNEL_WITH_APP); verify_image $(KERNEL_WITH_APP); reset; shutdown" -``` - -After setting `APP`, `KERNEL`, `KERNEL_WITH_APP`, and `program` target -dependency, you can do - -```bash -$ make program -``` - -to flash the image. diff --git a/boards/stm32f412gdiscovery/README.md b/boards/stm32f412gdiscovery/README.md index 39e4674c8a..3c083902a6 100644 --- a/boards/stm32f412gdiscovery/README.md +++ b/boards/stm32f412gdiscovery/README.md @@ -17,46 +17,6 @@ $ make flash $ make flash-debug ``` -> **Note:** Unlike other Tock platforms, the default kernel image for this -> board will clear flashed apps when the kernel is loaded. This is to support -> the non-tockloader based app flash procedure below. To preserve loaded apps, -> comment out the `APP_HACK` variable in `src/main.rs`. - -## Flashing app - -Apps are built out-of-tree. Once an app is built, you can use -`arm-none-eabi-objcopy` with `--update-section` to create an ELF image with the -apps included. - -```bash -$ arm-none-eabi-objcopy \ - --update-section .apps=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf \ - target/thumbv7em-none-eabi/release/discovery_f412g.elf \ - target/thumbv7em-none-eabi/release/discovery_f412g-app.elf -``` - -For example, you can update `Makefile` as follows. - -``` -APP=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf -KERNEL=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/release/$(PLATFORM).elf -KERNEL_WITH_APP=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/release/$(PLATFORM)-app.elf - -.PHONY: program -program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) - $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $(KERNEL_WITH_APP); verify_image $(KERNEL_WITH_APP); reset; shutdown" -``` - -After setting `APP`, `KERNEL`, `KERNEL_WITH_APP`, and `program` target -dependency, you can do - -```bash -$ make program -``` - -to flash the image. - ## OpenOCD Note The release version of openocd does not fully support stm32412g discovery kit. Uploading seems to work with the setup for nucelo429zi. The openocd.cfg file contains both setups, one being commented. diff --git a/boards/stm32f429idiscovery/README.md b/boards/stm32f429idiscovery/README.md index ba26df9e8d..b2fbc23848 100644 --- a/boards/stm32f429idiscovery/README.md +++ b/boards/stm32f429idiscovery/README.md @@ -17,43 +17,3 @@ $ make flash $ make flash-debug ``` - -> **Note:** Unlike other Tock platforms, the default kernel image for this -> board will clear flashed apps when the kernel is loaded. This is to support -> the non-tockloader based app flash procedure below. To preserve loaded apps, -> comment out the `APP_HACK` variable in `src/main.rs`. - -## Flashing app - -Apps are built out-of-tree. Once an app is built, you can use -`arm-none-eabi-objcopy` with `--update-section` to create an ELF image with the -apps included. - -```bash -$ arm-none-eabi-objcopy \ - --update-section .apps=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf \ - target/thumbv7em-none-eabi/debug/stm32f429idiscovery.elf \ - target/thumbv7em-none-eabi/debug/stm32f429idiscovery-app.elf -``` - -For example, you can update `Makefile` as follows. - -``` -APP=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf -KERNEL=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/debug/$(PLATFORM).elf -KERNEL_WITH_APP=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/debug/$(PLATFORM)-app.elf - -.PHONY: program -program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/debug/$(PLATFORM).elf - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) - $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $(KERNEL_WITH_APP); verify_image $(KERNEL_WITH_APP); reset; shutdown" -``` - -After setting `APP`, `KERNEL`, `KERNEL_WITH_APP`, and `program` target -dependency, you can do - -```bash -$ make program -``` - -to flash the image. From 94c2f082cbb76dabe6ead87b8914f7a648e929ca Mon Sep 17 00:00:00 2001 From: Brad Campbell Date: Tue, 10 Sep 2024 10:37:24 -0400 Subject: [PATCH 2/3] boards: linker: mark .apps as NOLOAD --- boards/kernel_layout.ld | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boards/kernel_layout.ld b/boards/kernel_layout.ld index 7220f55844..4e0262f0d7 100644 --- a/boards/kernel_layout.ld +++ b/boards/kernel_layout.ld @@ -227,9 +227,13 @@ SECTIONS * This section is put into the "prog" memory, which is reserved for * applications. This section is not used for the kernel, but including it * in the .elf file allows for concatenating application binaries with the - * kernel. + * kernel. By default the loader will not include this section in the + * flashed binary. For boards that wish to use this section, it can be set + * to load with `objcopy` similar to: + * + * arm-none-eabi-objcopy --set-section-flags .apps=LOAD */ - .apps : + .apps (NOLOAD) : { /* _sapps symbol used by Tock to look for first application. */ . = ALIGN(4); From d6ae7fa1d036bfda0436a1b4df009a2730759afb Mon Sep 17 00:00:00 2001 From: Brad Campbell Date: Tue, 10 Sep 2024 10:43:00 -0400 Subject: [PATCH 3/3] boards: add --set-section-flags .apps=LOAD To all boards that use a single image with kernel and apps. --- boards/esp32-c3-devkitM-1/Makefile | 2 +- boards/imxrt1050-evkb/Makefile | 2 +- boards/imxrt1050-evkb/README.md | 1 + boards/nano_rp2040_connect/Makefile | 6 +++--- boards/nucleo_f429zi/README.md | 3 ++- boards/nucleo_f446re/README.md | 3 ++- boards/opentitan/earlgrey-cw310/Makefile | 4 ++-- boards/pico_explorer_base/Makefile | 6 +++--- boards/raspberry_pi_pico/Makefile | 6 +++--- boards/teensy40/Makefile | 2 +- boards/teensy40/README.md | 3 ++- boards/weact_f401ccu6/Makefile | 2 +- boards/weact_f401ccu6/README.md | 1 + 13 files changed, 23 insertions(+), 18 deletions(-) diff --git a/boards/esp32-c3-devkitM-1/Makefile b/boards/esp32-c3-devkitM-1/Makefile index 52c572e0dd..1eab05692e 100644 --- a/boards/esp32-c3-devkitM-1/Makefile +++ b/boards/esp32-c3-devkitM-1/Makefile @@ -20,7 +20,7 @@ flash-app: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf ifeq ($(APP),) $(error "Please specify an APP to be flashed") endif - $(RISC_PREFIX)-objcopy --update-section .apps=$(APP) $^ $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.elf + $(RISC_PREFIX)-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $^ $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.elf esptool.py --port /dev/ttyUSB0 --chip esp32c3 elf2image --use_segments --output binary.hex $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.elf --dont-append-digest esptool.py --port /dev/ttyUSB0 --chip esp32c3 write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x0 binary.hex diff --git a/boards/imxrt1050-evkb/Makefile b/boards/imxrt1050-evkb/Makefile index e131d36c7a..4367a61cdf 100644 --- a/boards/imxrt1050-evkb/Makefile +++ b/boards/imxrt1050-evkb/Makefile @@ -20,7 +20,7 @@ flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf .PHONY: flash-app flash-app: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf @: $(if $(value APP),,$(error Please set APP to the path of a TBF file to program applications)) - arm-none-eabi-objcopy --update-section .apps=$(APP) $< \ + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $< \ $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.elf crt_emu_cm_redlink \ --flash-load-exec "$(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.elf" \ diff --git a/boards/imxrt1050-evkb/README.md b/boards/imxrt1050-evkb/README.md index 75bda62311..f6bfb822ce 100644 --- a/boards/imxrt1050-evkb/README.md +++ b/boards/imxrt1050-evkb/README.md @@ -49,6 +49,7 @@ with your app(s) included. ```bash $ arm-none-eabi-objcopy \ + --set-section-flags .apps=LOAD \ --update-section .apps=../../../libtock-c/examples/c_hello/build/cortex-m7/cortex-m7.tbf \ target/thumbv7em-none-eabi/debug/imxrt1050-evkb.elf \ target/thumbv7em-none-eabi/debug/imxrt1050-evkb-app.axf diff --git a/boards/nano_rp2040_connect/Makefile b/boards/nano_rp2040_connect/Makefile index b2add56a63..9951353d5e 100644 --- a/boards/nano_rp2040_connect/Makefile +++ b/boards/nano_rp2040_connect/Makefile @@ -26,9 +26,9 @@ flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf .PHONY: flash-app flash-app: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin ifeq ($(APP),) - $(error Please define the APP variable with the TBF file to flash an application) -endif - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) + $(error Please define the APP variable with the TBF file to flash an application) +endif + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) elf2uf2-rs $(KERNEL_WITH_APP) $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2 @if [ -d $(BOOTSEL_FOLDER) ]; then cp $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2 "$(BOOTSEL_FOLDER)"; else echo; echo Please edit the BOOTSEL_FOLDER variable to point to you Nano RP2040 Flash Drive Folder; fi diff --git a/boards/nucleo_f429zi/README.md b/boards/nucleo_f429zi/README.md index 1dc86ee319..63a05c78a4 100644 --- a/boards/nucleo_f429zi/README.md +++ b/boards/nucleo_f429zi/README.md @@ -30,6 +30,7 @@ apps included. ```bash $ arm-none-eabi-objcopy \ + --set-section-flags .apps=LOAD \ --update-section .apps=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf \ target/thumbv7em-none-eabi/debug/nucleo_f429zi.elf \ target/thumbv7em-none-eabi/debug/nucleo_f429zi-app.elf @@ -44,7 +45,7 @@ KERNEL_WITH_APP=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/debug/$(PLATFORM)-app.el .PHONY: program program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/debug/$(PLATFORM).elf - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $(KERNEL_WITH_APP); verify_image $(KERNEL_WITH_APP); reset; shutdown" ``` diff --git a/boards/nucleo_f446re/README.md b/boards/nucleo_f446re/README.md index 3123473970..d2a6356d30 100644 --- a/boards/nucleo_f446re/README.md +++ b/boards/nucleo_f446re/README.md @@ -30,6 +30,7 @@ apps included. ```bash $ arm-none-eabi-objcopy \ + --set-section-flags .apps=LOAD \ --update-section .apps=../../../libtock-c/examples/c_hello/build/cortex-m4/cortex-m4.tbf \ target/thumbv7em-none-eabi/debug/nucleo_f446re.elf \ target/thumbv7em-none-eabi/debug/nucleo_f446re-app.elf @@ -44,7 +45,7 @@ KERNEL_WITH_APP=$(TOCK_ROOT_DIRECTORY)/target/$(TARGET)/debug/$(PLATFORM)-app.el .PHONY: program program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/debug/$(PLATFORM).elf - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $(KERNEL_WITH_APP); verify_image $(KERNEL_WITH_APP); reset; shutdown" ``` diff --git a/boards/opentitan/earlgrey-cw310/Makefile b/boards/opentitan/earlgrey-cw310/Makefile index 59242308d2..0f73d8463c 100644 --- a/boards/opentitan/earlgrey-cw310/Makefile +++ b/boards/opentitan/earlgrey-cw310/Makefile @@ -81,7 +81,7 @@ flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin $(OPENTITAN_TREE)/bazel-bin/sw/host/opentitantool/opentitantool.runfiles/lowrisc_opentitan/sw/host/opentitantool/opentitantool --interface=cw310 bootstrap $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin flash-app: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf - $(RISC_PREFIX)-objcopy --update-section .apps=$(APP) $^ $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.elf + $(RISC_PREFIX)-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $^ $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.elf $(RISC_PREFIX)-objcopy --output-target=binary $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.elf $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.bin $(OPENTITAN_TREE)/bazel-bin/sw/host/opentitantool/opentitantool.runfiles/lowrisc_opentitan/sw/host/opentitantool/opentitantool --interface=cw310 bootstrap $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.bin @@ -91,7 +91,7 @@ verilator: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf $(RISC_PREFIX)-objcopy $^ $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.elf ifneq ($(APP),) $(info [CW-130: Verilator]: Linking App) - $(RISC_PREFIX)-objcopy --update-section .apps=$(APP) $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.elf $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.elf + $(RISC_PREFIX)-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.elf $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.elf endif $(info [CW-130: Verilator]: Starting) $(RISC_PREFIX)-objcopy --output-target=binary $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.elf $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)_verilator.bin diff --git a/boards/pico_explorer_base/Makefile b/boards/pico_explorer_base/Makefile index aa149036b6..e43961bd22 100644 --- a/boards/pico_explorer_base/Makefile +++ b/boards/pico_explorer_base/Makefile @@ -32,9 +32,9 @@ flash: $(KERNEL) .PHONY: program program: $(KERNEL) ifeq ($(APP),) - $(error Please define the APP variable with the TBF file to flash an application) -endif - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) + $(error Please define the APP variable with the TBF file to flash an application) +endif + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) elf2uf2-rs $(KERNEL_WITH_APP) $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2 @if [ -d $(BOOTSEL_FOLDER) ]; then cp $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2 "$(BOOTSEL_FOLDER)"; else echo; echo Please edit the BOOTSEL_FOLDER variable to point to you Raspberry Pi Pico Flash Drive Folder; echo You can download and flash $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2; fi diff --git a/boards/raspberry_pi_pico/Makefile b/boards/raspberry_pi_pico/Makefile index aa149036b6..e43961bd22 100644 --- a/boards/raspberry_pi_pico/Makefile +++ b/boards/raspberry_pi_pico/Makefile @@ -32,9 +32,9 @@ flash: $(KERNEL) .PHONY: program program: $(KERNEL) ifeq ($(APP),) - $(error Please define the APP variable with the TBF file to flash an application) -endif - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) + $(error Please define the APP variable with the TBF file to flash an application) +endif + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) elf2uf2-rs $(KERNEL_WITH_APP) $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2 @if [ -d $(BOOTSEL_FOLDER) ]; then cp $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2 "$(BOOTSEL_FOLDER)"; else echo; echo Please edit the BOOTSEL_FOLDER variable to point to you Raspberry Pi Pico Flash Drive Folder; echo You can download and flash $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-app.uf2; fi diff --git a/boards/teensy40/Makefile b/boards/teensy40/Makefile index 5c7f38ac6e..a04c8cbf1e 100644 --- a/boards/teensy40/Makefile +++ b/boards/teensy40/Makefile @@ -22,7 +22,7 @@ program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).hex .PHONY: program-app program-app: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf @: $(if $(value APP),,$(error Please set APP to the path of a TBF file to program applications)) - $(Q)arm-none-eabi-objcopy --update-section .apps=$(APP) $< $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.elf + $(Q)arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $< $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.elf $(Q)$(OBJCOPY) -O ihex $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.elf $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.hex teensy_loader_cli --mcu=TEENSY40 -w -v $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM)-apps.hex diff --git a/boards/teensy40/README.md b/boards/teensy40/README.md index 98564e7f0b..b2d1ed5305 100644 --- a/boards/teensy40/README.md +++ b/boards/teensy40/README.md @@ -42,6 +42,7 @@ with the Teensy 4 Tock kernel. ```bash $ arm-none-eabi-objcopy \ + --set-section-flags .apps=LOAD \ --update-section .apps=../../../libtock-c/examples/blink/build/cortex-m7/cortex-m7.tbf \ ../../target/thumbv7em-none-eabi/release/teensy40.elf \ ../../target/thumbv7em-none-eabi/release/teensy40-app.elf @@ -72,7 +73,7 @@ KERNEL_WITH_APP_HEX=$(TOCK_ROOT_DIRECTORY)/target/teensy40/release/teensy40-app. .PHONY: program program: target/thumbv7em-none-eabi/release/teensy40.elf - arm-none-eabi-objcopy --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $(KERNEL) $(KERNEL_WITH_APP) arm-none-eabi-objcopy -O ihex $(KERNEL_WITH_APP) $(KERNEL_WITH_APP_HEX) teensy_loader_cli -w -v --mcu=TEENSY40 $(KERNEL_WITH_APP_HEX) ``` diff --git a/boards/weact_f401ccu6/Makefile b/boards/weact_f401ccu6/Makefile index f14b977d5f..de10ad4903 100644 --- a/boards/weact_f401ccu6/Makefile +++ b/boards/weact_f401ccu6/Makefile @@ -19,5 +19,5 @@ flash: $(KERNEL) $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $<; verify_image $<; reset; shutdown" flash-app: $(KERNEL) - arm-none-eabi-objcopy --update-section .apps=$(APP) $< $(KERNEL_WITH_APP) + arm-none-eabi-objcopy --set-section-flags .apps=LOAD --update-section .apps=$(APP) $< $(KERNEL_WITH_APP) $(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $(KERNEL_WITH_APP); verify_image $(KERNEL_WITH_APP); reset; shutdown" diff --git a/boards/weact_f401ccu6/README.md b/boards/weact_f401ccu6/README.md index 1834884f98..28f3c3a60f 100644 --- a/boards/weact_f401ccu6/README.md +++ b/boards/weact_f401ccu6/README.md @@ -34,6 +34,7 @@ ELF image with the apps included. ```bash $ arm-none-eabi-objcopy \ + --set-section-flags .apps=LOAD \ --update-section .apps=../../../libtock-c/examples/blink/build/cortex-m4/cortex-m4.tbf \ ../../target/thumbv7em-none-eabihf/release/weact-f401ccu6.elf \ ../../target/thumbv7em-none-eabihf/release/weact-f401ccu6-app.elf