2023-03-14 02:05 AM
Hi Guys,
In STM32CubeIDE I start a new project for this board, I leave everything in the ioc unchanged and generate the code.
The call to MX_USB_OTG_HS_HCD_Init() works correctly.
I now change in the ioc: USB_OTG_HS Internal HS Phy from host_only to device_only and regenerate the code.
Now the call to MX_USB_OTG_HS_PCD_Init() ends up in the Error_Handler(), this is caused by a timeout in USB_CoreReset().
Does anyone have any ideas why this might be?
Many thanks
Andy
Solved! Go to Solution.
2023-03-15 09:00 AM
Just incase anyone else is experiencing this I have stumbled on a workaround.
I used the clock generator to set to 160mhz, set SDMMC mux to clk48 and set OTG HS mux to HSE.
I then added __HAL_RCC_SYSCFG_CLK_ENABLE() to HAL_MspInit() :
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* USER CODE END MspInit 0 */
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
I couldn't get it to work with the default clock setup
2023-03-15 09:00 AM
Just incase anyone else is experiencing this I have stumbled on a workaround.
I used the clock generator to set to 160mhz, set SDMMC mux to clk48 and set OTG HS mux to HSE.
I then added __HAL_RCC_SYSCFG_CLK_ENABLE() to HAL_MspInit() :
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* USER CODE END MspInit 0 */
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
I couldn't get it to work with the default clock setup