This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

APP_USBD_HID_USER_EVT_OUT_REPORT_READY trigger only one time with USB OTG

Hello,

I'm having a weird problem while doing a communication between nRF52840( perpherial device ) with USB OTG ( STM32 ).

I'm trying send out the data from USB OTG -> nRF52840 via HID OUT endpoint.

I only get the event APP_USBD_HID_USER_EVT_OUT_REPORT_READY one time and get the data by API app_usbd_hid_generic_out_report_get

From second time, I can't get APP_USBD_HID_USER_EVT_OUT_REPORT_READY  any more?

Any require ment to clear the buffer?

I know that I have to call 

while(1)
{
app_usbd_event_queue_process();

}

but it doesn't work

Any idea?

Parents Reply Children
  • Hi

    I discussed it with the developer, and he asked if you have been able to confirm in some other way that the OUT transaction is being sent from the host?

    Do you have access to any USB traffic logs that could show the bus activity?

    Best regards
    Torbjørn

  • Yes. I run the same code to send OUT transaction, first and second after 1 second.

    nRF chip only always get FIRST transaction. From the second transaction, it won't fire the event anymore


  • nfo> app: USBD HID generic example started.

    ebug> nrf_ble_lesc: Initialized nrf_crypto.

    ebug> nrf_ble_lesc: Initialized nrf_ble_lesc.

    ebug> nrf_ble_lesc: Generating ECC key pair

    nfo> app: SPI parse

    nfo> app: SPI parse

    nfo> app: USB power detected

    nfo> app: USB ready

    ebug> USBD: USBD event: SUSPEND

    nfo> app: APP_USBD_EVT_DRV_SUSPEND

    ebug> USBD: USBD event: RESUME

    nfo> app: APP_USBD_EVT_DRV_RESET

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0100 i:0000 l:8 )

    ebug> USBD: Transfer called on endpoint 80, size: 8, mode: FLASH

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 8

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0100 i:0000 l:18 )

    ebug> USBD: Transfer called on endpoint 80, size: 18, mode: FLASH

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 18

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:00 r:05 v:0001 i:0000 l:0 )

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0200 i:0000 l:9 )

    ebug> USBD: Transfer called on endpoint 80, mode: Handler

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 9

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0200 i:0000 l:41 )

    ebug> USBD: Transfer called on endpoint 80, mode: Handler

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 32

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 9

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0301 i:0409 l:255 )

    ebug> USBD: Transfer called on endpoint 80, size: 14, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 14

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0302 i:0409 l:255 )

    ebug> USBD: Transfer called on endpoint 80, size: 12, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 12

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0303 i:0409 l:255 )

    ebug> USBD: Transfer called on endpoint 80, size: 22, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 22

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:00 r:09 v:0001 i:0000 l:0 )

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:81 r:06 v:2100 i:0000 l:9 )

    ebug> USBD: Transfer called on endpoint 80, size: 9, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 9

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:81 r:06 v:2200 i:0000 l:40 )

    ebug> USBD: Transfer called on endpoint 80, size: 40, mode: FLASH

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 32

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 8

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:21 r:0A v:0000 i:0000 l:0 )

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:21 r:0B v:0001 i:0000 l:0 )

    nfo> app: SET_REPORT_PROTO

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0301 i:0409 l:100 )

    ebug> USBD: Transfer called on endpoint 80, size: 14, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 14

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0302 i:0409 l:100 )

    ebug> USBD: Transfer called on endpoint 80, size: 12, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 12

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0300 i:0409 l:100 )

    ebug> USBD: Transfer called on endpoint 80, size: 4, mode: FLASH

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 4

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0304 i:0409 l:100 )

    ebug> USBD: Transfer called on endpoint 80, size: 24, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 24

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0300 i:0409 l:100 )

    ebug> USBD: Transfer called on endpoint 80, size: 4, mode: FLASH

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 4

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0303 i:0409 l:100 )

    ebug> USBD: Transfer called on endpoint 80, size: 22, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 22

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:80 r:06 v:0100 i:0000 l:18 )

    ebug> USBD: Transfer called on endpoint 80, size: 18, mode: FLASH

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 18

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: Setup (rt:81 r:06 v:2100 i:0000 l:9 )

    ebug> USBD: Transfer called on endpoint 80, size: 9, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 80, size: 9

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN0

    ebug> USBD: USBD event: EndpointData: 80

    ebug> USBD: USBD event: EndpointData: In finished

    ebug> USBD: >> ep0status >>

    ebug> USBD: USBD event: EndpointEPStatus: 40000

    ebug> USBD: USBD event: EndpointData: 2

    ebug> USBD: USBD event: EndpointData: Out waiting

    ebug> USBD: USB DMA process: Starting transfer on EP: 2, size: 32

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: DMA ready OUT: 2

    nfo> app: OUT_REPORT_READY

    nfo> app: GET OUT report event: 32

    nfo> app: 55

    nfo> app: AA

    nfo> app: 20

    nfo> app: 16

    nfo> app: 32

    nfo> app: to dsPic: 55

    nfo> app: to dsPic: AA

    nfo> app: to dsPic: 20

    nfo> app: to dsPic: 16

    nfo> app: to dsPic: 32

    ebug> USBD: Transfer called on endpoint 81, size: 32, mode: RAM

    ebug> USBD: USB DMA process: Starting transfer on EP: 81, size: 32

    ebug> USBD: USB DMA process - finishing

    ebug> USBD: USB event: DMA ready IN: 81

    ebug> USBD: USBD event: EndpointEPStatus: 2

    ebug> USBD: USBD event: EndpointData: 81

    ebug> USBD: USBD event: EndpointData: In finished

    nfo> app: IN REPORT DONE 32

    ebug> USBD: USBD event: SUSPEND

    ebug> USBD: USBD event: RESUME

    nfo> app: APP_USBD_EVT_DRV_SUSPEND

    nfo> app: USB power removed

  • When I send to OUT transation on PC ( Windows), everything works well. I think there is a problem with bus of USB OTG but don't know why it got the packet one first time. 

Related