cancel
Showing results for 
Search instead for 
Did you mean: 

How to Configure Clock in Stm32f0

Mayank Sharma
Associate
Posted on November 23, 2017 at 12:48

I just started Working on Stm32F070RBT6.I am using CubeMx to Configure Keil and Keil uVision5 ofr Simulation. I tried Blinky Example and run it in simulator mode.But The Example Is not working perfectly.I tried all the procedure available on internet but Still It is not working.After That I used Breakpoints and Step Debugging and I found That the problem is in Clock Configuration and my Program Stop At some king of Error Handler.I can't find any solution for that.Pleas Help.

Below I am posting the Point where my Program enter into Error Handler.

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;

RCC_OscInitStruct.HSIState = RCC_HSI_ON;

RCC_OscInitStruct.HSICalibrationValue = 16;

RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;

RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12;

RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

{

_Error_Handler(__FILE__, __LINE__);

}

#keil-mdk5 #stm32f0
2 REPLIES 2
Posted on November 23, 2017 at 13:49

You used the simulator or real hardware? 

To just blink a LED you could comment out this code to enable the PLL. You could check to see if the speed selection is too high.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 24, 2017 at 06:56

Thank you Sir For your kind Response.

I am using the Simulator and Keil IDE for that.

My Clock Speed Is also less then maximum allowed clock and also tried on different frequencies but Still not wot working.

It always went to the error handler and Stop execuiton.