I’m trying to get a FX30S to communicate with an rs485 device, but for some reason it is not possible to set the GPIO for rs485 termination resistor. rs485 mode can be set using the python script from the manual, but setting termination fails, as GPIO63 is not exported under /sys/class (and consequently no rs_term under /sys/devices/platform/msm_serial_hsl.0)
The UARTs are configured as follows:
/dev/ttyHSL0 exists, and seems to work
I’m fairly new to yocto/Legato/
How do I get GPIO63 to be exported for usage?
The serial interface always reverts to rs232 mode on reboot
Can this be set from Legato app, or do I need to change the startup scripts for this?
- Is it possible to verify basic communication from linux console, or is a Legato app necessary to talk to the serial port? I would like to use something like the below shell script to verify that the communication is working and that the rs485 device responds as it has been verified to do with rs485->usb converver.
disable rs232 mode
#echo 0 > /sys/class/gpio/gpio59/value
set 9600 8n1 mode
stty -F /dev/ttyHSL0 9600 cs8 -cstopb -parenb raw -echo
enable rs485 transmitter
echo 1 > /sys/class/gpio/gpio60/value
echo -ne “\x3a\x04\x01\x02\x07” > /dev/ttyHSL0
disable rs485 transmitter
echo 0 > /sys/class/gpio/gpio60/value
#enable rs485 receiver
echo 0 > /sys/class/gpio/gpio61/value
show command reply in Hex format
hexdump -C < /dev/ttyHSL0
- Are there any sample app’s available that use the FX30S serial port? I would greatly appreciate examples of how to use transmit/receive, but haven’t been able to find anything at all online.