# Can't put UART2 in mode 17 on mangOH (Legato 16.07, WP85)

**URL:** https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198
**Category:** Uncategorized
**Created:** [October 21, 2016, 3:38am UTC](https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198 "2016-10-21T03:38:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hlro1](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hlro1](https://forum.legato.io/u/hlro1)
#### Post date: [October 21, 2016, 3:38am UTC](https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198/1 "2016-10-21T03:38:03Z")

</div>

Hi there,

I am rather new to using Legato and the WP85xx modem, though I am a fairly reasonable user of Embedded Linux.

I SSH into Legato and tried changing UART2 for type 17 (Custom Linux application), but it does not seem to be working. I have a serial connected to the serial port of the mangOH. Here are the steps I took and the results I got:

1. Entered echo -e “AT!MAPUART=17,2” \> /dev/ttyAT
2. Entered reboot
3. Legato shows the shutdown process in the serial terminal and SSH connection is lost
4. Bootup message starts displaying on the serial terminal! The last lines being

**run\_getty.sh: UART2 (=/dev/ttyHSL0) reserved for CONSOLE**

* * *

**Poky (Yocto Project Reference Distro) 1.7.2 swi-mdm9x15 /dev/ttyHSL1**

1. entering dmesg | grep tty returns

[0.000000] Kernel command line: console=ttyHSL0,115200 console=ttyHSL1,115200 fudge\_ro\_rootfs=true rootfs\_ro=true mtdparts=msm\_nand:0x00100000@0x051c0000(bootloader),0x01400000(kernel),0x03140000(rootfs),0x02780000(user0),0x08b80000(user1),0x00500000(user2),0x00200000(user3) androidboot.serialno=MDM9615 lkversion=1.3.0\_a50272dbb2 androidboot.baseband=msm  
[0.209583] msm\_serial\_hsl\_probe: detected port #0 (ttyHSL0)  
[0.209644] msm\_serial\_hsl\_probe: ttyHSL0, function 0, not allowed to control by A5.  
[0.209949] msm\_serial\_hsl\_probe: detected port #1 (ttyHSL1)  
[0.209980] msm\_serial\_hsl\_probe: ttyHSL1 is reserved for CONSOLE service  
[0.210254] msm\_serial\_hsl.1: ttyHSL1 at MMIO 0x16440000 (irq = 186, base\_baud = 460800) is a MSM  
[0.855821] console [ttyHSL1] enabled

Q1) Isn’t ttyHSL0 supposed to be connected to UART1 by default?  
Q2) Why is UART2 still showing the console information?

Q3) If UART2 is correctly operating in mode 17, would printfs be shown here?

A similar question was mentioned at [Mangoh UART communication issue - #4 by rio99](http://forum.legato.io/t/mangoh-uart-communication-issue/221/4) but a suitable answer was not given. Hope to get an answer here.

Thanks a lot.

Royan

---

<div class="post-metadata">

### Author: ![rio99](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@rio99](https://forum.legato.io/u/rio99)
#### Post date: [October 25, 2016, 7:34am UTC](https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198/2 "2016-10-25T07:34:48Z")

</div>

> [@hlro1](#):
>
> echo -e “AT!MAPUART=17,2” \> /dev/ttyAT

Well, `echo -e "AT!MAPUART=17,2" > /dev/ttyAT` didn’t change anything for me neither, before executing any AT command try to connect to ttyAT port:

`microcom -E /dev/ttyAT`

and only then enter AT command, hope it helps.

---

<div class="post-metadata">

### Author: ![hlro1](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hlro1](https://forum.legato.io/u/hlro1)
#### Post date: [October 25, 2016, 10:47am UTC](https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198/3 "2016-10-25T10:47:23Z")

</div>

Hello rio99.

Thanks a lot for your help. Works a treat :). Legato should update their documentation.

Here are the complete steps:

1. enter microcom -E /dev/ttyAT
2. type AT!MAPUART=17,2

or whatever other AT commands.

1. press CTRL-X to exit microcom and return to the command prompt.

Thanks again.

---

<div class="post-metadata">

### Author: ![Kalai](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/kalai/32/1135_2.png) [@Kalai](https://forum.legato.io/u/Kalai)
#### Post date: [August 27, 2021, 12:03pm UTC](https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198/4 "2021-08-27T12:03:11Z")

</div>

how to check ussd code via legato application  
example \*!23# → to check balance.

Any one guide me how to use this

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)
#### Post date: [August 27, 2021, 12:37pm UTC](https://forum.legato.io/t/cant-put-uart2-in-mode-17-on-mangoh-legato-16-07-wp85/2198/5 "2021-08-27T12:37:48Z")

</div>

You can send AT command inside unsandboxed legato application

> **[How to run shell script after boot](https://mangoh.discourse.group/t/how-to-run-shell-script-after-boot/9278/14)**
>
> you can see this document on how to send AT command in unsandboxed legato application: Sending AT command in Legato application.docx (215.2 KB)

Or you can see the sample code to send AT!BSGPIO below via /dev/ttyAT port:

> [@UART flow control with WP7608](https://forum.legato.io/t/uart-flow-control-with-wp7608/4597/47):
>
> I cannot find another way to access RTS and CTS other than my previous suggestion. I think using ioctl() to set CTS is the most proper way and standard way. Currently I have no idea why RTS cannot be read by ioctl(). Below is the code to read the RTS status by AT command, let me know if you accept this. If no, we need a FW fix on this so that we can read RTS status by ioctl(). int get\_RTS\_status() { int fd\_rts; int sel,len,i; int wrote = 0; char \* pch; fd\_set rfds; …
