STM32WB5MMG and USB
Hi,
I'm working with an STM32WB5MMG. I need to use both USB and BLE. I see that there are some threads opened about problems regarding the use of both USB and BLE in the same project due to the HSI48. However, I added LL_HSEM_1StepLock(HSEM, 5) to prevent the CPU2 to disable the HSI48 oscillator when it does not use anymore the RNG IP. It was working until I add all the peripheral. I report my main code.
Someone has suggestion?
Thanks.
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Config code for STM32_WPAN (HSE Tuning must be done before system clock configuration) */
MX_APPE_Config();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Configure the peripherals common clocks */
PeriphCommonClock_Config();
/* IPCC initialisation */
MX_IPCC_Init();
/* USER CODE BEGIN SysInit */
//NB: to use USB and BLE you must add this line
/**
* This prevents the CPU2 to disable the HSI48 oscillator when
* it does not use anymore the RNG IP
*/
LL_HSEM_1StepLock(HSEM, 5);
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_RTC_Init();
MX_I2C1_Init();
MX_LPUART1_UART_Init();
MX_SPI1_Init();
MX_CRC_Init();
MX_USB_Device_Init();
MX_RF_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Init code for STM32_WPAN */
MX_APPE_Init();
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
MX_APPE_Process();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
