Skip to content

Commit d1b12cb

Browse files
committed
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 <[email protected]>
1 parent 8297c95 commit d1b12cb

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

ports/alif/modules/he/_boot.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
import openamp
2-
import time
3-
from machine import Pin
1+
# Change working directory to ROMFS, so boot.py and main.py can run from there.
2+
try:
3+
import os
44

5-
6-
def ept_recv_callback(src_addr, data):
7-
print("Received message on endpoint", data)
8-
9-
10-
# Create a new RPMsg endpoint to communicate with main core.
11-
ept = openamp.Endpoint("vuart-channel", callback=ept_recv_callback)
12-
13-
pin = Pin("LED_BLUE", Pin.OUT)
14-
15-
count = 0
16-
while True:
17-
if ept.is_ready():
18-
ept.send("Hello from HE %d" % count, timeout=1000)
19-
count += 1
20-
time.sleep_ms(100)
21-
pin(not pin())
5+
os.chdir("/rom")
6+
except:
7+
pass

0 commit comments

Comments
 (0)