2018-04-30 05:43 AM
Simple demo application on the Nucleo-L476RG generated in CubeMX with HAL version 1. Nothing but USB Host and a few GPIOs for LEDs enabled.
When it comes to the `SystemClock_Config()` it freezes when enabling the clock source for the USB.
if(PeriphClkInit->UsbClockSelection == RCC_USBCLKSOURCE_PLLSAI1)
{
/* PLLSAI1 input clock, parameters M, N & Q configuration and clock output (PLLSAI1ClockOut) */
ret = RCCEx_PLLSAI1_Config(&(PeriphClkInit->PLLSAI1), DIVIDER_Q_UPDATE);
if(ret != HAL_OK)�?�?�?�?�?�?
`ret` is always `HAL_ERROR` which causes an infinite loop at:
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}�?�?�?�?
Just wondering if I have a hardware issue or something I missed in clock initialization.
#clock #usb #bug #cubemxSolved! Go to Solution.
2018-05-03 12:17 AM
Same issue as
so guess I'm not alone now.2018-04-30 06:17 AM
Just wondering if I have a hardware issue or something I missed in clock initialization.
Why don't you step through
RCCEx_PLLSAI1_Config
to find out?
JW
2018-04-30 10:58 AM
Thanks, waclawek.jan, done that. Crashes at this macro:
(((READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1U) != PllSai1->PLLSAI1M)�?
Found in `stm32l4xx_hal_rcc_ex.c` on line 2969
2018-04-30 11:41 AM
Looks like this might be a CubeMX generation issue on the L4. When not using the PLLSAI1Q as a clock source all works fine.
2018-04-30 05:07 PM
This line says, that you attempted to change the already set M divider.
JW
2018-05-02 08:31 AM
Bug found!
CubeMX HAL framework 1.11 omits the M divider from project generation.
Add the following to the clock init function and you are off to the races.
`
RCC_OscInitStruct.
PLL
.
PLLM
=
1
;`
2018-05-03 12:17 AM
Same issue as
so guess I'm not alone now.2018-05-16 10:11 AM
Hi
Lowe.Richard
Please update to the 4.1