2024-03-25 10:50 PM
Hello,
I am trying to create a HID device using the USB Device code generation in STM32CubeIDE Version: 1.14.1.
But I have a problem with my PC not recognizing it as a HID device.
MxCube.Version=6.5.0 is working fine and we have investigated the differences within the source code
Undoing the following changes worked correctly.
/**
* @brief Start the USB device
* @PAram hpcd PCD handle
* @retval HAL status
*/
HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd)
{
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
__HAL_LOCK(hpcd);
if (((USBx->CID & (0x1U << 8)) == 0U) &&
(hpcd->Init.battery_charging_enable == 1U))
if ((hpcd->Init.battery_charging_enable == 1U) &&
(hpcd->Init.phy_itface != USB_OTG_ULPI_PHY))
{
/* Enable USB Transceiver */
USBx->GCCFG |= USB_OTG_GCCFG_PWRDWN;
}
__HAL_PCD_ENABLE(hpcd);
(void)USB_DevConnect(hpcd->Instance);
__HAL_UNLOCK(hpcd);
return HAL_OK;
}
/////////////////////////////////////////////////////////////////////////////////////////////
What does this behavior mean?
Best regards
Solved! Go to Solution.
2024-07-11 3:32 AM
Hi @forst
This issue has been solved [HAL][LL][USB] Fix device connection in case battery charging used wi… · STMicroelectronics/stm32h7xx_hal_driver@6dd7f0e (github.com)
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-07-11 3:32 AM
Hi @forst
This issue has been solved [HAL][LL][USB] Fix device connection in case battery charging used wi… · STMicroelectronics/stm32h7xx_hal_driver@6dd7f0e (github.com)
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.