About LPC5528 USB DeviceStop function

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

About LPC5528 USB DeviceStop function

跳至解决方案
1,414 次查看
xunwan
Contributor I

Hi,

 When I use the USB1 of LPC5528, I want to turn off the device function through the USB_DeviceStop() function, but the result returned by calling the function fails. What may be the reason for this?

if (kStatus_USB_Success != USB_DeviceStop(g_composite.deviceHandle)){
USB_PDBG("USB Device Stop failed\r\n");
return kERROR_Fail;
}

0 项奖励
回复
1 解答
1,395 次查看
FelipeGarcia
NXP Employee
NXP Employee

Hi,

I think this is an issue with the USB_DeviceLpc3511IpControl API. I tried to replicate this by using CDC SDK example and I was able to see USB_DeviceStop returned error.

As you can see error is first initialized as kStatus_USB_Error.

FelipeGarcia_0-1619135562042.png

Then, when entering DeviceControlStop case you only modify registers and error flag is not modify, which means that error will still have initial value when exiting this function.

FelipeGarcia_1-1619135600248.png

Have a great day,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

------------------------------------------------------------------------------ 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,396 次查看
FelipeGarcia
NXP Employee
NXP Employee

Hi,

I think this is an issue with the USB_DeviceLpc3511IpControl API. I tried to replicate this by using CDC SDK example and I was able to see USB_DeviceStop returned error.

As you can see error is first initialized as kStatus_USB_Error.

FelipeGarcia_0-1619135562042.png

Then, when entering DeviceControlStop case you only modify registers and error flag is not modify, which means that error will still have initial value when exiting this function.

FelipeGarcia_1-1619135600248.png

Have a great day,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

------------------------------------------------------------------------------ 

0 项奖励
回复