UART parity always None?



  • Hi guys, I'm currently trying to get the uart of my Wipy 2.0 working, but I can't change the parity of the UART object. I tried setting the parity in the constructor and also with init method. Neither UART.ODD nor UART.EVEN worked, I always ended up with parity=None when printing the uart object to the console. My firmware version is 1.5.0.b2
    Can anybody help?



  • Many thanks! So I will wait for the next update..



  • Yes, there is a small bug on esp32/mods/machuart.c

        // parity
        uint32_t parity;
        if (args[2].u_obj == mp_const_none) {
            parity = UART_PARITY_DISABLE;
        } else {
            uint parity = mp_obj_get_int(args[2].u_obj);
    

    Last line (350) should not have the uint as that is shadowing the intented parity variable defined above.

    Pinging @daniel or @abilio



  • Yes I tried different combination with data, parity and stop bits, but no effect. Even with UART(0, parity=UART.ODD) I get parity=None returned.



  • Just for fun, did you try changing bits number also ?


Log in to reply
 

Pycom on Twitter