Skip to content

Commit 745b431

Browse files
robert-hhdpgeorge
authored andcommitted
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.
1 parent dfd4324 commit 745b431

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ports/mimxrt/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ BOARD ?= TEENSY40
22
BOARD_DIR ?= boards/$(BOARD)
33
BUILD ?= build-$(BOARD)
44

5+
PORT ?= /dev/ttyACM0
6+
57
CROSS_COMPILE ?= arm-none-eabi-
68

79
ifeq ($(wildcard $(BOARD_DIR)/.),)
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# format.py
2+
# Re-create the file system
3+
4+
import os
5+
import mimxrt
6+
7+
bdev = mimxrt.Flash()
8+
9+
os.VfsLfs2.mkfs(bdev, progsize=256)
10+
vfs = os.VfsLfs2(bdev, progsize=256)
11+
os.mount(vfs, "/")

ports/mimxrt/boards/TEENSY40/mpconfigboard.mk

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ MCU_VARIANT = MIMXRT1062DVJ6A
33

44
deploy: $(BUILD)/firmware.hex
55
teensy_loader_cli --mcu=imxrt1062 -v -w $<
6+
sleep 1
7+
$(PYTHON) $(TOP)/tools/pyboard.py --device $(PORT) $(BOARD_DIR)/format.py

0 commit comments

Comments
 (0)