Hi All,
I have encountered a USB issue that causes the device to enter suspend mode.
After many tests, I discovered that LPC55S28 (LPCXpresso55S28 Revision A2) will enter USB suspend state because of "0U != (lpc3511IpState->registerBase->DEVCMDSTAT & BIT17)" when we set 2 endpoints in interface 0 and have input usage and output usage in the same HID report descriptor .
But LPC55S16 (LPCXpresso55S16) does not have this issue even though I have almost the same setting with LPC55S28 (You can refer to the attached sample code).
I am wondering what the differences are between LPC55S28 and LPC55S16 in USB mouse sample code. As far as I know, these two controllers have the same USB IP. But I am not sure what the difference is between LPC55S16 and LPC55S28.
Also, according to the spec, under what circumstance will bit 17 in USB1 DEVCMDSTAT register become 1?
Would anyone can help me check anything I mis-setting in LPC55S28?
Thanks.
已解决! 转到解答。
Hi,
I have to say that the USB IP is the same for LPC55S28 and LPC55S16.
For the "0U != (lpc3511IpState->registerBase->DEVCMDSTAT & BIT17)", this is the DSUS bit definition based on Table 766. USB0 device command/status register (DEVCMDSTAT, offset 0x000) in UM11126.pdf:
Device status - suspend.
The suspend bit indicates the current suspend state. It is set to 1 when
the device has not seen any activity on its upstream port for more than
3 ms. It is reset to 0 on any activity. When the device is suspended
(Suspend bit DSUS = 1) and the software writes a 0 to it, the device
will generate a remote wake-up. This will only happen when the device
is connected (Connect bit = 1). When the device is not connected or
not suspended, writing a 0 has no effect. Writing a 1 never has an
effect
So I suppose that it is a normal state that the suspend state happens and the Bit 17 is set.
can you give detailed inf where the line "0U != (lpc3511IpState->registerBase->DEVCMDSTAT & BIT17)" is.
BTW, can you refer to the usb device example in SDK package?
This is SDK website:
https://mcuxpresso.nxp.com/en/welcome
Hope it can help you
BR
XiangJun Rong
Hi XiangJun,
Thank you for your feedback and explanation.
The line 0U != (lpc3511IpState->registerBase->DEVCMDSTAT & BIT17) is on line 2706 in the usb_device_lpcip3511.c file.
I built my project based on the dev_hid_mouse_bm sample.
Without any changes, this sample works perfectly.
But after I change the HID descriptor as shown below,
Hi,
I have to say that the USB IP is the same for LPC55S28 and LPC55S16.
For the "0U != (lpc3511IpState->registerBase->DEVCMDSTAT & BIT17)", this is the DSUS bit definition based on Table 766. USB0 device command/status register (DEVCMDSTAT, offset 0x000) in UM11126.pdf:
Device status - suspend.
The suspend bit indicates the current suspend state. It is set to 1 when
the device has not seen any activity on its upstream port for more than
3 ms. It is reset to 0 on any activity. When the device is suspended
(Suspend bit DSUS = 1) and the software writes a 0 to it, the device
will generate a remote wake-up. This will only happen when the device
is connected (Connect bit = 1). When the device is not connected or
not suspended, writing a 0 has no effect. Writing a 1 never has an
effect
So I suppose that it is a normal state that the suspend state happens and the Bit 17 is set.
can you give detailed inf where the line "0U != (lpc3511IpState->registerBase->DEVCMDSTAT & BIT17)" is.
BTW, can you refer to the usb device example in SDK package?
This is SDK website:
https://mcuxpresso.nxp.com/en/welcome
Hope it can help you
BR
XiangJun Rong