Code: Select all
>>> sys.implementation
(name='micropython', version=(1, 9, 1))
I've written a little loopback code shown below, just to see if I can get data from the RasPi to the PyBoard and back again without corruption. Strangely, the PyBoard seems to occasionally go out to lunch, drop off the USB console connection and block storage mount point, and require a hard reset. The symptoms are exactly that of some kind of lock race in the PyBoards serial driver allowing a buffer overflow to scribble everywhere in SRAM, at least that is where my suspicion would turn first. On the other hand, the PyBoard serial driver is very old, very well-exercised functionality, so I would expect it to be very robust by now. Anyway, my code is below. Am I missing something obvious? The code should just be a software implementation of a piece of wire....
Code: Select all
from pyb import UART
def run(s=115200):
uart = UART(1, s)
while True:
ch = uart.readchar()
if ch < 0:
continue
uart.writechar(ch)