2015-07-09 08:15 AM
2015-07-09 10:14 AM
Can someone help me please?
Why can't you use the standard code within SystemInit() and system_stm32f4xx.c to set up the clocks and PLL properly?Make sure it's using the HSE clock, and that it's clocking properly at 8 MHz. You're using the STM32F4-DISCO right? Or something else?Output the HSE and PLL clocks using the PA8 (MCO) pin, and measure them with a scope.If you're not using an 8 MHz HSE, then make sure the HSE_VALUE define reflects the actual clock rate you're using.2015-07-10 07:04 AM
2015-07-10 07:40 AM
What's going on?
Ultimately I think you're best placed to figure that out.RCC_ClocksTypeDef RCC_Clocks;
RCC_GetClocksFreq(&RCC_Clocks);
printf(''SYS:%d H:%d, P1:%d, P2:%d
'',
RCC_Clocks.SYSCLK_Frequency,
RCC_Clocks.HCLK_Frequency, // AHB
RCC_Clocks.PCLK1_Frequency, // APB1
RCC_Clocks.PCLK2_Frequency); // APB2
You could use the APB clocks, as the system deciphers it's internal configurations, instead of using SystemCoreClock.
2015-07-10 08:18 AM
Output:
168000000 168000000 42000000 84000000 I don't know really what happened but now the timers work and I get from USART the correct data. Thank you very much