cancel
Showing results for 
Search instead for 
Did you mean: 

HSE Bypass Clock Source w/CubeMX and Nucleo 303ZE fails

Larry Lukis
Associate II
Posted on March 27, 2017 at 01:42

Possible bug in CubeMX 4.20.0?

Using Nucleo 303ZE board, and Atollic 7.1.1

Build dead simple default project, except in RCC, set High Speed Clock to 'BYPASS Clock Source', and select HSE as input to PLL.

In main.c you'll have this routine:

void SystemClock_Config(void)

{

RCC_OscInitTypeDef RCC_OscInitStruct;

RCC_ClkInitTypeDef RCC_ClkInitStruct;

/**Initializes the CPU, AHB and APB busses clocks

*/

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;

RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;

RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL2;

RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

{

Error_Handler();

}

,,, etc,

Results in bad return from HAL_RCC_OscConfig() and call to Error_Handler().

If you change this line:

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

to 

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;

it runs fine.

Not sure if there is something I don't understand, or if it is possibly a bug in CubeMX. my .ioc file attached.

1 ACCEPTED SOLUTION

Accepted Solutions
Jeanne Joly
Senior III
Posted on April 28, 2017 at 09:38

Hi

Lukis.Larry

,

I would inform you that anew patch

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html

V 4.1is available to fix this issue.

Sorry for any inconvenience this may cause you.

BR. Eric

View solution in original post

2 REPLIES 2
Nesrine M_O
Lead II
Posted on March 27, 2017 at 12:43

Hi

larry.lukis

,

Please note that this is a confirmed CubeMX bug whichwill be fixed in a patch to be delivered soon.

Sorry for anyinconvenience it may bring.

-Nesrine-

Jeanne Joly
Senior III
Posted on April 28, 2017 at 09:38

Hi

Lukis.Larry

,

I would inform you that anew patch

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html

V 4.1is available to fix this issue.

Sorry for any inconvenience this may cause you.

BR. Eric