In version 1.9.3 I could simply read and write data but in the current version, I am losing the last byte on RX all the time... So when I expect 20 bytes as an example, I can read 19 without any problems but an timeout occurs when I try to read the 20th...
Edit: They added the possibility to change UART0. A great feature that I would need, but unfortunately UART does not work at all with this, so I will stay with older versions, although I can't disable the REPL there.
Update: At least found a way to use UART0 not for the REPLas described in other posts. I now also know how to return to the REPL so that you can use UART0 for any device at any baudrate and when an exception is thrown, you will see it on the REPL. You'll have to define a variable uart0 = UART(0, 115200) (any baudrate you like). In main() you'll have to reinit uart0 for your device using uart0.init(10400) (e.g. when you need baudrate 10400). The function calling main looks like this:
Code: Select all
if __name__ == '__main__': # dupterm(None) # disable output/input on WebREPL # dupterm(None, 1) # disable REPL (v1.9.4) ex = None try: main() except Exception as e: ex = e # save exception that happend in my program using UART0 uart0.init(115200, bits=8, parity=None, stop=1) # so that it fits REPL again if ex is not None: raise ex # show the exception on REPL # dupterm(uart0) # enable WebREPL # dupterm(uart0, 1) # enable REPL (v1.9.4)