Waking host with USB driver Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
e_l_tang
Posts: 31
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Waking host with USB driver  Topic is solved

Postby e_l_tang » Mon Sep 04, 2017 8:19 pm

Is there a way to wake up the host during suspend? I did not find any function which could do this in the API.

User avatar
Giovanni
Site Admin
Posts: 10009
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 186 times
Been thanked: 171 times
Contact:

Re: Waking host with USB driver

Postby Giovanni » Mon Sep 04, 2017 8:23 pm

Hi,

It is the host that wakes up the device if I remember well.

Giovanni

e_l_tang
Posts: 31
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: Waking host with USB driver

Postby e_l_tang » Mon Sep 04, 2017 9:12 pm

Some classes of devices need to be able to wake up the host as well. For example a keyboard or mouse needs to wake up the host when the user provides input.

User avatar
Giovanni
Site Admin
Posts: 10009
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 186 times
Been thanked: 171 times
Contact:

Re: Waking host with USB driver

Postby Giovanni » Tue Sep 05, 2017 7:45 am

How is the host signaled?

Giovanni

e_l_tang
Posts: 31
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: Waking host with USB driver

Postby e_l_tang » Tue Sep 05, 2017 11:06 am

On an AVR the USB hardware does it when a bit is set in a register. I imagine that other chips don't do it much differently.

User avatar
Giovanni
Site Admin
Posts: 10009
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 186 times
Been thanked: 171 times
Contact:

Re: Waking host with USB driver

Postby Giovanni » Tue Sep 05, 2017 12:34 pm

Moving this topic under "change request".

Giovanni

e_l_tang
Posts: 31
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: Waking host with USB driver

Postby e_l_tang » Tue Sep 05, 2017 11:25 pm

For your reference, here is some example AVR code. Hope it helps.

FXCoder
Posts: 49
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 6 times
Been thanked: 9 times

Re: Waking host with USB driver

Postby FXCoder » Thu Sep 07, 2017 10:56 pm

One this topic...
We had a thread going that discussed the RWUSIG bit in the last posts.

The primary matter was RWUSIG being set by the USB driver instead of being cleared....
viewtopic.php?f=38&t=4076&start=10#p29927

In the case of an application level setting RWUSIG then the RWUSIG bit would need to be explicitly cleared by the driver (which it currently isn't - it is set instead).
If RWUSIG is set by the core (from L1 sleep state) then it is cleared automatically 50us later.

User avatar
Giovanni
Site Admin
Posts: 10009
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 186 times
Been thanked: 171 times
Contact:

Re: Waking host with USB driver

Postby Giovanni » Sat Sep 09, 2017 12:21 pm

Hi,

I added a tentative usbWakeupHost() API to trunk, I have no way to test it, could you give a feedback?

I will back-port the change to 17.6.x if it is OK.

Giovanni

e_l_tang
Posts: 31
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: Waking host with USB driver

Postby e_l_tang » Sat Sep 09, 2017 4:23 pm

I took a look at the code and I think the high level driver could be made more general. On AVR the software simply sets the bit and the hardware takes care of the rest. It is not necessary for it to wait or clear the bit.


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 0 guests