1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

add flashing using openocd to Makefile

This commit is contained in:
Pavol Rusnak 2016-09-29 13:30:23 +02:00
parent f09ce087c3
commit 588b7b5c70
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -59,11 +59,29 @@ flash: ## flash firmware using st-flash
sleep 0.1 sleep 0.1
st-flash write $(STMHAL_BUILD_DIR)/firmware1.bin 0x8020000 st-flash write $(STMHAL_BUILD_DIR)/firmware1.bin 0x8020000
flash_bootloader: vendor ## build bootloader flash_bootloader: vendor ## flash bootloader using st-flash
st-flash write $(STMHAL_BUILD_DIR)/bootloader0.bin 0x8000000 st-flash write $(STMHAL_BUILD_DIR)/bootloader0.bin 0x8000000
sleep 0.1 sleep 0.1
st-flash write $(STMHAL_BUILD_DIR)/bootloader1.bin 0x8020000 st-flash write $(STMHAL_BUILD_DIR)/bootloader1.bin 0x8020000
openocd_flash_bootloader: $(STMHAL_BUILD_DIR)/bootloader.hex ## flash bootloader using openocd
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg \
-c "init" \
-c "reset init" \
-c "stm32f4x mass_erase 0" \
-c "flash write_image $(STMHAL_BUILD_DIR)/bootloader.hex" \
-c "reset" \
-c "shutdown"
openocd_flash_firmware: $(STMHAL_BUILD_DIR)/firmware.hex ## flash firmware using openocd
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg \
-c "init" \
-c "reset init" \
-c "stm32f4x mass_erase 0" \
-c "flash write_image $(STMHAL_BUILD_DIR)/firmware.hex" \
-c "reset" \
-c "shutdown"
openocd: ## start openocd which connects to the device openocd: ## start openocd which connects to the device
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg