Skip to main content
DVerm
Associate II
November 3, 2018
Question

I'm facing problem in integrating sd card with STM32F767ZI board over SPI1.

  • November 3, 2018
  • 2 replies
  • 752 views

Code generated with STM32cube mx software

Libraries included - fatfs.h

spi.h

Software - Truestudio

Error - f_mount works but in f_open it gets stuck.

No source available for "USER_initialize() at 0x8002800" 

code line :  if(f_mount(&fs, "", 0) != FR_OK)

  _Error_Handler(__FILE__, __LINE__);

 /* Open file to write */

 if(f_open(&fil, "first.txt", FA_OPEN_ALWAYS | FA_READ | FA_WRITE) != FR_OK)

  _Error_Handler(__FILE__, __LINE__);

    This topic has been closed for replies.

    2 replies

    DVerm
    DVermAuthor
    Associate II
    November 3, 2018

    Pins selected - PA4-SPI1_NSS for chip select

                 PA5-SPI1-SCK

                 PA6-SPI1_MISO

                 PA5-SPI1_MOSI

    SD card module - catalex sd card module

    Please let me know where i'm going wrong.

    Tesla DeLorean
    Guru
    November 3, 2018

    Can't help you with CubeMx, but workable SPI SD code can be found in the stm_adafruit_sd.c file from the BSP drivers directories.

    You can't debug issues with low level SPI/SDMMC and DISKIO code from top level FATFS file interface.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..