2018-11-03 04:29 AM
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__);
2018-11-03 04:29 AM
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.
2018-11-03 06:31 AM
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.