Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MXC_SDHC_Get_Input_Clock_Freq() in sdhc_me10.c returns the wrong frequency #1453

@JordanAceto

Description

@JordanAceto

See below. The if condition is flipped so the frequency returned is the opposite of what you'd expect.

unsigned int MXC_SDHC_Get_Input_Clock_Freq(void)
{
if (MXC_GCR->pclk_div & MXC_F_GCR_PCLK_DIV_SDHCFRQ) {
return HIRC96_FREQ >> 1; // Div by 2
} else {
return 50000000; // UG specifies a hard-coded 50Mhz low-power oscillator
}
}

Image

It's also a little weird that the definition is called HIRC96_FREQ , since it's actually 120Mhz if I'm not wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions