2016-10-08 09:06 PM
Hi, I am looking to have sd card interfaced with SPI using FATFS library, I have spent a lot of time trying to figure out how to do it but without any success. Could anyone help me with that? Thanks.
2016-10-09 09:39 AM
I have spent a lot of time trying to figure out how to do it but without any success
Unfortunately that imparts no information about what you have done, or how close to getting it working you might have come. I'm not looking to rework a complete solution from scratch. So let's try and leverage the time you've already spent productively. There are a number of STM32 board designs using SPI SD Card attachment. Have you reviewed those? How have you wired your solution? EVAL, Olimex, eBay, TaoBao, etc. There are a number of software examples that are almost certainly portable to the STM32F3-DISCO platform. The EVAL series boards being a prime example, but there are others.2016-10-10 06:41 AM
Hi alkuor.abdelraheem,
You can get help from the following resources :* User manual ''Developing Applications on STM32Cube with FatFs''* ''FatFs_uSD'' firmware example in which is an application that uses most of the features offered by FatFs to configure a microSD drive, at this path: STM32Cube_FW_F3_V1.6.0\Projects\STM32303C_EVAL\Applications\FatFs\FatFs_uSD-Hannibal-2016-11-30 07:35 AM
Hi, thank you for your reply. I am sending the correct command and I can see it on the scope.However, I don't get 0x01 response(I keep getting 0xff) from SDcard(SDHC)(SanDisk Ultra 40MB/s ...16GB) I am using the following code: uint8_t cmd0[6]={0x40,0x00,0x00,0x00,0x00,0x95};
uint8_t dumb=0xff; FATFS_CS_HIGH; for (int i = 0; i < 10; i++) { HAL_SPI_Transmit(&hspi1, &dumb, 1, 10); while (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY); } FATFS_CS_LOW; HAL_SPI_Transmit(&hspi1, cmd0, 6, 10); while (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY); for (int i = 0; i < 2; i++) { HAL_SPI_Transmit(&hspi1, &dumb, 1, 10); while (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY); HAL_SPI_Receive(&hspi1, &c, 1, 10);// I keep getting 0xff }2016-11-30 08:02 AM
This is the third thread you have opened on this same topic/theme