cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 USB Host remote wakeup

Palazzolo.Daniele
Associate II

I've implemented USB Host Suspend/Resume function. It work fine. I set USB_OTG_HPRT_PSUSP, when I want resume I set USB_OTG_HPRT_PRES and reset this bit after 20 ms, I see with an oscilloscope, the D+ and D- signals, in suspend state D+ is high and D- low (idle state), when set PRES bit, D- goes high and D+ low for 20ms (k state), when I reset PRES restart SOF and the comunitation on USB restart.

I tried to implement remote wakeup.

I set remote wakeup capability (using EP0 message).

Now I see device that signal stm32L4 Usb Host controller with a k state on bus for 3 ms, I trigger this event, on microcontroller run USB_OTG_GINTSTS_WKUINT interrupt, in agreement with reference manual, I read OTG_HPRT and I see PRES bit high.

At this point on bus I must see k state, but it isn't true. The USB not restart, the bus remain in idle state.

The reference manual say that when controller detect a remote wakeup set PRES bit (resume driven), according to USB Reference, the host take control on bus and drive the resume signal (20 ms).

I see PRES high, PSUSP low, but the resume signaling not work.

Can anyone help me?

3 REPLIES 3

Please just post once, and edit, no reason for 3 posts on the same topic.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Palazzolo.Daniele
Associate II

Sorry.

I've just deleted the other messages, but we continue to see them

Palazzolo.Daniele
Associate II

I done all my test on STM32L4A6 (on my custom board).

I tried porting USB Host suspend resume and remote wakeup capabilities on SM32H743 (Nucleo board) to check if with another MCU it work.

The problem remain the same.

When the USB Host controller recognize wakeup signal of the bus, run USB_OTG_GINTSTS_WKUINT interrupt, I can read OTG_HPRT and I see PRES set (like wrote in reference manual), the USB must driven resume signal, but if I check D- and D+ lines with oscilloscope, the bus isn't in k state (D+ low D- high), but it remain in idle state (D+ high D- low).

If the Host drive the suspend and resume on device, it work correctly, resume signal is driven correctly on the pin, I can do continuously, without problem (usb data arrive correctly). If the device does a remote wakeup to host (resume signal on bus for 1 to 15 ms), the stm32 USB controller not resume the bus, I can force PRES 1 or 0 the signal not work and not restart SOF on the bus.

Any ideas?