FX30S CTS Serial signal not working in latest version

Hi all,

I recently received new FX30S (part number: 1105032) and I’m having problems with the CTS signal.

I’m using the UART1 in Application mode (AT!MAPUART=17,1)

The previous FX30S version I have work fine, but on the new one the CTS signal stays low.

Here’s the version I’m working with:

ati
Manufacturer: Sierra Wireless, Incorporated
Model: FX30S(WP7702)
Revision: SWI9X06Y_02.36.08.09 c094f4 jenkins 2022/06/24 03:14:28
IMEI: 354723090951848
IMEI SV: 8
FSN: AT325475950110
+GCAP: +CGSM

ati8
Legato Ver: 21.05.0.54b96444_0a6e18078edde5151619cb964564694d
Yocto Ver: SWI9X06Y_03.00.13.00 2022-12-28_08:23:43
OS Ver: Linux version 4.14.253 (oe-user@oe-host) ( gcc version 9.3.0 (GCC), GNU ld (GNU Binutils) 2.34.0.20200220) #1 PREEMPT Wed Dec 28 07:40:21 U TC 2022
LK Ver: 1.3.0_1aea4d8ec8
RootFS Ver: SWI9X06Y_03.00.13.00 2022-12-28_08:23:43
UserFS Ver: unknown
MCU Ver: 002.015

Here’s my code where I configure the UART1

int OpenPort(const char* port)
{
LE_INFO(“OpenPort: Opening serial %s”, port);
int fd=open(port, O_RDWR | O_NOCTTY | O_NDELAY);
if(fd==-1)
{
LE_INFO(“Error opening serial port %s… exiting”, port);
exit(-1);
}
fcntl(fd, F_SETFL, 0); /* Reads will be blocking /
struct termios options;
tcgetattr(fd, &options);
(void)cfsetispeed(&options, B38400); /
(void) is to stop warning in cygwin /
(void)cfsetospeed(&options, B38400);
options.c_cflag |= CRTSCTS; /
HW flow control on /
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8; /
8 bits /
options.c_cflag &= ~CSTOPB; /
1 stop bit /
options.c_cflag &= ~PARENB; /
no parity /
options.c_cflag &= ~PARODD;
options.c_lflag =0; /
RAW input /
options.c_iflag = 0; /
SW flow control off, no parity checks etc /
options.c_oflag &= ~OPOST; /
RAW output /
options.c_cc[VTIME]=1; /
.5 sec */
options.c_cc[VMIN]=200;
options.c_cflag |= (CLOCAL | CREAD);
tcsetattr(fd, TCSAFLUSH, &options);
return fd;
}

Like I mentioned, this works fine on the older FX30S (PN:1104087), but not on the new ones I got.
Any thoughts?

Any help is appreciated! Thanks!

Eddie

Are you using same FW among OK SKU and NOK SKU?

Is it Ok to do UART1 data transfer in SKU 1105032?

Are you able to control the CTS pin by ioctl() in OK SKU and NOK SKU?

You can refer to this application (function tmrHandler() ) to control CTS pin:

JyiJyi,

The firmware is different between the old and the new.

The old is: Release R14.1.1.002 + Legato 19.11.5
And the new is: Release R15.1.0.004 + Legato 21.05.0

