Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    UART parity always None?

    Scheduled Pinned Locked Moved WiPy 2&3
    5 Posts 3 Posters 1.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      morizm
      last edited by morizm

      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?

      1 Reply Last reply Reply Quote 0
      • D Offline
        duffo64
        last edited by

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

        /Claudio

        1 Reply Last reply Reply Quote 0
        • M Offline
          morizm
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino
            last edited by

            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

            1 Reply Last reply Reply Quote 3
            • M Offline
              morizm
              last edited by

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

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom