Enabeling USB and BLE on STM32WB55
Trying to enable both USB and BLE at the same time I encountered difficulty
The USB failed to run.
I encountered the following ticket: usb-device-does-not-work-when-starting-ble-stack-on-stm32wb55 which had an example attached to it.
After trying several things from that example we saw that the only thing I needed was to lock HW semaphore number 5 (Which I found on other projects to be defined as CFG_HW_CLK48_CONFIG_SEMID).
Do note that the semaphore is never being released
I'm not entirely sure if what I did was correct.
My USB clock configuration is:
LL_HSEM_1StepLock(HSEM, 5);
// USB clock enable
memset(&PeriphClkInitStruct, 0, sizeof(PeriphClkInitStruct));
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
goto PeripheralClocksErr;
}
__HAL_RCC_USB_CLK_ENABLE();
Anyone from ST can verify/validate that this is the correct way to do it?
Thanks. Hagai
