cancel
Showing results for 
Search instead for 
Did you mean: 

FSMC clock initialization problem.

siddj
Associate II
Posted on January 12, 2009 at 14:25

FSMC clock initialization problem.

1 REPLY 1
siddj
Associate II
Posted on May 17, 2011 at 12:58

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?