AnsweredAssumed Answered

HAL USB host HS in FS with FreeRTOS

Question asked by Pillet.Vincent on Jun 19, 2015
Latest reply on Feb 1, 2018 by Rick Sladkey
Hi all,

I'am communicating with a 3G modem through USB.
I'am using FreeRTOS (this is important).

The USB is configurated like :

  /*Set LL Driver parameters */

  hhcd.Instance = USB_OTG_HS;

  hhcd.Init.Host_channels = 11; 

  hhcd.Init.dma_enable = 1;

  hhcd.Init.low_power_enable = 0;

  hhcd.Init.phy_itface = HCD_PHY_EMBEDDED; 

  hhcd.Init.Sof_enable = 0;

  hhcd.Init.speed = HCD_SPEED_HIGH;

  hhcd.Init.vbus_sensing_enable = 0;

  hhcd.Init.use_external_vbus = 0;


My problem is the following: 
Sending small datas (simple AT command) to the modem is OK.

 

char at[] = "ATE0\r\n";

USBH_CDC_Transmit(&hUSB_Host, (uint8_t *) at, (uint32_t) strlen(at));


but sending more bigger data is a problem.
If the data is bigger than 64 (USB frame size) the transmit do not end.

If I add an osDelay(1) in the main USB thread ( USBH_Process_OS() ) the
transmit ends !

If I add a new thread to manage data received by the modem, the transmit ends !

But those workaround hide a bigger problem.
I suspect a FreeRTOS schedule and/or interrupt priority problem. So far I didn't managed to identifie it.

If someone has faced same problems please share your experience and/or fix,
Thanks,
Best Regards,  

Outcomes