AnsweredAssumed Answered

Slowing Down SDHC clock

Question asked by Neil Porven on Jun 9, 2016
Latest reply on Jun 28, 2016 by xiangjun.rong


Hi everyone,

 

I keep having issues with my SDHC and reading from an SD card.  I believe the issue has to do with

slowing down the clock.

 

I am working with a custom board, processor is the MK64F, I am using KDS 3.1.0 + KSDK 1.3.

The project is a bare bone, no PE, RTO, etc.....  I am using FatFs + SDHC data logger demo

with KSDK by Jorge Gonzalez.  The demo was meant to be used with the FRDM-K64F board

and changing the clock there to 400KHZ seems to work, but not on my custom board.

 

I noticed that in the fsl_sdhc_driver.c (FreeScale->KSDK_1.3.0->platform->drivers->src->sdhc),

exists a function called CLOCK_SYS_SetSdhcSrc(instance,kClockSdhcSrcPllFllSel)

 

the kClockSdhcSrcPllFllSel is a value passed to the SDHC clock to satisfy the register SIM_SOPT2->SDHCSRC,

which lets the SDHC clock know which clock to work from.  I am trying to replace that value (kClockSdhcSrcPllFllSel )

with kClockSdhcSrcCoreSysClk in the function mentioned above, because I want to use 00 Core/system clock

as my setting for my custom board

 

The issue I am experiencing is that if I physically change it in the function, when I step into the function and fall

in a deeper internal function, the value changes back to the kClockSdhcSrcPllFllSel setting originally there?????

 

How can I change the function to the settings I want?

 

Thank you,

Neil Porven

Outcomes