Thingy91X UART Shell drops characters at 921600

We have noticed an issue with received characters being dropped on the UART shell interface.  Originally, we found the issue using our own application, but subsequently we duplicated it using the modem shell sample application.

1.  The problem only occurs with baud rate 921600.  It does not happen using 115200.

2.  The problem only occurs on the Thingy91x.  It does not happen when using the nRF9151DK.

3.  The problem is not present using v2.8-branch version of the modem_shell application.  It is present using the v3.1.0 version of this application.

4.  The problem does not occur if we set `CONFIG_LOG=n` in the `prj.conf` file.  This is similar to the problem reported here:  UARTE1 at 921600 baud rate doesn't receive more than 5 bytes if CONFIG_LOG is enabled. However, in our case we can receive more than just 5 characters, we just have occasional lost characters.

To duplicate the problem, I built the nrf/samples/cellular/modem_shell application with the v3.1.0 tag of NCS:

# Checkout the NCS repo:
cd <ncs folder>
git checkout v3.1.0
HEAD is now at 6c6e5b3249 manifest: Tag v3.1.0

west update
    <completes successfully>

source ../zephyr/zephyr-env.sh

# Build the modem_shell application
cd samples/cellular/modem_shell/
west build -p -b "thingy91x/nrf9151/ns"

# program the thingy91x (we have an external debugger connected to it)
west flash --erase



Using a terminal emulator connected to the thingy91x (we use minicom on /dev/ttyACM0 at 115200), we can observe the problem by setting the UART to 921600 and copy/paste a long command into the shell:

*** Booting nRF Connect SDK v3.1.0-6c6e5b32496e ***
*** Using Zephyr OS v4.1.99-1612683d4010 ***

Reset reason: PIN reset

MOSH version: v3.1.0-6c6e5b32496e
MOSH build id: custom
MOSH build variant: dev
Modem FW version: mfw_nrf91x1_2.0.2
Modem FW UUID: 320176d5-9f40-45fc-923b-2661ec18d547


Network registration status: searching

    <extra prints deleted>

IPv4 MTU: 1428
IPv4 address: 100.75.70.88
IPv6 address: ::
IPv4 DNS address: 198.224.182.135, 198.224.183.135
IPv6 DNS address: ::, ::
RRC mode: Idle
mosh:~$


We can see the problem does not occur with the default 115200 baud rate by pasting a long command into the shell:

mosh:~$ shell backspace_mode delete
mosh:~$ shell backspace_mode delete
mosh:~$ shell backspace_mode delete
mosh:~$ shell backspace_mode delete
mosh:~$ shell backspace_mode delete
mosh:~$ shell backspace_mode delete

Each command appears normally in the shell.

Now we set the UART to 921600 baud and try again:

mosh:~$ uart baudrate 921600

    <reconnect minicom with 921600 baud>

mosh:~$ shell backspace_mode delete
mosh:~$ shell backspace_mode delee
backspace_mode - Toggle backspace key mode.
Some terminals are not sending separate escape code for backspace and delete button. This command forces shell to interpret delete key as
backspace.
Subcommands:
backspace : Set different escape code for backspace and delete key.
delete : Set the same escape code for backspace and delete key.


In the above, we see that the second time the shell backspace_mode delete is pasted into the window, it drops the t character in delete.

Parents Reply
  • Hi Hakon,

    I tried the Nordic Serial Terminal (v1.6.0) with the Thingy91X and I was not able to get it to work.  It has the same problem as with minicom and picocom, I cannot send characters to the Thingy shell.  I confirmed that the same software build for the `nrf9151DK` works correctly with all three terminal emulation programs (minicom, picocom and Nordic Serial Terminal).

    We have changed our development configuration to only use 115200 baud to work around the dropped characters.  I think the lack of flow control on this port causes the problem at 921600 baud, but I do not know why we did not observer it with earlier releases of NCS.

    Today I tried NCS v3.2.1 and found that the Thingy91X problem no longer occurs with any of the three terminal emulation programs.

Children
No Data
Related