cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX - Configuration Bug?

dorin
Associate
Posted on April 07, 2014 at 14:40

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.

0690X00000603QLQAY.jpg

0690X00000603IXQAY.jpg

0690X00000603QQQAY.jpg

0690X00000603QVQAY.jpg

0690X00000603QaQAI.jpg

2 REPLIES 2
Posted on April 07, 2014 at 15:44

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dorin
Associate
Posted on April 07, 2014 at 16:24

I changed the flash latency with 5 and now is working. Thank you.