Hi, I change File System Demo Example from SDIO to SPI but don't work!Please help me. I want to use SD/MMC for STM32F103C8. Regards AliReza
How do you think that anyone is going to be able to help you based on what you've posted??!
1. What "File System Demo Example" are you talking about?
2. What changes, exactly, did you make?
3. What, exactly, does "don't work" mean?
www.catb.org/.../smart-questions.html
Excuse me! This example: www.keil.com/.../fs_examples.html
Problem: Micro stop in this line: stat = fmount ("M0:");
I only change it from SDIO to SPI and change micro to stm32f103c8, because this micro don't has SDIO.
The instructions say, "select the related board and copy the example"
That will configure the code for the selected target.
What board did you select?
"I only change it from SDIO to SPI and change micro to stm32f103c8"
How, exactly, did you do that?
How did you determine that those are the only changes required?
Thanks for your reply, I use my board(stm32f103c8) and connect SD to SPI2. I changed FS_Config_MC_0.h to this:
// <h>Memory Card Drive 0 // Configuration for SD/SDHC/MMC Memory Card assigned to drive letter "M0:" #define MC0_ENABLE 1
// <o>Connect to hardware via Driver_MCI# <0-255> // Select driver control block for hardware interface #define MC0_MCI_DRIVER 0
// <o>Connect to hardware via Driver_SPI# <0-255> // Select driver control block for hardware interface when in SPI mode #define MC0_SPI_DRIVER 2
// <o>Memory Card Interface Mode <0=>Native <1=>SPI // Native uses a SD Bus with up to 8 data lines, CLK, and CMD // SPI uses 2 data lines (MOSI and MISO), SCLK and CS #define MC0_SPI 1
and RTE_Device.h:
// <e> SPI2 (Serial Peripheral Interface 2) [Driver_SPI2] // Configuration settings for Driver_SPI2 in component ::CMSIS Driver:SPI #define RTE_SPI2 1
// <e> SPI2_NSS Pin // Configure Pin if exists // GPIO Pxy (x = A..G, y = 0..15) // <o1> Port <0=>GPIOA <1=>GPIOB <2=>GPIOC <3=>GPIOD // <4=>GPIOE <5=>GPIOF <6=>GPIOG // Selects Port Name // <o2> Bit <0-15> // Selects Port Bit // </e> #define RTE_SPI2_NSS_PIN 1 #define RTE_SPI2_NSS_PORT GPIO_PORT(1) #define RTE_SPI2_NSS_BIT 12
// <o> SPI2_SCK Pin <0=>PB13 #define RTE_SPI2_SCK_PORT_ID 0 #if (RTE_SPI2_SCK_PORT_ID == 0) #define RTE_SPI2_SCK_PORT GPIOB #define RTE_SPI2_SCK_BIT 13 #define RTE_SPI2_SCK_REMAP 0 #else #error "Invalid SPI2_SCK Pin Configuration!" #endif
// <o> SPI2_MISO Pin <0=>Not Used <1=>PB14 #define RTE_SPI2_MISO_PORT_ID 1 #if (RTE_SPI2_MISO_PORT_ID == 0) #define RTE_SPI2_MISO 0 #elif (RTE_SPI2_MISO_PORT_ID == 1) #define RTE_SPI2_MISO 1 #define RTE_SPI2_MISO_PORT GPIOB #define RTE_SPI2_MISO_BIT 14 #define RTE_SPI2_MISO_REMAP 0 #else #error "Invalid SPI2_MISO Pin Configuration!" #endif
// <o> SPI2_MOSI Pin <0=>Not Used <1=>PB15 #define RTE_SPI2_MOSI_PORT_ID 1 #if (RTE_SPI2_MOSI_PORT_ID == 0) #define RTE_SPI2_MOSI 0 #elif (RTE_SPI2_MOSI_PORT_ID == 1) #define RTE_SPI2_MOSI 1 #define RTE_SPI2_MOSI_PORT GPIOB #define RTE_SPI2_MOSI_BIT 15 #define RTE_SPI2_MOSI_REMAP 0 #else #error "Invalid SPI2_MISO Pin Configuration!" #endif
Hi, This forum is not active?!!!
Time for you to get active, then!
What have you done to debug your project?
I spent more than 40 hours to debug this project!
Please see this: www.photobox.co.uk/.../full
ReadCdMissing!
Ok that describes the amount of time, but really doesn't convey any detail that might be used by others to advance the understanding of the problem. Going to be hard to generate any interest in your situation. Want people to interact? Provide some compelling level of detail.
What specific tests did you perform during this time? What were your observations with respect to pins and responses from the card? Did you look at the signals with a logic analyzer?