cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030 - Problems with PLL

Ahren Penner
Associate
Posted on July 22, 2017 at 00:59

I have been using an STM32F030C6 and configuring it with STM32CubeMX and have had success running the chip using the 8MHz HSI and an external 16MHz crystal. I would like to run at 48MHz but I have not had any luck enabling the PLL, at any multiplier. 

If I enable the PLL in CubeMX, select any multiplier, and upload the unmodified generated code I can only get as far as ''__HAL_RCC_PLL_ENABLE();'' in the debugger (using Atollic TrueStudio free version) before the target stops responding. I get the same result using an internal or external clock source. I have attached a screenshot of my CubeMX clock settings below along with the generated project.

Using CubeMX 4.22.0 and STM32F0 1.8.0 firmware package.

Are there some other settings that I'm missing somewhere or chip limitations that I am not aware of? 

0690X00000607dxQAA.png

#cubemx #stm32f030 #pll
1 ACCEPTED SOLUTION

Accepted Solutions
STOne-32
ST Employee
Posted on July 23, 2017 at 20:01

Hi

ahren.penner

‌,

Check your VDDs and VDDA pins if all connected. Then to not forget to set flash wait state to 1 instead of 0. Starting from 24MHz flash will not respond well to 0 wait -states. Sorry I did not see your code yet .

Cheers,

STOne -32

View solution in original post

3 REPLIES 3
Posted on July 22, 2017 at 15:34

Unless I'm confused this is setting 96 MHz

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_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; // This should be 

RCC_PREDIV_DIV2

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

{

_Error_Handler(__FILE__, __LINE__);

}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
STOne-32
ST Employee
Posted on July 23, 2017 at 20:01

Hi

ahren.penner

‌,

Check your VDDs and VDDA pins if all connected. Then to not forget to set flash wait state to 1 instead of 0. Starting from 24MHz flash will not respond well to 0 wait -states. Sorry I did not see your code yet .

Cheers,

STOne -32

Posted on July 24, 2017 at 18:52

Looks like it was a rookie mistake on my part, the problem was with the VDDA connection. Working flawlessly now. Thanks.