How to add adef device for WP76 UART2

Hi,

My app doesn’t start anymore, since I recently updated my WP76 form Sierra Firmware R9 towards R12.
I discovered that R12 uses a different ttyHS device for the UARTs: UART2 now uses ttyHS1 iso ttyHSL1.
(see WP76 UART2 uses different tty device since Firmware R12 - IoT Modules - Sierra Wireless Forum)

Can I add something to my application sources (.adef file?), so, that it can be compatible for both R9 and R12 firmware?

requires:
{
device:
{
[rw] /dev/ttyHS0 /dev/ttyHS0
[rw] /dev/ttyHSL1 /dev/ttyHSL1 // /dev/ttyHS1 for firmware R12
}
}

Greetings,

annaertd

in R12, you can run the following command to create a link to /dev/ttyHS1.

ln /dev/ttyHS1 /dev/ttyHSL1

What do you mean with ‘command’?
Can I use ‘in’ in the SSH terminal, or, should I put it in a script file?

I expected a run-time check on the Linux version, at startup, so, that my app can decide which tty device is needed.

you can use use “ln” in both ssh terminal or script file.

On 4 chips WP76 reset using “swiflash -m WP76XX -i reset.cwe”,
UART2 is not enumerated equally:

  • ttyHSL1 on 2 of them as expected,
  • ttyHS1 on the 2 other.

A release upgrade does not fix the problem: the good/bad enumartion remains (R12, R16).

dmesg just says that the uart device is already used when trying to assign ttyHSL1 passed on the kernel command line.

Why ?

How to fix that (using a ln command for instance) before app startup?

--------- TRACES ----------
— ttyHSL1 NOK on WP76 running R12 —

root@swi-mdm9x28-wp:~# fwupdate query
Connecting to service …
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
Linux Version: 3.18.122 #2 PREEMPT Wed Aug 11 07:49:22 UTC 2021
root@swi-mdm9x28-wp:~# uname -a
Linux swi-mdm9x28-wp 3.18.122 #2 PREEMPT Wed Aug 11 07:49:22 UTC 2021 armv7l GNU/Linux
root@swi-mdm9x28-wp:~# legato version
18.10.3_0b50331a9f4d0ecc0fd816c2a1300436
root@swi-mdm9x28-wp:~# cat /sys/devices/platform/msm_serial_hs*/config
APP
APP
DISABLED
DISABLED
root@swi-mdm9x28-wp:~#

– and after swiflash -m WP76XX -i Generic_R16 –
— ttyHSL1 NOK on WP76 running R16 —

root@swi-mdm9x28-wp:~# legato version
19.11.2_4ad011d85a76309438be40fc19e7153a
root@swi-mdm9x28-wp:~# fwupdate query
Connecting to service …
Firmware Version: SWI9X07Y_02.37.03.00 73df45 jenkins 2020/04/08 10:59:14
Bootloader Version: SWI9X07Y_02.37.03.00 73df45 jenkins 2020/04/08 10:59:14
Linux Version: 3.18.140 #1 PREEMPT Tue Aug 3 08:17:34 UTC 2021
root@swi-mdm9x28-wp:~# uname -a
Linux swi-mdm9x28-wp 3.18.140 #1 PREEMPT Tue Aug 3 08:17:34 UTC 2021 armv7l GNU/Linux
root@swi-mdm9x28-wp:~# ll /dev/ttyHS*
crw-rw---- 1 root dialout 248, 0 Jan 1 1970 /dev/ttyHS0
crw–w---- 1 root root 248, 1 Jan 1 1970 /dev/ttyHS1
root@swi-mdm9x28-wp:~# cat /sys/devices/platform/msm_serial_hs*/config
APP
APP
DISABLED
DISABLED

