NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Power Management on Linux RT

After a long period of inactive use over Christmas a LinuxRT application is hanging. I have a working theory that the USB device we talk to (through RAW) has entered a sleep state and isn't waking.

 

To look into this theory I've been looking for the /power folder under the devices as described in https://www.kernel.org/doc/html/v4.13/driver-api/usb/power-management.html but it doesn't seem to exist.

 

I'm thinking the NI kernel may have the USB power management disabled which would explain the absence, is this correct?

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 1 of 3
(2,052 Views)

Yes you are correct, power management is disabled in the kernel configuration for NI LinuxRT. This is done to improve the real-time characteristics (waking up from sleep  states can induce significant latencies).

You can verify this by running something like this in a serial/ssh console:

 

admin@lepton:~# zcat /proc/config.gz | grep CONFIG_PM
# CONFIG_PM is not set

 

If you still have the target in a hung state it would be useful to look a the kernel log - it might give you clues on what's going on with the USB device. You can get the log by running the 'dmesg' command in a shell or by looking at the '/var/log/messages' log file (the log file will contain non-kernel messages too so you'll have to search around).

0 Kudos
Message 2 of 3
(1,999 Views)

Awesome that's great to know.

 

We found the issue in the end to be a combination of small quirks in the LabVIEW app so we have it running again now.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 3 of 3
(1,984 Views)