I tried the code you suggested, but no success. Here’s the logs:

Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c app_Create() 3376 | Creating app 'UART_Test1'
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | proc.c GetFaultAction() 325 | No fault action specified for process 'uart'. Assuming 'ignore'.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c app_Start() 3589 | Starting app 'UART_Test1'
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c CreateFileLink() 2202 | Skipping file link '/legato/systems/current/apps/UART_Test1/read-only/lib/libComponent_UART_Test1Component.so' to '/legato/systems/current/appsWriteable
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c CreateFileLink() 2202 | Skipping file link '/legato/systems/current/apps/UART_Test1/read-only/bin/uart' to '/legato/systems/current/appsWriteable/UART_Test1/bin/uart': Already
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c CreateFileLink() 2272 | Created file link '/dev/ttyMSM0' to '/legato/systems/current/appsWriteable/UART_Test1/dev/ttyMSM0'.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | resourceLimits.c GetCfgResourceLimit() 206 | Configured resource limit maxStackBytes is not available.  Using the default value 0.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | proc.c proc_Start() 1419 | Starting process 'uart' with pid 2717
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | supervisor.c SigChildHandler() 885 | Reaping unconfigured child process 2714.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | proc.c proc_Start() 1379 | Execing 'uart'
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxCoreDumpFileBytes to value 524288.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileBytes to value 524288.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxLockedMemoryBytes to value 8192.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileDescriptors to value 256.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxMQueueBytes to value 512.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxThreads to value 20.
Feb  7 17:18:33 fx30s user.info Legato:  INFO | supervisor[2717]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxQueuedSignals to value 100.
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | _UNKNOWN_[2717]/framework T=main | mem.c InitPool() 402 | Memory pool name 'framework.PositionalCallbackRecPool' is truncated to 'framework.PositionalCallbackRec'
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | _UNKNOWN_[2717]/framework T=main | mem.c InitPool() 402 | Memory pool name 'framework.MessagingClientInterfaces' is truncated to 'framework.MessagingClientInterf'
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | _UNKNOWN_[2717]/framework T=main | mem.c InitPool() 402 | Memory pool name 'framework.hashMap_MessagingServices' is truncated to 'framework.hashMap_MessagingServ'
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | _UNKNOWN_[2717]/framework T=main | mem.c InitPool() 402 | Memory pool name 'framework.hashMap_MessagingClients' is truncated to 'framework.hashMap_MessagingClie'
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | _UNKNOWN_[2717]/framework T=main | fs.c fs_Init() 907 | FS prefix path "/data/le_fs/"
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | _UNKNOWN_[2717]/<invalid> T=main | _componentMain.c _UART_Test1Component_Init() 30 | Initializing UART_Test1Component component library.
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | uart[2717]/framework T=main | mem.c InitPool() 402 | Memory pool name 'framework.msgs-LogControlProtocol' is truncated to 'framework.msgs-LogControlProtoc'
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | uart[2717]/framework T=main | messagingSession.c le_msg_SetSessionRecvHandler() 2077 | SetSessionRecv: Unix socket session
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | uart[2717]/framework T=main | mem.c le_mem_ForceAlloc() 1183 | Memory pool 'framework.SigMonitor' overflowed. Expanded to 1 blocks.
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | uart[2717]/framework T=main | mem.c le_mem_ForceAlloc() 1183 | Memory pool 'framework.SigHandler' overflowed. Expanded to 1 blocks.
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | uart[2717]/uart_exe T=main | _main.c main() 59 | == Starting Event Processing Loop ==
Feb  7 17:18:33 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c _UART_Test1Component_COMPONENT_INIT() 234 | UART_TCP_DEMO
Feb  7 17:18:33 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c OpenPort() 61 | Opening serial /dev/ttyMSM0^M
Feb  7 17:18:33 fx30s user.debug Legato:  DBUG | uart[2717]/framework T=main | timer.c fa_timer_Start() 384 | localThreadRecPtr->timerFD=9
Feb  7 17:18:36 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:36 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:36 fx30s user.info kernel: [  370.435962] uart_tiocmget(), state->uart_port->mctrl=0x0004.
Feb  7 17:18:36 fx30s user.info kernel: [  370.436439] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:36 fx30s user.info kernel: [  370.436457] tty_tiocmset(): set=0x0000, val=0x0160, clear=0xE006.
Feb  7 17:18:36 fx30s user.info kernel: [  370.436472] uart_tiocmset: state->uart_port->mctrl=0x0004, set=0x0000, clear=0xE006
Feb  7 17:18:36 fx30s user.err kernel: [  370.436640] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:36 fx30s user.err kernel: [  370.437103] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:37 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:39 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:39 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:39 fx30s user.info kernel: [  373.534671] uart_tiocmget(), state->uart_port->mctrl=0x0000.
Feb  7 17:18:39 fx30s user.info kernel: [  373.534960] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:39 fx30s user.info kernel: [  373.534977] tty_tiocmset(): set=0x0004, val=0x0164, clear=0xE002.
Feb  7 17:18:39 fx30s user.info kernel: [  373.534993] uart_tiocmset: state->uart_port->mctrl=0x0000, set=0x0004, clear=0xE002
Feb  7 17:18:39 fx30s user.err kernel: [  373.535159] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:39 fx30s user.err kernel: [  373.535402] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:40 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:42 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:42 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:42 fx30s user.info kernel: [  376.635385] uart_tiocmget(), state->uart_port->mctrl=0x0004.
Feb  7 17:18:42 fx30s user.info kernel: [  376.635672] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:42 fx30s user.info kernel: [  376.635689] tty_tiocmset(): set=0x0000, val=0x0160, clear=0xE006.
Feb  7 17:18:42 fx30s user.info kernel: [  376.635705] uart_tiocmset: state->uart_port->mctrl=0x0004, set=0x0000, clear=0xE006
Feb  7 17:18:42 fx30s user.err kernel: [  376.635871] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:42 fx30s user.err kernel: [  376.636112] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:43 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:45 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:45 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:45 fx30s user.info kernel: [  379.735386] uart_tiocmget(), state->uart_port->mctrl=0x0000.
Feb  7 17:18:45 fx30s user.info kernel: [  379.735674] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:45 fx30s user.info kernel: [  379.735692] tty_tiocmset(): set=0x0004, val=0x0164, clear=0xE002.
Feb  7 17:18:45 fx30s user.info kernel: [  379.735708] uart_tiocmset: state->uart_port->mctrl=0x0000, set=0x0004, clear=0xE002
Feb  7 17:18:45 fx30s user.err kernel: [  379.735875] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:45 fx30s user.err kernel: [  379.736117] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:46 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:48 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:48 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:48 fx30s user.info kernel: [  382.835391] uart_tiocmget(), state->uart_port->mctrl=0x0004.
Feb  7 17:18:48 fx30s user.info kernel: [  382.835681] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:48 fx30s user.info kernel: [  382.835698] tty_tiocmset(): set=0x0000, val=0x0160, clear=0xE006.
Feb  7 17:18:48 fx30s user.info kernel: [  382.835714] uart_tiocmset: state->uart_port->mctrl=0x0004, set=0x0000, clear=0xE006
Feb  7 17:18:48 fx30s user.err kernel: [  382.835882] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:48 fx30s user.err kernel: [  382.836122] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:49 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:51 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:51 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:51 fx30s user.info kernel: [  385.935389] uart_tiocmget(), state->uart_port->mctrl=0x0000.
Feb  7 17:18:51 fx30s user.info kernel: [  385.935678] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:51 fx30s user.info kernel: [  385.935696] tty_tiocmset(): set=0x0004, val=0x0164, clear=0xE002.
Feb  7 17:18:51 fx30s user.info kernel: [  385.935711] uart_tiocmset: state->uart_port->mctrl=0x0000, set=0x0004, clear=0xE002
Feb  7 17:18:51 fx30s user.err kernel: [  385.935879] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:51 fx30s user.err kernel: [  385.936119] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:52 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:54 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c tmrHandler() 202 | arg=0x164 ,CTS = 32, RTS = 4, DSR = 256, DTR = 0 DCD =64
Feb  7 17:18:54 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 138 | wrote  30
Feb  7 17:18:54 fx30s user.info kernel: [  389.035391] uart_tiocmget(), state->uart_port->mctrl=0x0004.
Feb  7 17:18:54 fx30s user.info kernel: [  389.035680] tty_tiocmset: UART 2 is NOT Linux APP
Feb  7 17:18:54 fx30s user.info kernel: [  389.035698] tty_tiocmset(): set=0x0000, val=0x0160, clear=0xE006.
Feb  7 17:18:54 fx30s user.info kernel: [  389.035714] uart_tiocmset: state->uart_port->mctrl=0x0004, set=0x0000, clear=0xE006
Feb  7 17:18:54 fx30s user.err kernel: [  389.035877] [smd_pkt_ioctl]: unrecognized ioctl command 0x5402
Feb  7 17:18:54 fx30s user.err kernel: [  389.036117] [smd_pkt_ioctl]: unrecognized ioctl command 0x5409
Feb  7 17:18:56 fx30s user.info Legato:  INFO | uart[2717]/UART_Test1Component T=main | UART_Test1.c get_RTS_status() 177 | RTS =1
Feb  7 17:18:56 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c app_Stop() 3714 | Stopping app 'UART_Test1'
Feb  7 17:18:56 fx30s user.crit Legato: *CRT* | uart[2717]/framework T=main | signals.c TermSignalHandler() 449 | Terminated
Feb  7 17:18:56 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | app.c app_StopComplete() 4881 | app 'UART_Test1' has stopped.
Feb  7 17:18:56 fx30s user.info Legato:  INFO | supervisor[1259]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application 'UART_Test1' has stopped.