— ttyHSL1 OK on WP76 running R16 (another chip) —
root@swi-mdm9x28-wp:~# fwupdate query
Connecting to service …
Firmware Version: SWI9X07Y_02.37.03.00 73df45 jenkins 2020/04/08 10:59:14
Bootloader Version: SWI9X07Y_02.37.03.00 73df45 jenkins 2020/04/08 10:59:14
Linux Version: 3.18.140 #1 PREEMPT Tue Aug 3 08:17:34 UTC 2021
root@swi-mdm9x28-wp:~# legato version
19.11.2_4ad011d85a76309438be40fc19e7153a
root@swi-mdm9x28-wp:~# uname -a
Linux swi-mdm9x28-wp 3.18.140 #1 PREEMPT Tue Aug 3 08:17:34 UTC 2021 armv7l GNU/Linux
root@swi-mdm9x28-wp:~# ll /sys/devices/platform/msm_serial_hs*
lrwxrwxrwx 1 root root 0 Jan 6 00:10 /sys/devices/platform/msm_serial_hs.0 → …/78b0000.uart
lrwxrwxrwx 1 root root 0 Jan 6 00:10 /sys/devices/platform/msm_serial_hs.1 → …/78af000.uart
lrwxrwxrwx 1 root root 0 Jan 6 00:12 /sys/devices/platform/msm_serial_hsl.0 → …/78b0000.serial
lrwxrwxrwx 1 root root 0 Jan 6 00:10 /sys/devices/platform/msm_serial_hsl.1 → …/78af000.serial
root@swi-mdm9x28-wp:~# cat /sys/devices/platform/msm_serial_hs*/config
AT
UNAVAILABLE
DISABLED
CONSOLE
root@swi-mdm9x28-wp:~# ll /dev/ttyHS*
crw-rw---- 1 root dialout 248, 0 Jan 1 1970 /dev/ttyHS0
crw–w---- 1 root root 247, 1 Jan 6 00:10 /dev/ttyHSL1

Did you compare the at!mapuart? In these four modules while in same firmware?

Problem solved: ttyHS1 instead of ttyHSL1 in releases >= R12.

Just to be sure, I did again a downgrade R12, reset WP76, upgrade R16, and finally update app (using ttyHS1), and all 4 modules were OK.
I can’t figure out how I came to have R16 running with ttyHSL1 (this was my dev module). An overlay masking R10 maybe ???

Tnahks anyway jyijyi.

Hello,
The problem fired again.
when the modules come from the factory they are

/dev/ttyHSL1 - AT DISABLED CONSOLE - !MAPUART: 1,16
Linux swi-mdm9x28-wp 3.18.44 #2 PREEMPT Thu Sep 20 16:20:02 UTC 2018 armv7l GNU/Linux
18.06.3_dc55d84226223a3798b01c1a272e9603
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
Linux Version: 3.18.44 #2 PREEMPT Thu Sep 20 16:20:02 UTC 2018

I have a script that reflash them automatically: R12 + reset + R16 + update

after that process, most modules are in ttyHS1

/dev/ttyHS1 - APP APP DISABLED DISABLED  - !MAPUART: 17,17
Firmware Version: SWI9X07Y_02.37.03.00 73df45 jenkins 2020/04/08 10:59:14
Bootloader Version: SWI9X07Y_02.37.03.00 73df45 jenkins 2020/04/08 10:59:14
Linux Version: 3.18.140 #1 PREEMPT Tue Aug 3 08:17:34 UTC 2021

BUT some modules stay in ttyHSL1:
/dev/ttyHSL1 - AT UNAVAILABLE DISABLED CONSOLE - !MAPUART: 1,16
Linux swi-mdm9x28-wp 3.18.140 #1 PREEMPT Tue Aug 3 08:17:34 UTC 2021 armv7l GNU/Linux
19.11.2_dbd1716614d095b4e250418340ae1afa

a reboot or BOR doesn’t fix the problem

a full reflash R12…R16…update however fixes the problem…

What am I wrong ?

How can we still have ttyHSL1 with R16 ???

Thanks

ttyHS1 is for module setting to 17 for UART2 where most of your modules are having !MAPUART: 17,17

ttyHSL1 is for module setting to 16 for UART2 where some of your problematic modules are having !MAPUART: 1,16

so probably your problematic modules are not setting the AT!MAPUART properly.