2009-01-12 05:25 AM
FSMC clock initialization problem.
2011-05-17 03:58 AM
I am writing to external flash using a STM 32F 103 E chip to talk to a Micron 8 G nand flash memory. When I run the code all my clocks get initialized properly, ex: PLL,SYSCLK,etc. I have set the SYSCLK to 72Mhz.
When I come to the following line of code, /* Enable the FSMC Clock */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE); it does not go through, assert param fails and it exits the code. Here is the function definition. void RCC_AHBPeriphClockCmd(u32 RCC_AHBPeriph, FunctionalState NewState) { /* Check the parameters */ assert_param(IS_RCC_AHB_PERIPH(RCC_AHBPeriph)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { RCC->AHBENR |= RCC_AHBPeriph; } else { RCC->AHBENR &= ~RCC_AHBPeriph; } } The code goes to the first line of the function and then skips to the very end of the program, void assert_failed(u8* file, u32 line) { /* User can add his own implementation to report the file name and line number, ex: printf(''Wrong parameters value: file %s on line %d\r\n'', file, line) */ /* Infinite loop */ while (1) { } } Can anyone figure out what's wrong with this?