summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/mimxrt/Makefile2
-rw-r--r--ports/mimxrt/boards/TEENSY40/format.py11
-rw-r--r--ports/mimxrt/boards/TEENSY40/mpconfigboard.mk2
3 files changed, 15 insertions, 0 deletions
diff --git a/ports/mimxrt/Makefile b/ports/mimxrt/Makefile
index 7feab6cd7..956291b32 100644
--- a/ports/mimxrt/Makefile
+++ b/ports/mimxrt/Makefile
@@ -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)/.),)
diff --git a/ports/mimxrt/boards/TEENSY40/format.py b/ports/mimxrt/boards/TEENSY40/format.py
new file mode 100644
index 000000000..75e5aa95c
--- /dev/null
+++ b/ports/mimxrt/boards/TEENSY40/format.py
@@ -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, "/")
diff --git a/ports/mimxrt/boards/TEENSY40/mpconfigboard.mk b/ports/mimxrt/boards/TEENSY40/mpconfigboard.mk
index 6b939a3af..79365d0da 100644
--- a/ports/mimxrt/boards/TEENSY40/mpconfigboard.mk
+++ b/ports/mimxrt/boards/TEENSY40/mpconfigboard.mk
@@ -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