UART flow control with WP7608

I tried it again with the provided sample.
The result is not changed.

Then, I did not yet try a way by jyijyi.
If you have some sample, could you provide it for early resolution?

are you testing on MangOH green board to measure the DTS/DSR/DCD?

I’m testing WP7608 on my prototype board made by our company.

It looks no connection DTS/DSR/DCD (only TX/RX/CTS/RTS) on MangOH green board.

Do you know how to check to measure the DTS/DSR/DCD on MangOH green board?

from schematic, the pin for (DTR/DCD/DSR) are on CN600 connector pin 11,13,15.

Thank you for new information.

I wrote a program and ran it with our board and MangOH green board
However, both results are that the state of RS232C’s pins(DTR, DSR, DCD, RI) did not change.

When I ran same program with UbuntuPC, these pins changed.

Do you have any idea?

Let’s focus on setting DTR pin in mangOH green board (CN600 connector pin 11) first with my yocto image.

Here I have tried the following:


root@swi-mdm9x28-wp:~# cm info
Device: WP7609
IMEI: 359782080100373
IMEISV: 6
FSN: WA803370311610
Firmware Version: SWI9X07Y_02.25.02.01 000000 jenkins 2019/01/30 08:13:05
Bootloader Version: SWI9X07Y_02.25.02.01 000000 jenkins 2019/01/30 08:13:05
MCU Version:
PRI Part Number (PN): 9908102
PRI Revision: 001.000
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.056_000
SKU: 1103843
Last Reset Cause: Power Down
Resets Count: Expected: 10 Unexpected: 1
root@swi-mdm9x28-wp:~# legato version
18.10.3_0b50331a9f4d0ecc0fd816c2a1300436
root@swi-mdm9x28-wp:~# microcom /dev/ttyAT
ati3
Manufacturer: Sierra Wireless, Incorporated
Model: WP7609
Revision: SWI9X07Y_02.25.02.01 000000 jenkins 2019/01/30 08:13:05
IMEI: 359782080100373
IMEI SV: 6
FSN: WA803370311610
+GCAP: +CGSM

OK
ati8
Legato Ver: 18.10.3_0b50331a9f4d0ecc0fd816c2a1300436
Yocto Ver: SWI9X07Y_02.25.02.01 2019-08-08_12:54:14
OS Ver: Linux version 3.18.122 (owner@CNHKG-EX-001367) (gcc version 6.2.0 (GCC) ) #2 PREEMPT Thu Aug 8 12:56:18 HKT 2019
LK Ver: SWI9X07Y_02.25.02.01
RootFS Ver: SWI9X07Y_02.25.02.01 2019-08-08_12:54:14
UserFS Ver: unknown
MCU Ver: unknown

OK
root@swi-mdm9x28-wp:~# echo 101 > /sys/class/gpio/export
root@swi-mdm9x28-wp:~# echo out > /sys/class/gpio/gpio101/direction
root@swi-mdm9x28-wp:~# echo 1 > /sys/class/gpio/gpio101/value
root@swi-mdm9x28-wp:~# echo 0 > /sys/class/gpio/gpio101/value


I measure DTR pin in mangOH green board (CN600 connector pin 11), the status will change.
If you cannot make this work, probably there is hardware problem on your side.

Hi jyijyi

I’m trying to use ioctl by following procedure.

1.Make “Hello world” sample app in Developer studio
2.Modify .c source code like following one.

test_helloComponent.c (1.4 KB)

3.Build and install my app.

In order to check UART on mangOH green, which interface in /dev should I set? Currently, I set "ttyHS0" but it seems not to work.

Thank you.

–TAK

BTW, my environment is follows.

root@swi-mdm9x28-wp:~# cm info
Device: WP7605
IMEI: 353532100002653
IMEISV: 5
FSN: 2A904570501003
Firmware Version: SWI9X07Y_02.18.05.00 000000 jenkins 2018/07/19 17:40:21
Bootloader Version: SWI9X07Y_02.18.05.00 000000 jenkins 2018/07/19 17:40:21
MCU Version:
PRI Part Number (PN): 9908705
PRI Revision: 002.005
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.041_003
SKU: 1104208
Last Reset Cause: Power Down
Resets Count: Expected: 22 Unexpected: 0

root@swi-mdm9x28-wp:~# legato version
18.10.3_0b50331a9f4d0ecc0fd816c2a1300436_modified

ati3
Manufacturer: Sierra Wireless, Incorporated
Model: WP7605
Revision: SWI9X07Y_02.18.05.00 000000 jenkins 2018/07/19 17:40:21
IMEI: 353532100002653
IMEI SV: 5
FSN: 2A904570501003
+GCAP: +CGSM

OK

ati8
Legato Ver: 18.10.3_0b50331a9f4d0ecc0fd816c2a1300436_modified
Yocto Ver: SWI9X07Y_02.25.02.01 2019-01-30_09:57:36
OS Ver: Linux version 3.18.122 (jenkins@jenkins) (gcc version 6.2.0 (GCC) ) #2 9
LK Ver: SWI9X07Y_02.25.02.01
RootFS Ver: SWI9X07Y_02.25.02.01 2019-01-30_09:57:36
UserFS Ver: unknown
MCU Ver: unknown

