Skip to content

Commit

Permalink
boards: stmf429zi: make flash
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Mar 21, 2024
1 parent 40515d8 commit 2bccfb3
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions boards/stm32f429idiscovery/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@ include ../Makefile.common
OPENOCD=openocd
OPENOCD_OPTIONS=-f openocd.cfg

# Default target for installing the kernel.
.PHONY: install
install: flash

.PHONY: flash-debug
flash-debug: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/debug/$(PLATFORM).elf
$(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $<; verify_image $<; reset; shutdown"
flash-debug: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/debug/$(PLATFORM).bin
$(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; program $< verify 0x08000000; reset; shutdown"

.PHONY: flash
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).elf
$(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; flash write_image erase $<; verify_image $<; reset; shutdown"

APP=../../../libtock-rs/target/thumbv7em-none-eabi/tab/stm32f429idiscovery/hello_world/cortex-m4.tbf
#APP=../../../libtock-rs/target/thumbv7em-none-eabi/tab/stm32f429idiscovery/blink/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"
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin
$(OPENOCD) $(OPENOCD_OPTIONS) -c "init; reset halt; program $< verify 0x08000000; reset; shutdown"

0 comments on commit 2bccfb3

Please sign in to comment.