I just start Working on Stm32F070RBT6.I am using CubeMx to Configure Keil and And Keil uVision5 to simulate.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 kind 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;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
    _Error_Handler(__FILE__, __LINE__);
  • 2
    \$\begingroup\$ forget about the simulators of such a complex uCs. Use the actual hardware. \$\endgroup\$ – P__J__ Nov 23 '17 at 15:06

Yes! You have configured the clock wrong! HSI RC in stm32f070RB is 8 MHz and you are using the PLLMul as 12, which makes the PCKL clock to run at 96MHz that is simply double its maximum capability!! You can at max have PLLMul as 6. Hope this helps!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.