2016-03-30 14:36:39 +00:00
|
|
|
STMHAL_BUILD_DIR=vendor/micropython/stmhal/build-TREZORV2
|
|
|
|
|
|
|
|
help: ## show this help
|
2016-03-30 16:30:22 +00:00
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36mmake %-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
2016-03-30 14:36:39 +00:00
|
|
|
|
2016-04-04 11:59:10 +00:00
|
|
|
update: ## update git submodules
|
2016-04-01 18:04:59 +00:00
|
|
|
git submodule update
|
|
|
|
|
2016-04-04 11:59:10 +00:00
|
|
|
build: update build_stmhal build_unix ## build both stmhal and unix micropython ports
|
2016-03-30 16:30:22 +00:00
|
|
|
|
|
|
|
build_stmhal: ## build stmhal port
|
2016-03-30 14:36:39 +00:00
|
|
|
make -C vendor/micropython/stmhal
|
2016-03-30 16:30:22 +00:00
|
|
|
|
|
|
|
build_unix: ## build unix port
|
2016-03-30 14:36:39 +00:00
|
|
|
make -C vendor/micropython/unix
|
|
|
|
|
2016-04-08 09:29:15 +00:00
|
|
|
run_unix: ## run unix port
|
|
|
|
./vendor/micropython/unix/micropython
|
|
|
|
|
2016-03-30 14:36:39 +00:00
|
|
|
flash: ## flash firmware using st-flash
|
|
|
|
st-flash write $(STMHAL_BUILD_DIR)/firmware0.bin 0x8000000
|
|
|
|
sleep 0.1
|
|
|
|
st-flash write $(STMHAL_BUILD_DIR)/firmware1.bin 0x8020000
|
|
|
|
|
|
|
|
openocd: ## start openocd which connects to the device
|
|
|
|
openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg
|
|
|
|
|
|
|
|
gdb: ## start remote gdb session which connects to the openocd
|
|
|
|
gdb $(STMHAL_BUILD_DIR)/firmware.elf -ex 'target remote localhost:3333'
|
2016-03-31 14:48:57 +00:00
|
|
|
|
2016-04-03 23:46:46 +00:00
|
|
|
load: ## load contents of src into mass storage of trezor
|
2016-03-31 14:48:57 +00:00
|
|
|
rm -rf /run/media/${USER}/PYBFLASH/*
|
|
|
|
cp -a src/* /run/media/${USER}/PYBFLASH/
|
2016-04-04 11:58:21 +00:00
|
|
|
sync
|