SD Card FatFS Issue On Custom Board

I have a test board based on the WaveTooEasy schematic, however I am having issues with the WaveTooEasy firmware not communicating with the SD card. I know the hardware works as I have used the STM32duino/STM32SD libraries, that use a version of the FatFS library, and can read files (this uses the Generic STM32F4 hardware not the WaveTooEasy variant).

Using a debugger it seems to be failing in the sdPowerOn function so I think the commands are not being received.

On a side note the flashing of the LED’s seem slower than the actual WaveTooEasy board I purchased. The schematic notes 10Mhz crystal but the part number on the schematic is actually 8Mhz??

Any help would be appreciated.

David

(post deleted by author)

Thanks for your quick response. I am using the card detect and the sdPresent() is working.

The crystal I’m using is CSTCE8M00G55 which is what is defined in the WaveTooEasy Eagle schematic. This part is 8Mhz, can you confirm the part you are using as it would seem it’s a different clock speed.

Thanks again

The WaveTooEasy is using 10Mhz as defined in the HSE_VALUE in the code when compiling, so that will be the issue.

Ok now totally confused…

The schematic part is 8Mhz, the schematic value is 10Mhz and thje HSE_VALUE seems to be 25Mhz as defined in stm32f4xx.h

/**

  • @brief In the following line adjust the value of External High Speed oscillator (HSE)
    used in your application

    Tip: To avoid modifying this file each time you need to use different HSE, you
    can define the HSE value in your toolchain compiler preprocessor.
    /
    #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F401xx) ||
    defined(STM32F410xx) || defined(STM32F411xE) || defined(STM32F469_479xx)
    #if !defined (HSE_VALUE)
    #define HSE_VALUE ((uint32_t)25000000) /
    !< Value of the External oscillator in Hz /
    #endif /
    HSE_VALUE /
    #elif defined (STM32F412xG) || defined(STM32F446xx)
    #if !defined (HSE_VALUE)
    #define HSE_VALUE ((uint32_t)8000000) /
    !< Value of the External oscillator in Hz /
    #endif /
    HSE_VALUE /
    #endif /
    STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F411xE || STM32F469_479xx */

The note does say it cane be defined in the compiler preprocessor though. I’m not sure where 10Mhz is defined. I have ordered some 10Mhz version to test.

Sorry for the confusion, could you clarify when you have a chance. Thanks

(post deleted by author)

Hi @suremicro sorry for the late reply.

It seems there is an error in the eagle files/BOM. The crystal should be 10MHz instead of 8MHz.

Great, thank you both. That’s clear.

(post deleted by author)

I’ll look into this. At the moment I’ve copied the original hardware as a starting point so hopefully I can get it running with the existing files. I come from an ESP32 background so justing starting in the STM32 world so it’s going to be a while getting up to speed :wink: