-
Notifications
You must be signed in to change notification settings - Fork 40
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
Only ttyS0 can be specified in the port connector #368
Comments
I've found a solution to the question I wrote here the other day, so I'll report it. Same as before, Devices Toradex Coribli-imx7-emmc-1GB I noticed the following in this environment. port = new PortConnector (PortConnector.IRCOMM, 9600); If I do the above, I will get the following error. / dev / ircomm0: No such file or directory Also, regarding Bluetooth port = new PortConnector (PortConnector.BLUETOOTH, 9600); If I do the above, I will get the following error. /dev/rfcomm0: No such file or directory My purpose is to use multiple UARTs, so KERNEL=="ttymxc0", SYMLINK+="ttyS0" After setting this symbolic link Since BLUETOOTH is assigned to UART, BLUETOOTH cannot be used, but I think that it is an effective means if it is still good. Thank you very much. |
Thanks for letting us know!! Please report the solution when you can |
Hi guys, just a follow up on this issue, I think that this issue would be easily solvable with a new constructor that allows strings :) port = new PortConnector("/dev/ttymxc0", 9600); Whenever you can! Thanks! |
Hi alvaroga91. Thank you for providing the solution information. port = new PortConnector ("/ dev / ttymxc0", 9600); I tried the above description, but when I debug with VScode The constructor PortConnector (String, int) is undefined. Error occurs. I can press Proceed to force debugging, but when I package and deploy, the program starts momentarily and exits immediately. |
Issue Title
Only ttyS0 can be specified in the port connector
Describe the bug
Hi.
I'm developing Totalcross on Toredex's Coribli-im x7 board.
Devices Toradex Coribli-imx7-emmc-1GB
Carrierboard iris
Linux-ARM(32bit)
Totalcross SDK 7.1.0
Toradex Embedded Linux Reference Multimedia Image 5.0.0 build.1
I need to use the serial port.
The iris carrier board has three serial ports. UART_A, UART_B, UART_C.
Each of the three serial ports is assigned to a device file as shown below.
UART_A = /dev/ttymxc0
UART_B = /dev/ttymxc1
UART_C = /dev/ttymxc2
Since the Linux standard serial port device file is ttyS, not ttymxc,
Set a symbolic link. The pins I use are UART_B and UART_C, so set them as follows.
# cd dev
# ln -s ttymxc1 ttyS1
# ln -s ttymxc2 ttyS2
Then try serial communication using Totalcross's Port Connector library.
The following is a part of the source code.
When I run the above code, I get the following error:
/dev/ttyS0: No such file or directory
Additional context
PortNumber is specified as 1 in the code.
PortConnector port = new PortConnector(1, 9600);
I thought that setting PortNumber to 1 would set the device file to ttyS1.
In fact, PortNumber was set to ttyS0 in all cases 0, 1, 2 and 3.
Reboot the board and make the symbolic link look like this:
# cd dev
# ln -s ttymxc1 ttyS0
Then, the above error did not occur and serial communication was successful.
However, this way, the device file can only use ttyS0 at any given time.
Only one of UART_A, UART_B, and UART_C can be used as the serial port.
Since I want to use two serial ports at the same time, I need to specify ttyS0, ttyS1 and ttyS2 from the source code.
I thought the method was the code below, but it doesn't work.
PortConnector port = new PortConnector(*, 9600); // * is 0 or 1 or 2
Can anyone please tell me how to specify ttyS0, ttyS1 and ttyS2 from the Totalcross source code?
Thank you.
The text was updated successfully, but these errors were encountered: