cancel
Showing results for 
Search instead for 
Did you mean: 

How USB Host should enable Suspend mode?

morpeh89
Associate II
Posted on February 17, 2015 at 15:54

Hi all! I'm a bit confused by USB Host behaviour when trying to enable Suspend mode.

I use ST USB library v.2.1.0. and STM32F407. Use Host example for HID device, and it is working correct. Now I try to make some changes - suspend and resume connected device.

I just write suspend enable bit in Host Port control and status register:

  *pdev->regs.HPRT0 |= (1 << 7);

I see by the oscilloscope, that host really stops sending SOFs after that action, bus seems to be in idle state. At the same time I see at the value of HPRT0 register, that Suspend bit was not asserted to 1. Instead of it I see ''Port enable'' bit falls to 0, and according Port interrupt cames. 

In the result, write to Resume bit have no effect: no life on DP-DM accures after that. So, I can enable port just by Reset - that is, by restarting device. But I needed just Suspend-Resume.

It also seems strange, that in library there are no functions for Suspending-Resuming the device. Maybe, this functions are not really supported? Or I forget do some additional settings?

I would be extremely thankful, if someone shares working code examples for enabling and disabling Suspend mode by the USB Host Controller in STM32F4-devices. Or gives any advice on this topic.
2 REPLIES 2
hasegawa
Associate
Posted on May 11, 2015 at 04:33

Hi alexey,

Did you clear this problem already?

I faced same problem last week and I cleared this.

I think that this problem is Specification documentation error.

PENA is rc_w1, rc_w0 is wrong.

Please try PSUSP(HPRT bit7)=1 with PENA(HRRT bit2)=0.

Regards

morpeh89
Associate II
Posted on July 21, 2015 at 10:43

Hi! Thanks for reply. It is correct solution - I've also found this feature of PENA bit eventually.

Seems to be not very convenient to write to HPRT - we must always remember about not writing 1 to PENA, if we don't want Port to be disabled.