0

I'm using an embedded system with yocto (hardknott) with 2 RS232 port :

     /dev/ttymxc0  
     /dev/ttymxc1 

both used as console with a login prompt. Now I would switch one of that (e.g /dev/ttymxc0) and use it as normal serial, the reason to do that is permit the serial comunication between two device

How can do that via C code or via shell command?

I tryed with

systemctl stop serial-getty@ttymxc0.service

and

systemctl stop serial-getty@ttymxc0.service
systemctl disable serial-getty@ttyS0.service

but I'm not able to change the port behaviour

sawdust
  • 16,103
  • 3
  • 40
  • 50
H2O
  • 153
  • 1
  • 1
  • 13
  • 1
    Your use of terminology is sloppy, so your question is ambiguous. "*I'm using ... with 2 RS232 port : /dev/ttymxc0 /dev/ttymxc1*" -- No, those are just two *serial terminals*. Instead of RS-232, there could be RS-485 transceivers or no transceivers, just TTL levels. "*both used as console with a login prompt*" -- A Linux *console* is a terminal that displays kernel messages. You may or may not be able to login at this console. You seem to be conflating *console* and a login terminal. The designation of a *console* is completely independent of the login capability of a terminal. – sawdust Jul 19 '22 at 22:41
  • "*I tryed [sic] with ... but I'm not able to change the port behaviour*" -- Instead of a negative description, state what does happen (i.e. only what you actually observe), and why that is a problem. And it's not a port, but a serial terminal. That's why the device name begins with "tty...". – sawdust Jul 19 '22 at 22:42
  • @sawdust thanks a lot! The post indicated works for me – H2O Jul 20 '22 at 07:47

0 Answers0