OK

Tanoue-san (@tanoue )

For double check ,
which do you need ,“Read procedure” or “Write Procedure” of UART pins?
On top of this thread,you asked how to “Read” pin state but it seems that you and jyijyi are talking about “Write Procedure” of UART pins.

I’d like to know your goal.

Thank you.

–TAK

I have tried to set DTR as input GPIO by “echo in > /sys/class/gpio/gpio101/direction”, after that it can read the pin status by "cat /sys/class/gpio/gpio101/value ".

HI jyijyi

Thanks for your comment.
I tried you point as follows but permission error was happened.

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

Then, I tried following but still error was happened.
(Refered to here: https://www.raspberrypi.org/forums/viewtopic.php?f=5&t=5185#p68739)

root@swi-mdm9x28-wp:~# echo “1” |sudo tee /sys/class/gpio/export
-sh: sudo: not found

Could you tell me how to set this one?

Thank you.

–TAK

please see the history above.
You need to update the yocto image on top of R12:

Hi jyijyi

Got it!
It works as follows.

—Write operation

root@swi-mdm9x28-wp:~# echo 101 > /sys/class/gpio/export
root@swi-mdm9x28-wp:~# echo out > /sys/class/gpio/gpio101/direction

root@swi-mdm9x28-wp:~# echo 1 > /sys/class/gpio/gpio101/value
=> Measured #11 pin of CN600 then it was 1.8V

root@swi-mdm9x28-wp:~# echo 0 > /sys/class/gpio/gpio101/value
=> Measured #11 pin of CN600 then it was 0V

—Read Operaiton
root@swi-mdm9x28-wp:~# echo in > /sys/class/gpio/gpio101/direction
root@swi-mdm9x28-wp:~# cat /sys/class/gpio/gpio101/value
1

=>Connect #11 pin to GND(There is on CN1500)
root@swi-mdm9x28-wp:~# cat /sys/class/gpio/gpio101/value
0

Thank you.

–TAK

Hi, ijyijy

What about following?

In order to check UART on mangOH green, which interface in /dev should I set? >Currently, I set “ttyHS0” but it seems not to work.

In some case, the customer needs to use ioctl so I’d like to know it.

Thank you.

–TAK

does customer accept to use GPIO as workaround?
I tried ioctl() to read the status of DTR/DSR/DCD, it is not working either.

Goto-san (@TAK_G )

I need “Read procedure” and “Write Procedure” of UART pins.

My goal is to check hardware check on our board with loopback wiring.

In summary, (using as DCE)
Read pin : RTS, DTR, DCD, RI, TxD
Write pin : CTS, DSR, RxD

BR,
Tanoue

Hi jyijyi,

First of all,I’d like to ask simple question.

Is it possible that they can read these pin state with your suggested ways(GPIO) while they use UART as 8-wire UART(such as enabling Hardware flow control) ?
In this case, the customer will not control RTS,CTS,DSR and DTR manually as GPIO by “echo/cat”.

Thank you.

–TAK

To set RI pin as input pin:

  1. you need to first send an AT command: AT!RIOWNER=1
  2. after that you can control the RI in linux console:
    echo RI > /sys/class/gpio/export
    echo in > /sys/class/gpio/gpioRI/direction
    cat /sys/class/gpio/gpioRI/value

In addition, I found that you can read the RTS pin status by AT command:
AT!entercnd=“A710”
AT!bsgpio?6

For setting the CTS pin, you can use ioctl():

	 int arg;
	 if (ioctl(fd1, TIOCMGET, &arg) == -1)
	 {
	 	LE_DEBUG("ERROR: %s", strerror(errno));
	 }

	 if (level)
		  arg |= TIOCM_RTS;
	   else
	   	  arg &= ~TIOCM_RTS;

	  if (ioctl(fd1, TIOCMSET, &arg) == -1) {
	    		LE_DEBUG("ERROR: %s", strerror(errno));
	      }

Hi jyijyi,

Since I’m a little bit confusing, please provide your answer for my question first.

Is it possible that they can read these pin state with your suggested ways(GPIO) while they use UART as 8-wire UART(such as enabling Hardware flow control) ? In this case, the customer will not control RTS,CTS,DSR and DTR manually as GPIO by “echo/cat”. >In addition, I found that you can read the RTS pin status by AT command: >AT!entercnd=“A710” >AT!bsgpio?6

The customer needs to read UART pins via Linux, not external host.
So, AT commands is not useful.

For setting the CTS pin, you can use ioctl():
I copied you suggestion in my source code as follows.
test_helloComponent.c (1.6 KB)

Then, following error was happened.

/root/legato/workspace/test_hello/test_helloComponent/test_helloComponent.c:30:18: error: ‘fd1’ undeclared (first use in this function)

You did not call open(fd,) with serial port dev name so it did not work.

Thank you.

–TAK

For your code, Of course you need to call open() before ioctl().

For entering AT command in legato application, you can send AT command through /dev/ttyAT port inside the application to get the result.

For the first question, I have tried controlling dtr dsr dcd ri via console (gpio) during uart communication with hardware flow control.