2014-04-07 05:40 AM
Hello,
I wish to use the STM32F4Discovery board by using STM32CubeMX for MCU as configuration tool and Keil - MDK for code programming/debuging. The problem appear when HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2); is going to be executed and the program counter didn't reach to the next function HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_4);. Do you know where is the problem? Please take a look at the following pictures for more details regarding this problem.2014-04-07 06:44 AM
TL;DR (mostly too wide)
If you're running at 168 MHZ you'll need 5 flash wait states otherwise the processor will likely crash. For 80 perhaps 3 is more appropriate than 2. (~28 MHz per step?) Stop, or step into the offending routines too determine with more clarity exactly where it gets stuck/fails.2014-04-07 07:24 AM
I changed the flash latency with 5 and now is working. Thank you.