I’m writing a script to calibrate our boards and have things mostly working. However, I’ve noticed that the UART functions drop a lot of data. When my device boots it’ll write several hundred bytes out the UART within a second or so. The data is made broken into ~20 lines, but the Arc only receives ~2. If I step over the code in firmware so that the data is printed slower, then it receives everything. The relevant part of my script is basically:
function wait_for_boot() otii.writeln("waiting for device to boot") while true do write_command("@@@") local rx_data repeat rx_data = box:read_rx() otii.writeln("data=" .. rx_data) until string.len(rx_data) == 0 otii.msleep(200) end end
If I remove the write_command line (which does a box:write_tx) and the otii.msleep, I get the same behaviour.
Is UART data buffered anywhere? Why am I dropped so much data? I’m only using a 115200 baud rate and very little data is being transmitted. Also, I’ve had trouble writing new line characters with write_tx and had to switch to using ! to terminate lines, which is a little annoying, but I can live with it.