Cannot init 2 UARTs on GPy



  • I am trying to initialize UART:

    uartGPS = UART(0, 9600)
    uartGPS.init(9600, bits=8, parity=None, stop=1, pins=('P3','P4'), timeout_chars=5)

    GPy gets frozen on these commands.

    uartGPS = UART(1, 9600)
    uartGPS.init(9600, bits=8, parity=None, stop=1, pins=('P3','P4'), timeout_chars=5)

    works well.

    I need for my projects two UARTs.



  • This post is deleted!


  • @andrejpekarcik UART0 is used for the REPL over USB. The regular speed is 115200. SO if you want to use that, you have to deinit REPL on UART, using uos.dupterm(None), and use Telnet for the REPL.



  • I believe that bus 0 is used for REPL through serial connection in your case as well as this is an usual setup. Initializing new UART object on the same bus seems to stop terminal duplication (see os.dupterm() in docs). Try to connect to REPL via Telnet instead of serial connection.
    There is also bus 2 but according to the docs it is used for connection to LTE modem in case of GPy.


Log in to reply
 

Pycom on Twitter