Controlling DCD, DTR, DSR lines by legato application



It is possible to control the DCD, DTR and DSR from my legato application, so I can use them like GPIO?
!RIOWNER can be used only for Ring Indicator.


have you tried this?


Hi jyijyi,

I tried that. But DCD output remains the same. No changes on the pin.
I believe that works only on DTE, as the module is DCE.

On following release note is mentioned that if AT!RIOWNER is set tp APP, DCD line can be controlled by legato app. But when I tried, in see only gpioRI on the /sys/class/gpio.

Resolves: LXSWI9X1517-73

Add support for UART1 DSR, DCD, DTR lines refs/changes/30/9530/3
Currently, UART1 RI is supported and can be configured for modem or apps
using AT!RIOWNER. This change extends the mechanism used to control/configure
RI to DSR, DCD and DTR. if AT!RIOWNER is set to apps, then RI, DSR, DCD
and DTR will be available for export in sysfs and are mapped to gpio 16,
17, 18, and 19, respectively.


I just tried on my WP8548 (legato version: 16.10.4).
You can first set at!riowner=1, after you can type the following:
echo RI > /sys/class/gpio/export
echo DTR > /sys/class/gpio/export
echo DCD > /sys/class/gpio/export
echo DSR > /sys/class/gpio/export
ls /sys/class/gpio
gpioDCD gpioDSR gpioDTR gpioRI


Hi jyijyi,

we are using the WP7607-1 [legato: 18.06.3]. On this modul, only gpioRI is supported.

root@swi-mdm9x28-wp:~# echo RI > /sys/class/gpio/export
root@swi-mdm9x28-wp:~# echo DCD > /sys/class/gpio/export
sh: write error: Operation not permitted
root@swi-mdm9x28-wp:~# echo DSR > /sys/class/gpio/export
sh: write error: Operation not permitted
root@swi-mdm9x28-wp:~# echo DTR > /sys/class/gpio/export
sh: write error: Operation not permitted

Do you know if the DCD/DSR/DTR lines will be supported in the futurte release?


I believe the 8 wire UART is supported since FW REL 10 for WP76.
have you tried AT&D AT&S AT&C these commands to control those pins?


Hi jyijyi,

the commands will not help. We have to controlle the lines by legatp app.
It would be perfect when you will check if it is planning to implemet the supporting for UART1 DSR, DCD, DTR by using the AT!RIOWNER to be able to use gpioDCD gpioDSR gpioDTR?


you can still send those AT command in legato app.
BTW, it seems there is no such implementation as you mentioned for WP76…


Hi jyijyi,

we have to emulate CSD Call using TCP/IP connection via UART1 (Customer Linux application mode). We have to trigger the DCD line, when UART1 goes into data mode and when it goes back into command mode. That’y why we need to controll.
The at commands whoch you mentioned will not help.


Hi jyijyi,

can you please tell me if gpioDCD gpioDSR gpioDTR will be supported on WP76 on the next releases?


I don’t see there is such implementation on the coming release on WP76.
However, I check the code (yocto/kernel/driver/gpio/gpiolib.c) of yocto of WP8548.
I guess it is not difficult to implement.

In WP76 yocto source code (yocto/kernel/driver/gpio/gpiolib-sysfs.c) , you can add some new GPIO in ext_gpio_map ext_gpio_wp:

And map those xx number to the MDM CHIP UART DCD/DTR/DSR.

After that you should be able to control in console like:
echo 101 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio101/direction
echo 1 > /sys/class/gpio/gpio101/value
echo 102 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio102/direction
echo 1 > /sys/class/gpio/gpio102/value
echo 103 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio103/direction
echo 1 > /sys/class/gpio/gpio103/value

Currently I don’t have the information of xx of MDM CHIP UART number.
And there might be potential issue that the 8-wire UART may also control those pins.
I think you need to contact distributor of your region for the xx information or ask them for this new feature development in coming release.