User forums > Help
Ubuntu - Can't open serial port ttyUSB0 during debug
meranges:
I keep on my investigations.
It seems to be linked with the amount of data sended by the serial port. There is continously data on the serial port.
If I stop the stream , or I reduce it, all works fine.
I don't understand the link between the amount of data and this error even more beacause it woks fine on a small Raspberry Pi Zero.
Miguel Gimenez:
The serial port has a limited character throughput (given by bauds/10). This is the same limit in a computer and in the Raspberry Pi Zero. The latter is relatively slow and (possibly) can't overflow the output buffer. The former is way faster and any buffer will overflow soon or later.
Are you checking if the calls to I/O functions are successful?. For example, fprintf() returns the number of characters really written: do this value match the number of characters you sent?.
meranges:
I don't understand how serial ports work under Linux.
I keep on develop my C++ application. And I have no problem for a while.
I add some files, new class, into my project and it doesn'y works again. And now it is in Debug or release...
On open (SerialPortName.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
I get a negative value. If I display the status witha perror, i can have something like "Success" !!! or "input/Outut error", even if I don't change anything in my code !
I try to go back in my project, and I can find a version working fine every launches.
I try to add some of my new code but I don't call it The propblem appears...
Is anyone can help me to understand what is this ununderstandable problem ?
Is there a link with character ASCII or not ? are char always only 1 byte long ? or is it depending on ??? I don't know what.
stahta01:
You need to find a programming support site for your Operating System (OS).
http://forums.codeblocks.org/index.php/topic,9996.0.html
Edit: The above is true if the issue can be duplicated when running from the command [line] to verify the problem is not part of Code::Blocks. The others in this thread are likely to try to help you; but, if the problem is not in Code::Blocks there is a good chance they will not be able to help you.
Tim S.
Navigation
[0] Message Index
[*] Previous page
Go to full version