Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read always timeout in arm-unknown-linux-musleabihf #119

Closed
pandakka opened this issue Aug 7, 2023 · 5 comments
Closed

Read always timeout in arm-unknown-linux-musleabihf #119

pandakka opened this issue Aug 7, 2023 · 5 comments

Comments

@pandakka
Copy link

pandakka commented Aug 7, 2023

I try to use this Create in my embedded linux board programing. The port opened and send the message(I reviced by using the “cat /dev/ttyS3”) But when use test funtion read() its always get timeout Errors no matter how long Timeout() set. Did I miss something?
here is my test code :
(opnenative() have the same problem.)
1691380850227

cargo build :

1691380917716
@sirhcel
Copy link
Contributor

sirhcel commented Aug 7, 2023

Hello @pandakka, this looks strange indeed. If there is data on the rx line after the port gets opened, than I would expect it to be received.

Just the overcautious question: Is there actually data sent to the serial port you are running the snipped above on?

Could you please cross-check the reception of data with this serial port using a second adapter, crossed RX and TX lines, and hardware_check.rs from the latest main branch? For example:

$ cargo run --release --example hardware_check -- --loopback-port /dev/tty.usbserial-11230 /dev/tty.usbserial-11240

Transmitting data back and forth between these two serial ports, should report success like (at least for the test cases not using flow control):

Testing paired ports '/dev/tty.usbserial-11240' and '/dev/tty.usbserial-11230':
  Transmitting from /dev/tty.usbserial-11240 to /dev/tty.usbserial-11230...
     At 2000000,8,n,1,noflow...
        success
        success
     At 115200,8,n,1,noflow...
        success
        success
     At 57600,8,n,1,noflow...
        success
        success
     At 10000,8,n,1,noflow...
        success
        success
     At 9600,8,n,1,noflow...
        success
        success
     At 9600,8,n,1,softflow...
        success
        success
     At 9600,8,n,1,hardflow...
        success
        success

@pandakka
Copy link
Author

pandakka commented Aug 8, 2023

@sirhcel Thank for your help ! Thank you for your advice, that I find my embedded linux board have a little diffent from PC,which need take some special setting 😓
Now it works. Thanks again : )

@sirhcel
Copy link
Contributor

sirhcel commented Aug 8, 2023

I'm glad to hear that! So there is nothing more to do here.

May I just ask out of curiosity what finally caused the data not being received?

@sirhcel sirhcel closed this as completed Aug 8, 2023
@sirhcel sirhcel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
@pandakka
Copy link
Author

pandakka commented Aug 9, 2023

Maybe is my first time touch embedded programing, I try a lot and find the path is /dev/ttymxc3 😂.
By the way available_ports() works well on my pc .But on my board side file style in "/sys/class/tty/ttymxc3/device/* is different ,which may cause the function() can't find the port ,so i need try by my hand😂.

@sirhcel
Copy link
Contributor

sirhcel commented Aug 9, 2023

This sounds like you are running into #66 on your embedded device. On Linux without libudev, the enumeration is done using sysfs and apparently the paths from /sys and not the actual devices files from /dev are returned.

What's your environment on the target? Is udev really not available there? How are you buildilng serialport-rs and your application for the embedded target? Could you please leave a comment in #66 if you are building without udev support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants