Enable USB-SS mode


#1

Hiya,

How do I put the WP into USB-SS mode from within Legato?

ciao, Dave


#2

1.启用内核自动睡眠功能:echo mem > /sys/power/autosleep
2.将host的usb置为suspend状态:cd /sys/bus/usb/devices/1-1/power
echo 0 > autosuspend
echo auto > level
3.这个时候wp就进入了usb-ss


#3

The module should go to USB-SS mode unless something is holding a wake lock. What does cat /sys/power/wake_lock show?


#4

Hi @zx_310 & @dfrey

I knew about the files in /sys - but thanks for the extra info.

This is a headless mangOH Red that I’m using (no USB connected) - and I need to put the WP into USB suspend from within a Legato App, and wake the device up via an external pin (as per the WP77 PTS).

It looks like the only way is to shell out using a system() call.

And I can’t use ULPM mode as it’s too slow to respond to a wakeup.

Any more thoughts?

ciao, Dave


#5

The point I was trying to make is that you should already be in USB-SS. So I want you to look at the file in /sys/power for an explanation why you are not.


#6

Ahh.

Sorry, I think we’re at cross purposes here.

My immediate issue is that I need to do some real world current consumption measurements (my customer has asked me to do so) so we can work out some battery requirements and so on.

My customer has been looking into the WP7702 PTS - in particularly sections 3.2.2 and 4.8 and we need to look into the USB-SS mode wake-up.

So, I have a legato app that is monitoring a couple of GPIO pins on the IoT connector (IoT GPIO1 is WP GPIO42 - which is a designated USB-SS mode Wakeup Interrupt). When IoT GPIO2 transitions from HI to LO, I want to be able to immediately force the WP into USB-SS mode (to reduce power consumption); and then to wake up out of USB-SS mode when IoT GPIO1 (a designated Wakeup interrupt) transitions LO to HI.

This is the basis of some hardware and software for a project the client wants.

If I can’t force the WP into USB-SS sleep mode on command, then I’m in a world of grief. I can’t use ULPM, as it’s just to slow to react to the wake-up.

My reading of the PTS is that you should be able to force the WP into USB-SS mode when required, and have it woken by external interrupt.

ciao, Dave


#7

I think you’re not getting my point. You don’t force into USB-SS. If you’re not in USB-SS already it’s because:

  1. USB-SS is disabled entirely
  2. Something is keeping you awake

https://docs.legato.io/latest/c_pm.html

// Create a wakeup source
le_pm_WakeupSourceRef_t r = le_pm_NewWakeupSource(0, "Test Source"); 
// Activate the wakeup source
LE_ASSERT_OK(le_pm_StayAwake(r));
// Module will now stay out of USB-SS indefinitely
// ...

// Relax this wake source.  This allows the module to go into USB-SS assuming that no other wake locks are held.
LE_ASSERT_OK(le_pm_Relax(r));


#8

Hi @dfrey,

OK. Ta.

So is the USB-SS referenced in Linux the same as the USB-SS mode referenced in the PTS?

ciao, Dave


#9

HI @davidc,
USB SS is related to the USB bus itself. When the host does not need to access the device anymore, it can suspend the USB bus. so I think it references the same thing
best regards