Skip to content

Commit 3a04238

Browse files
committed
fix/startup: Fixed atoms3u getting the wrong board id
Signed-off-by: lbuque <[email protected]>
1 parent e2511bc commit 3a04238

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

m5stack/modules/startup/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,19 @@ def startup(boot_opt, timeout: int = 60) -> None:
5454
# FIXME: remove this file is temporary solution
5555
os.remove("/flash/main.py")
5656

57-
# Special operations for some devices
5857
board_id = M5.getBoard()
58+
# Special operations for some devices
5959
if board_id == M5.BOARD.M5StickCPlus2:
6060
from machine import Pin
6161

6262
pin4 = Pin(4, Pin.OUT)
6363
pin4.value(1)
64+
if board_id == M5.BOARD.M5AtomS3U:
65+
# M5AtomS3U may fail to enter the AUTODETECT process, which will cause
66+
# m5things to fail to obtain the board id.
67+
nvs = esp32.NVS("M5GFX")
68+
nvs.set_u32("AUTODETECT", board_id)
69+
nvs.commit()
6470

6571
# Do nothing
6672
if boot_opt is BOOT_OPT_NOTHING:

0 commit comments

Comments
 (0)