Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
4 years ago.
Cutting the PCB causes clock issues
I seem to be having some issues.
Once cutting the ST Nucleo board my board still works using the jumper wires for programming however due to it not using the clock signal provided by the ST Link chip it seems to not run at the correct clock speed and locks up.
When running the output clock speed command it results as 96Mhz.
How do I fix and set it up to use the internal PLL for the clock?
Thanks - Ryan Walmsley
Question relating to:
4 years ago.
It seems to me that there is an error in the mbed library for F070RB.
I tested the clock for HSI and PLL using CubeMX for settings what are in the mbed.
I also goes 96MHz for settings what are in the mbed. So wrong.
I suggest use mbed-dev instead mbed library and change source file.
(...) // Select PLLCLK = 48 MHz ((HSI 8 MHz / 2) * 12) RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSEState = RCC_HSE_OFF; RCC_OscInitStruct.LSEState = RCC_LSE_OFF; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.HSI14State = RCC_HSI_OFF; RCC_OscInitStruct.HSI14CalibrationValue = RCC_HSI14CALIBRATION_DEFAULT; RCC_OscInitStruct.HSI48State = RCC_HSI_ON; RCC_OscInitStruct.LSIState = RCC_LSI_OFF; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; // HSI div 2 RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; (...)
Comments suggest that HSI is divided by 2. And because the PLL is x12. But there is no divide by two, since it is RCC_PREDIV_DIV1. And there's no other divider before PLL.
I suggest to change:
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV2;