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

0 REPLIES 0