cancel
Showing results for 
Search instead for 
Did you mean: 

USB Device Code Generation for STM32CubeIDE Version: 1.14.1

forst
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

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.

View solution in original post

1 REPLY 1
FBL
ST Employee

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.