Like I mentioned before, my same code works perfectly in the previous FX30S version but not in the latest.

I checked the release notes to see if there was any mention of the CTS/RTS signal change and didn’t find any, so I don’t know why the CTS signal is not now coming on high.

Any other thoughts?

Eddie

For FW R15, how about using AT!MAPUART=15,1 ?
a new port /dev/ttyHS0 should be generated

One thing I noticed, and I don’t know if it makes a difference or not, is a change in the serial port name:

In version swi-fx30-catm_3.0.0 (Release R14.1.1.002 + Legato 19.11.5) the serial port is = /dev/ttyHSL0

In version swi-fx30-catm_4.2.0 (Release R15.1.0.004 + Legato 21.05.0) the serial port is = /dev/ttyMSM0

Again, I don’t know if it’s means anything, but I just thought it was worth mentioning.

Eddie

you can see here:

For FW R15, how about using AT!MAPUART=15,1 ?
a new port /dev/ttyHS0 should be generated

I’ll try AT!MAPUART=15,1 and see what I get. Thanks.

Eddie

jyijyi,

I tried using AT!MAPUART=15,1 and it did generate the port /dev/attHS0

I made the changes to my code to use the port /dev/attHS0, complied and uploaded to the modem.

The CTS signal did go high this time, but another problem appeared. In my app, on the modem serial port, I echo the keystrokes to the screen when a key is pressed. If I press any keys continuously, they echo as expected. If I pause for 6 seconds or more, the first keystroke immediately after the pause does not register at all. This happens consistently every time I pause for more than 6 seconds.

The same app/code using the port /dev/ttyMSMO does not have this problem. Only the CTS signal problem.

Any thoughts?

Thanks!

Eddie

probably the UART port goes to sleep mode.
you can see here:

either you can try to set -1 to “autosuspend_delay_ms”
Or you can use a timer to periodically wake up the UART in the program by tcflow()

jyijyi,

The command echo -1 > /sys/devices/platform/78b0000.uart/power/autosuspend_delay_ms worked!

I would like to have my app handle this. I’m looking in power manager but not finding how to accomplish this.

Do you know how I can change the value of autosuspend_delay_ms within my code? Thanks!

Eddie

You can run an unsandboxed legato app to call system() api

Do you know of any sample code I could look at? I have no clue of how to implement outside of typing it in on the command line, and I just confirmed that it defaults back after bootup, so that means I need to set it every time I power the modem up.

Eddie

you can see this application hello6:

1 Like