[WP77][R14.1][19.11.5] How to use UART1_DTR to wakeup from Sleep State and register interrupt on this gpio

Hi,

I’m searshing how to configure UIART1_DTR to be a wakeup source when WP77 enters in Sleep State and if it’s possible to read and even better catch interrupts on this GPIO.

In WP77XX Product Specification r4.pdf chapter 4.9, the UIART1_DTR is listed as a wakeup source and in WP AT Command Reference r7.1.pdf I found the command +KSLEEP which should at least allow me to wakeup from sleep mode or at least prevent module to enter in sleep mode.
This command depends on !RIOWNER which is already set to 0 on my module by default.

My problem is that even if I set KSLEEP to 0 or to 1, when my modem is in sleep mode it doesn’t wakeup when I change the state of UART1_DTR.

Is it the right process or do I miss something ?

On the other hand, is it possible to access to the UART1_DTR state as other gpio through sysfs or something ?

Thanks for your help.

Regards

did you set the UART1 to be AT command port in AT!MAPUART? (i.e. AT!MAPUART=1,1)

BTW, are you using custom board or mangoh board for testing?

Hi,

Your question makes me think that I didn’t explain well my setup.

I am on a custon board with a wp77. The uart1 is used to communicate with another device with a custom protocol. Therefore our mapuart setting is set to customer linux application (17) for this uart.

I need to be able to wakeup the wp77 on uart dtr activity.

Is it possible to achive my goal this way ? Or is ont mandatory to set the uart1 setting to at command (1) with mapuart ?

Thanks

I mean you set these first to see if DTR pin can wake up the wp77 module

At!mapuart=1,1
At+ksleep=0

BTW, here shows how to change DTR to GPIO in yocto source of WP76 in R13, you can see if you can do the same in WP77:

As the implementation of yocto linux gpio part in WP76 FW R16.0.1 and R13 is different, I have also tried the following in the yocto linux of WP76 R16.0.1, I can control the UART1 DTR pin as other gpio through sysfs. You might try the same in WP77 R14.1 yocto source:

  1. open yocto/kernel/arch/arm/boot/dts/qcom/mdm9607-wp76xx.dtsi
  2. around line 367, add the following line for UART1 DTR:


		alias-42 = <&tlmm_pinmux 79 0>;
		alias-RI = <&tlmm_pinmux 25 0>;
		/* WIFI aliases */
		alias-WLAN_EN = <&tlmm_pinmux 58 0>;
		alias-WIFI_IRQ = <&tlmm_pinmux 79 0>;
		alias-UART1_DTR = <&tlmm_pinmux 17 0>;
  1. type make to build the yocto.cwe
  2. download to the module with FW 16
  3. I can control the UART1 DTR pin by the following commands:

echo UART1_DTR > /sys/class/gpio/v2/alias_export
echo out > /sys/class/gpio/v2/aliases_exported/UART1_DTR/direction
echo 1 > /sys/class/gpio/v2/aliases_exported/UART1_DTR/value

echo 0 > /sys/class/gpio/v2/aliases_exported/UART1_DTR/value

If it works, then you can see here to make this DTR (GPIO pin 17) as wake up pin in kernel driver.

https://forum.mangoh.io/t/accessing-driver-functions-under-linux-kernel-modules-for-bmi160/5162/2

Hi,

Thanks for your answer, I managed to add uart1_dtr in wp77 .dtsi file and could configure the gpio interrupt from my app.

Regards