USB disconnection sleep mode

Hi All,

We have a custom WP7702 board that we are currently building test firmware for. The radio is not yet used, but we have several IO peripherals connected. All is working fine when the USB is connected (logging via ssh connection confirms this). We also have two SPI displays connected which show some information and a few buttons for a GUI.

However, when the USB cable is disconnected, the module seems to go to some sleep state or low power state. The device still works, but key handling and peripheral communication seems slow and irregular. As if the module is going in and out of sleep modes.

Is there a simple way to disable sleep mode of the WP7702 to check if this is the problem?

Best regards,
Frans.

This is a part from the log. This only occurs when USB is disconnected and the module tries to sleep several times per second…

8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.501309] PM: Syncing filesystems … done.
Jan 8 05:00:01 swi-mdm9x28-wp user.debug kernel: [189784.536736] PM: Preparing system for mem sleep
Jan 8 05:00:01 swi-mdm9x28-wp user.info Legato: INFO | ngtpagerservice[841]/NGTPagerServiceComponent T=main | DP6000Codec.c ExtractDP6000Packet() 508 | NGT: ###### receivedHandshakeID: 0
Jan 8 05:00:01 swi-mdm9x28-wp user.info Legato: INFO | ngtpagerservice[841]/NGTPagerServiceComponent T=main | DP6000Codec.c ExtractDP6000Packet() 509 | NGT: ###### receivedApplicationID: 0
Jan 8 05:00:01 swi-mdm9x28-wp user.info Legato: INFO | ngtpagerservice[841]/NGTPagerServiceComponent T=main | DP6000Codec.c ExtractDP6000Packet() 510 | NGT: ###### receivedNumberOfAlphaBlocks: 0
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.565271] Freezing user space processes …
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.571701] PM: Wakeup pending, aborting suspend
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.572320] last active wakeup source: eventpoll
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.572678]
Jan 8 05:00:01 swi-mdm9x28-wp user.err kernel: [189784.572706] Freezing of tasks aborted after 0.007 seconds
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.577463] Restarting tasks … done.
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.586471] sierra_pm_resume
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.586862] Abort: Last active Wakeup Source: eventpoll
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.587347] PM: suspend exit 1980-01-08 05:00:01.090657278 UTC
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.588086] PM: suspend entry 1980-01-08 05:00:01.091404883 UTC
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.588115] PM: Syncing filesystems … done.
Jan 8 05:00:01 swi-mdm9x28-wp user.debug kernel: [189784.618966] PM: Preparing system for mem sleep
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.652882] Freezing user space processes … (elapsed 0.008 seconds) done.
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.661194] Freezing remaining freezable tasks …
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.809012] PM: Wakeup pending, aborting suspend
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.809153] active wakeup source: [timerfd]
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.809367] active wakeup source: [timerfd]
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.809746]
Jan 8 05:00:01 swi-mdm9x28-wp user.err kernel: [189784.809770] Freezing of tasks aborted after 0.148 seconds
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.814229] Restarting kernel threads … done.
Jan 8 05:00:01 swi-mdm9x28-wp user.debug Legato: DBUG | ngtpagerservice[841]/framework T=main | timer.c ProcessExpiredTimer() 392 | Timer ‘Button timer’ expired
Jan 8 05:00:01 swi-mdm9x28-wp user.debug Legato: DBUG | ngtpagerservice[841]/framework T=main | timer.c ProcessExpiredTimer() 392 | Timer ‘new timer Process LTE Queue’ expired
Jan 8 05:00:01 swi-mdm9x28-wp user.info Legato: INFO | ngtpagerservice[841]/NGTPagerServiceComponent T=main | message_queue.c TimerProcessQueueExpiryHandler() 242 | NGT: Handling Message Queue…
Jan 8 05:00:01 swi-mdm9x28-wp user.debug Legato: DBUG | ngtpagerservice[841]/framework T=main | timer.c ProcessExpiredTimer() 392 | Timer ‘Button timer’ expired
Jan 8 05:00:01 swi-mdm9x28-wp user.debug Legato: DBUG | ngtpagerservice[841]/framework T=main | timer.c ProcessExpiredTimer() 392 | Timer ‘io timer’ expired
Jan 8 05:00:01 swi-mdm9x28-wp user.debug Legato: DBUG | ngtpagerservice[841]/framework T=main | timer.c ProcessExpiredTimer() 392 | Timer ‘CC1125RX timer’ expired
Jan 8 05:00:01 swi-mdm9x28-wp user.warn kernel: [189784.815640] Restarting tasks … done.
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.826305] sierra_pm_resume
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.830483] Abort: Pending Wakeup Sources: [timerfd] [timerfd]
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.834339] PM: suspend exit 1980-01-08 05:00:01.337638945 UTC
Jan 8 05:00:01 swi-mdm9x28-wp user.info kernel: [189784.834463] PM: suspend entry 1980-01-08 05:00:01.337782747 UTC

you can try this before removing the USB cable:

echo NO_SLEEP > /sys/power/wake_lock

Hi,

Thank you, this indeed does the trick! However, it does not stick after a reboot of the module. Is there an AT command with the same function that is persistent over reboots? Or should I write this value in the system from my user application?

Best regards,
Frans.

yes, you can use an unsandboxed application to issue out this command by system() API.

Or you can run this legato app to make the module wake up

Hi,

Thanks for the suggestion, this solves the problem for me!

Best regards,
Frans.

Click the Power Management tab. If you want USB ports to keep supplying power in sleep mode, just uncheck “Allow the computer to turn off this device to save power“. Or check it to let 192.168 l 8.1 Windows turn off USB ports to save powe
This problem may occur if you are using the wrong or outdated USB drivers** . So you should update your USB driver to see if it fixes your problem. If you don’t have the time, patience or skills to update the driver manually, you can do it automatically with Driver Easy.