南来之风 发表于 2024-9-8 13:04

【STM32H7S78-DK测评】-5- USB体验

本帖最后由 南来之风 于 2024-9-8 13:04 编辑

使用cubeide新建一个空白工程。时钟配置:


RCC:








调试运**住第二个循环判断处:
/**
* @briefReset the USB Core (needed after USB clock settings change)
* @paramUSBxSelected device
* @retval HAL status
*/
static HAL_StatusTypeDef USB_CoreReset(USB_OTG_GlobalTypeDef *USBx)
{
__IO uint32_t count = 0U;

/* Wait for AHB master IDLE state. */
do
{
    count++;

    if (count > HAL_USB_TIMEOUT)
    {
      return HAL_TIMEOUT;
    }
} while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_AHBIDL) == 0U);

/* Core Soft Reset */
count = 0U;
USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;

do
{
    count++;

    if (count > HAL_USB_TIMEOUT)
    {
      return HAL_TIMEOUT;
    }
} while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);

return HAL_OK;
}
有没有大佬遇到类似的问题?谢谢

AdaMaYun 发表于 2024-9-9 17:37

没有遇到过,是不是设置细节有问题?

17713595829 发表于 2024-11-13 16:39

请问解决了吗 我也遇到这个问题了 你用的是正点原子的核心板吗
页: [1]
查看完整版本: 【STM32H7S78-DK测评】-5- USB体验