mirror of
https://github.com/micropython/micropython.git
synced 2025-12-15 17:30:14 +01:00
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>
This commit is contained in:
@@ -1,21 +1,7 @@
|
|||||||
import openamp
|
# Change working directory to ROMFS, so boot.py and main.py can run from there.
|
||||||
import time
|
try:
|
||||||
from machine import Pin
|
import os
|
||||||
|
|
||||||
|
os.chdir("/rom")
|
||||||
def ept_recv_callback(src_addr, data):
|
except:
|
||||||
print("Received message on endpoint", data)
|
pass
|
||||||
|
|
||||||
|
|
||||||
# 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())
|
|
||||||
|
|||||||
Reference in New Issue
Block a user