I have got a problem when i receive data on Uart rx when i read.
Here is my test code :
import pyb,time red_led = pyb.LED(1) red_led.off() uart=pyb.UART(3,14400) uart.init(14400, bits=8, parity=None, stop=1) #, timeout_char=20 while(True): time.sleep(500) if uart.any(): uchar=uart.read(1) print('==> Info -------------') print(uchar) red_led.toggle()
I send “0x0F 0x00 0x0F 0x00 0x0F 0x00 0x0F 0x00” number with realterm software every half second (quick click) and the camera stops.
i dont have the same behavior if i send 50x this number at once because the uart buffer is limited.
It looks like the uart buffer index is lost when the reading is during the reception.
Do i do something wrong ?