summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-03-08 23:19:47 +1100
committerDamien George <damien@micropython.org>2025-04-09 00:22:32 +1000
commitd1b12cb6766d8b48d0e8cdf551808c324d0599c1 (patch)
tree5de4ecd3716645c93b41dd953681831f675443b9
parent8297c95c22fd15aa706243bfebb0688a61827855 (diff)
alif/modules: Make HE core set /rom as current dir.
This allows HE to execute code from the ROMFS in MRAM. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/alif/modules/he/_boot.py26
1 files changed, 6 insertions, 20 deletions
diff --git a/ports/alif/modules/he/_boot.py b/ports/alif/modules/he/_boot.py
index bc1320f19..3df180470 100644
--- a/ports/alif/modules/he/_boot.py
+++ b/ports/alif/modules/he/_boot.py
@@ -1,21 +1,7 @@
-import openamp
-import time
-from machine import Pin
+# Change working directory to ROMFS, so boot.py and main.py can run from there.
+try:
+ import os
-
-def ept_recv_callback(src_addr, data):
- print("Received message on endpoint", data)
-
-
-# Create a new RPMsg endpoint to communicate with main core.
-ept = openamp.Endpoint("vuart-channel", callback=ept_recv_callback)
-
-pin = Pin("LED_BLUE", Pin.OUT)
-
-count = 0
-while True:
- if ept.is_ready():
- ept.send("Hello from HE %d" % count, timeout=1000)
- count += 1
- time.sleep_ms(100)
- pin(not pin())
+ os.chdir("/rom")
+except:
+ pass