Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem facing with QT serial port module
Forum Updated to NodeBB v4.3 + New Features

Problem facing with QT serial port module

Scheduled Pinned Locked Moved Solved General and Desktop
serial portdesktopqt5.9.1
5 Posts 4 Posters 3.2k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Dhani
    wrote on last edited by
    #1

    Hi all,
    I am facing an issue with the QT serial port module. I observed this from qt version 5.2.0 onwards and currently using 5.9.1.

    Environment:
    Target board (samd20 xplainedpro) is connected with the on-board bridge chip called "EDBG" which is used on all ATMEL XPlainedpro kits.
    The edbg chip serve as the serial to USB bridge for connecting the PC to the target board.
    windows 7 operating system with qt 5.9.1 version

    I could not able to receive any data after USB enumeration is complete and virtual serial port is created.
    But the data is received and working fine after I do connect/disconnect operations using the windows hyper-terminal software utility.
    The windows hyper terminal is working correctly from first connect operation itself.

    Everytime, when the USB cable is removed and reconnected, the serial communication fails.
    I have tested the QT simple terminal example application and the effect is same. the qt terminal works perfectly after I do connect/disconnect with hyper-terminal application for first time.

    Is this related to error due to the serial port open or related to RTS/CTS pins? Please provide feedback about the possible causes and solutions to solve this issue.

    1 Reply Last reply
    1
    • webzoidW Offline
      webzoidW Offline
      webzoid
      wrote on last edited by
      #2

      I initially had issues with a QSerialPort where I wouldn't receive any data through the port.

      This problem was solved by ensuring that the following properties were set correctly:

      m_serialPort.setDataBits(QSerialPort::Data8);
      m_serialPort.setFlowControl(QSerialPort::NoFlowControl);
      m_serialPort.setStopBits(QSerialPort::OneStop);
      m_serialPort.setParity(QSerialPort::NoParity);
      
      1 Reply Last reply
      2
      • D Offline
        D Offline
        Dhani
        wrote on last edited by
        #3

        Thanks for your feedback.
        I have identified that the problem is due to the EDBG chip (usb-serial bridge) which requires DTR signal to enable the serial port RXD and TXD pins.

        Including the line of code "serial->setDataTerminalReady(true);" after opening the serial port, the serial port application is now working fine. I guess this is automatically carried out on hyper-terminal software and tera-term software.

        Whether the communication uses the flow control or not,some of the hardware bridge requires the flow control signals to be set for the first time after power ON.

        H 1 Reply Last reply
        5
        • D Dhani

          Thanks for your feedback.
          I have identified that the problem is due to the EDBG chip (usb-serial bridge) which requires DTR signal to enable the serial port RXD and TXD pins.

          Including the line of code "serial->setDataTerminalReady(true);" after opening the serial port, the serial port application is now working fine. I guess this is automatically carried out on hyper-terminal software and tera-term software.

          Whether the communication uses the flow control or not,some of the hardware bridge requires the flow control signals to be set for the first time after power ON.

          H Offline
          H Offline
          hylsh
          wrote on last edited by hylsh
          #4

          @Dhani thank you so much for your reply..., had the exactly same issue. Now solved thanks to your line of code. You are a life saver!

          1 Reply Last reply
          1
          • P Offline
            P Offline
            Poaky
            wrote on last edited by
            #5

            @Dhani - thanks from me too. This fixed the same problem I was having connecting to a virtual serial port on an NXP dev board.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved