2024-10-18 08:48 AM - edited 2024-10-18 08:59 AM
Are there any issue using both controllers in host mode?
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
{
/* Init USB_IP */
if (phost->id == HOST_FS)
{
/* Link the driver to the stack. */
hhcd_USB_OTG_FS.pData = phost;
phost->pData = &hhcd_USB_OTG_FS;
hhcd_USB_OTG_FS.Instance = USB_OTG_FS;
hhcd_USB_OTG_FS.Init.Host_channels = 16;
hhcd_USB_OTG_FS.Init.speed = HCD_SPEED_FULL;
hhcd_USB_OTG_FS.Init.dma_enable = DISABLE;
hhcd_USB_OTG_FS.Init.phy_itface = HCD_PHY_EMBEDDED;
hhcd_USB_OTG_FS.Init.Sof_enable = DISABLE; // GW8RDI NOTE todo try with SOF
if (HAL_HCD_Init(&hhcd_USB_OTG_FS) != HAL_OK)
{
Error_Handler( );
}
USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&hhcd_USB_OTG_FS));
}
return USBH_OK;
}
2024-10-18 08:57 AM
Both working fine. But only at full speed setting, HS phy not present on HOST_HS .
But i only use Cube/HAL to set it, so try this. (LL i never tried.)
And i use both, on H743:
/* USB Host core handle declaration */
USBH_HandleTypeDef hUsbHostHS;
USBH_HandleTypeDef hUsbHostFS;
ApplicationTypeDef Appli_state = APPLICATION_IDLE;
/*
* -- Insert your variables declaration here --
*/
/* USER CODE BEGIN 0 */
ApplicationTypeDef Appli_state_sound = APPLICATION_IDLE;
/* USER CODE END 0 */
/*
* user callback declaration
*/
static void USBH_UserProcess1(USBH_HandleTypeDef *phost, uint8_t id);
static void USBH_UserProcess2(USBH_HandleTypeDef *phost, uint8_t id);
/*
* -- Insert your external function declaration here --
2024-10-18 09:06 AM - edited 2024-10-18 09:06 AM
Okay thanks, but I already have host and device working well for CDC and HID, I wonder how much code I'm going to have to rewrite to get this working using the latest HAL, I guess it doesn't allow switching on the fly between CDC and HID?
2024-10-18 09:23 AM
So to verify, STM's latest H7xx LL-libraries don't support the use of the USB HS controller for FS operation?