#RTL8720DN eRPC CircuitPython development
1 messages · Page 1 of 1 (latest)
Notes insofar:
There seems to have been a hw revision across the years. In the later revision, leaving the uart pins floating panics the chip leaving it unresponsive. For this, initializing uart should be done near the chip reset.
Current repo: https://github.com/stonehippo/CircuitPython_eRPC_Client
Long running gist: https://gist.github.com/stonehippo/7be2dc72dc1227196f9b693c3a44774f
import board
import busio
from time import sleep
from digitalio import DigitalInOut
import erpc
from erpc_shim import rpc_system, rpc_wifi_api
# Reset RTL8720
pwr = DigitalInOut(board.RTL_PWR)
pwr.switch_to_output()
pwr.value = False
sleep(.125)
pwr.value = True
uart = busio.UART(board.RTL_MOSI, board.RTL_MISO, baudrate=614400)
sleep(.125)
uart.read(uart.in_waiting)
rdy = DigitalInOut(board.RTL_READY)
log_uart = busio.UART(board.RTL_TXD, board.RTL_RXD, baudrate=614400)
xport = erpc.transport.SerialTransport(uart)
manager = erpc.client.ClientManager(xport, erpc.basic_codec.BasicCodec)
try:
test_byte = 0xF
system_client = rpc_system.client.rpc_systemClient(manager)
ver = system_client.rpc_system_version()
ack = system_client.rpc_system_ack(test_byte)
print(f"OK: version: {ver}, ack({test_byte}): {ack}")
except TypeError:
print("FAIL")