mimxrt/boards/TEENSY40: Re-create the flash FS after deploy.

This is required since the Teensy Halfkay loader attempts to erase all of
the flash but fails to do so, at least in my tests.  Formatting brings it
back to a known state.
This commit is contained in:
robert-hh 2021-05-17 12:31:11 +02:00 committed by Damien George
parent dfd4324eb1
commit 745b4319a2
3 changed files with 15 additions and 0 deletions

View File

@ -2,6 +2,8 @@ BOARD ?= TEENSY40
BOARD_DIR ?= boards/$(BOARD)
BUILD ?= build-$(BOARD)
PORT ?= /dev/ttyACM0
CROSS_COMPILE ?= arm-none-eabi-
ifeq ($(wildcard $(BOARD_DIR)/.),)

View File

@ -0,0 +1,11 @@
# format.py
# Re-create the file system
import os
import mimxrt
bdev = mimxrt.Flash()
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")

View File

@ -3,3 +3,5 @@ MCU_VARIANT = MIMXRT1062DVJ6A
deploy: $(BUILD)/firmware.hex
teensy_loader_cli --mcu=imxrt1062 -v -w $<
sleep 1
$(PYTHON) $(TOP)/tools/pyboard.py --device $(PORT) $(BOARD_DIR)/format.py