Issue with UART Shell mode

I am unable to send any commands with a space to the DWM1001 Dev kit when using echo from the terminal or from a C program. For instance via the terminal I try this:

$ echo -ne “?\r” > /dev/ttyS23
$ cat /dev/ttyS23

$ echo -ne “\r\r” > /dev/ttyS23
$ cat /dev/ttyS23

DWM1001 TWR Real Time Location System

Copyright : 2016-2017 LEAPS and Decawave
License : Please visit
Compiled : Nov 29 2017 13:35:02

Help : ? or help


So I can successfully go into the Shell mode, but once I try a command I see this:

$ echo -ne “tlx 8 0\r” > /dev/ttyS23
$ cat /dev/ttyS23
tlx 8

So it seems to be cutting off my command as soon as I add a space to it for some reason. I found this workaround from the terminal that works:

$ echo -ne "tlx 8 " > /dev/ttyS23
$ echo -ne “0\r” > /dev/ttyS23
$ cat /dev/ttyS23
40 01 00 46 02 59 04

The issue now is that I am trying work with Shell mode from a C program, but this work around does not work there. I’m not sure why the device is doing this. Here is a snippet of my write command:

printf("========== DWM10001 - write port ==========\n");
memset(tx_buffer, 0, MAX_BUFFER_SIZE);
//strcpy(tx_buffer, “ps\r”);
strcpy(tx_buffer, “tlx 08 00\r”);
//strcpy(tx_buffer, "tlx 08 ");
//strcat(tx_buffer, “00\r”);

printf(“tx_buffer: %s\n”, tx_buffer);
cmd_len = strlen(tx_buffer);
result = write_port(uwb_fd, tx_buffer, cmd_len);
printf(“result: %d\n”, result);

My program output is:

========== DWM10001 - write port ==========
tx_buffer: tlx 08 00
result: 10
========== DWM10001 - read port ==========
result: 6
rx_buffer: tlx 08

I would like to add that I can successfully execute any command via Putty. I’ve tried to match the serial port settings to what is in the hal_uart.c file, but still not working. Thanks for the help.

shell is intended to be used with human and not with software. So in some previous thread is recommended to add cca 10ms delay between characters.