cancel
Showing results for 
Search instead for 
Did you mean: 

USB host nucleo not working properly

saurabhjoshi99
Associate

Hi all,

 

I am using the Nucleo-L496ZG dev board and am using it as a USB Host communication to communicate with other usb devices.

i am able to communicate USB mouse with nucleo board successfully but when i am trying to read data from other device

for 1st time it is working properly and after that it will be stuck at USBH_URB_NOTREADY on USBH_LL_GetURBState function .

 

it may not worked properly with other devices because that device is not continuously

sending a data just like mouse device , when we send data and it will respond once. so for first time

it gives data properly and then for second time when we trying to send data and on receiving side it gets stuck on USBH_URB_NOTREADY state.

 

So what to do in this i am getting stuck on this please suggest me something in this so that i can proceed.

3 REPLIES 3
Piranha
Chief II

Why did you generated a duplicate?

https://community.st.com/t5/stm32cubemx-mcus/usb-host-not-receives-data-from-devices-on-second-time-onwards/td-p/600639

 

The API of the ST's parody of a USB stack cannot be just called from anywhere. It must be called either from an interrupt of the same priority as USB interrupt, or from a critical section, which blocks the USB interrupt.

ST's parody of a USB stack

😂 

 

 

 

If you feel a post has answered your question, please click "Accept as Solution".

hi piranha 

i wasn't call api from anywhere I am taking usb host mouse as a base code and made modification on  usbh_hid.c and usbh_hid_mouse.c file . for first time it is working properly and then the problems occurs . i have attach few imp files can you please suggest something 

note : This USB device has gives the 2048 bytes of data only after 64 bytes of data that send from USB host so for first time when we send 64 bytes of data we receive proper 2048 bytes of data and after that when we send again and try to read it on USBH_HID_POLL state of USBH_HID_Process function it gets stuck on USBH_URB_NOTREADY state . 

when i connect mouse it works properly.