cancel
Showing results for 
Search instead for 
Did you mean: 

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

DVerm
Associate II

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__);

2 REPLIES 2
DVerm
Associate II

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.

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 Venmo
Up vote any posts that you find helpful, it shows what's working..