add flashing using openocd to Makefile

pull/25/head
Pavol Rusnak 8 years ago
parent f09ce087c3
commit 588b7b5c70
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -59,11 +59,29 @@ flash: ## flash firmware using st-flash
sleep 0.1
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
sleep 0.1
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 -f interface/stlink-v2.cfg -f target/stm32f4x.cfg

Loading…
Cancel
Save