This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Issues with shell not echoing / buffering input characters

Greetings.

We are using the zigbee/shell sample in order to verify the connectivity of some other devices running the zigbee stack. While the shell sample had no issues in the past (circa tag v1.8.0) now we see a odd behavior in which the characters inputted in the terminal emulator (gtkterm) appear "delayed" by one character. We tried rolling back to v1.8.0 as were using the 1.9.1 tag in case that was the issue but the problem persisted. As such we do not fully know if the problem resides in the sdk, zephyr or our machine

As an example:


-checkout v1.8.0


-download shell sample


-open gtkterm and connnect to tty/ACM0


-press reset button on the board, board sends the opening message (*** Booting Zephyr OS build v2.7.99-ncs1-1  *** followed by  uart:~$ )


-press the "a" key, the character "a" appears on the screen


-press the "b" key, the character "a" appears on the screen


-press the "c" key, the character "b" appears on the screen


-press the "enter" key, the character "c" appears on the screen


-press the "d" key, the "enter" is parsed and the device replies with "aabc: command not found"

-press the "e" key, the character "d" appears on the screen

And so on and so forth, this makes it very difficult to employ the shell sample for verifying our devices.

Parents
  • Hi,

    I have started looking into your issue and will come back to you tomorrow.

    Best regards,

    Marte

  • Hi,

    I have tried to reproduce your issue, but I have not been able to so far. Have you made any changes to the sample or any library or driver files used by the sample? Have you tested using a different DK and/or different terminal, i.e. PuTTY?

    Best regards,

    Marte

  • Hi,

    I have discussed this with a colleague who have seen a similar issue on Linux in the past. However, in their case the problem was with the computer, as they saw the same issue with different devices (from other producers) and only on their computer. I do have some suggestions for things to try and test out, so hopefully one of them will help, or will at least narrow down the issue.

    First, I have seen reports of similar behavior with other devices on Linux. In one of those cases using miniterm solved the issue. It seemed to be related to stty settings, so running stty on the port when you have the port open in different terminal emulators might give you some information, e.g:

    stty -F /dev/ttyACM0

    The settings used by miniterm and not by the terminal emulators causing issues were the following:

    -echoke -echoctl -ignbrk brkint -onlcr

    I see all of these settings when I check on my side. So please check with miniterm, and check the stty settings.

    To further narrow it down if the above does not work, can you try the following things?

    • Test the DK on another computer
    • Test with another device on your computer if you see the same lag there
    • Test with different cables

    Please also check what version of nrfjprog and JLink you have installed. You can find this by running

    nrfjprog -v

    Best regards,

    Marte

  • Hi.

    I have rebuilt the shell project removing the additions to the proj.conf file for RTT, and also cleaned the build directory when opening the project (so to return to the "pre-rtt" state for lack of better terminology).

    Opening gtkterm and running the command i see the following 

    speed 115200 baud; line = 0;
    min = 1; time = 0;
    ignbrk -brkint -icrnl -imaxbel
    -opost -onlcr
    -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

    without gtkterm running i see 

    speed 9600 baud; line = 0;
    -brkint -imaxbel

    running miniterm i see a similar problem where the latest character is not properly displayed, stty gives this info

    speed 115200 baud; line = 0;
    min = 0; time = 0;
    -brkint -icrnl -imaxbel
    -opost -onlcr
    -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

    The issue presented itself even on another computer running the same version of Ubuntu

    I already tried different cables but the issue persisted even there

    nrfjprog -v gives the following

    nrfjprog version: 10.15.1 external
    JLinkARM.dll version: 7.60c

  • Hi,

    Please try updating to the latest version of nRF Command Line Tools (nrfjprog), v10.15.4. You can find the download here: https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download#infotabs. Also try downgrading to v7.58b of JLink, since that is the version bundled with this version of nRF Command Line tools, and thus the version it has been tested with.

    Have you tried programming the DKs with another computer?

    Can you also try using the nRF USB on the DK instead of using the USB for the onboard debugger, to see if the issue might be because of the interface MCU? For this you will need to make changes to the sample so that the shell uses USB instead of UART. I have already done this, so you can simply program the file zephyr_usb.hex to your DK, but I will also upload the project as a zip-folder. After programming the device, move the USB cable from the interface MCU USB to nRF USB on the side of the DK. The device should show up as a USB serial device or Zephyr Zigbee shell, and you can connect to it using GTKTerm as normal.

    Best regards,

    Marte

  • Hi.

    We had not tried to program the DK with another computer.
    Furthermore, after updating nrfjprog, downgrading jlink and trying on the DK's USB with the project you've given us, the problem does not appear to present itself (although it took a couple presses of the reset button before gtkterm stopped appending garbage characters (like "[1;32m" and "^[") after uart:~$, characters that were intepreted by the shell as (obviously incorrect) commands)

    We will try with the updated nrfjprog / downgraded jlink to see if our normal build of the shell sample keeps manifesting such problems, as well with our normal build modified to route the shell output to USB

    Addendum/update: trying to use the shell sample in the nrf SDK with the updated nrfjprog/downgraded jlink still caused the same issue on gtkterm (to note: this is the same sample that originally displayed the problem, i suppose this excludes the possibility of nrfjprog/jlink being the source of the issue?)

    I am attaching a zip file with our shell sample, even though it should be the same as the one in the SDK

  • Hi,

    I have asked my colleagues, but besides the one I mentioned previously no one else has seen this error or are able to reproduce it. 

    Since the issue does not present itself when using nRF USB it might be an issue with the firmware on the interface MCU, so you can try uploading new firmware.

    1. Download the JLink interface MCU firmware from nRF52833 DK > Downloads.
    2. Unplug the DK from the computer.
    3. Hold in the IF BOOT/RESET button on the DK while plugging it in, and keep it pressed until LED5 starts to blink to make the device enter bootloader mode.
    4. The device should show up as BOOTLOADER.
    5. Drag and drop the firmware image into the DK.

    Best regards,

    Marte

Reply
  • Hi,

    I have asked my colleagues, but besides the one I mentioned previously no one else has seen this error or are able to reproduce it. 

    Since the issue does not present itself when using nRF USB it might be an issue with the firmware on the interface MCU, so you can try uploading new firmware.

    1. Download the JLink interface MCU firmware from nRF52833 DK > Downloads.
    2. Unplug the DK from the computer.
    3. Hold in the IF BOOT/RESET button on the DK while plugging it in, and keep it pressed until LED5 starts to blink to make the device enter bootloader mode.
    4. The device should show up as BOOTLOADER.
    5. Drag and drop the firmware image into the DK.

    Best regards,

    Marte

Children
Related