2014-06-17 10:27 AM
Hi,
I would like to run the processor system clock using the system clock (PLL @ 84MHz). However, this is not working. As soon as I enable the PLL clock to be used as the system clock, the MCU goes to the Hard Fault Handler. I have attached my system_init() code.Thanks,Vipin2014-06-17 12:16 PM
You had better have selected the slower flash wait states BEFORE engaging the faster clock. Otherwise the processor will read junk and crash.
2014-06-17 01:54 PM
Hi Clive,
Thank you for your quick response. May I know what you would define as a slow flash read time for an 84MHz PLL clock?Thanks,Vipin2014-06-17 02:04 PM
Thank you Clive. I moved my FLASH WS initialization before my PLL setup and my system is up and running.
Thank you,Vipin2014-06-18 01:34 PM
Hi again,
Unfortunately I was not able to run the fix on the STM32F401CC. However, the same code does run on the STM32F407. Are there any tips or trick to get the same code running on the 401CC. As far as I understand, it is the same architecture with lower flash and RAM.Is there a startup script that can also be perhaps looked at for the 401? I was not able to find one online.Thanks,Vipin2014-06-18 04:37 PM
STM32F401-Discovery_FW_V1.0.0\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f401xx.s
STM32F401-Discovery_FW_V1.0.0\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c Project define - STM32F401xx#if defined (STM32F401xx)
#define PLL_N 336
/* SYSCLK = PLL_VCO / PLL_P */
#define PLL_P 4
#endif /* STM32F401xx */
Make sure HSE_VALUE and the PLL source settings match the HSE clock crystal on your board.
2014-06-19 05:11 PM
Hi again,
Thanks for the response. I found my error: I was enabling some peripherals before this init which was breaking the system.Thanks again,Vipin