Help with SDIO/FATFS on STM32F4 Discovery
Posted: Sun Nov 25, 2012 11:04 am
I have a STM32F4 Discovery board that is attached to one of these expansion boards you can get on EBay, the Open407V-D, and my code is based off of the ARMCM4-STM32F407-LWIP-FATFS-USB demo project.
On startup I init the SDC stack and register my events with
sdcStart(&SDCD1, &sdccfg);
tmr_init(&SDCD1);
chEvtRegister(&inserted_event, &el0, 0);
chEvtRegister(&removed_event, &el1, 1);
The initial inserted_event occurs and it calls the InsertHandler...
but in sdcConnect(&SDCD1) it fails on the call to sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_APP_CMD, 0, resp)
resp = Hex:0x20005fa4, every call to send_cmd returns this response.
I have tried this with older 2GB cards and a newer 8GB SDHC card, neither work..
I am fairly sure I am missing something in my hal / mcu config, but nothing makes sense.
Any pointers on how to debug this ??
In the sdc_lld, I don't see any calls to configure the alternate functions for the SDIO pins, is this configured elsewhere ?
Thank You
John Gentilin
Other Info.
The SDIO expansion connector is directly connected to the SDIO pins on the processor.
I also have a SSD1289 Display which is working fine..
The version of fatfs 0.9-patched.
HAL settings
#define HAL_USE_SDC TRUE
Not sure if this needed to be enabled -> #define HAL_USE_EXT TRUE
ChibiOS Info (I am using current trunk as of a few days ago)
Kernel: 2.5.1unstable
Compiler: GCC 4.6.2
Architecture: ARMv7-ME
Core Variant: Cortex-M4
Port Info: Advanced kernel mode
Platform: STM32F4xx High Performance
Board: STMicroelectronics STM32F4-Discovery
Build time: Nov 25 2012 - 01:42:00
On startup I init the SDC stack and register my events with
sdcStart(&SDCD1, &sdccfg);
tmr_init(&SDCD1);
chEvtRegister(&inserted_event, &el0, 0);
chEvtRegister(&removed_event, &el1, 1);
The initial inserted_event occurs and it calls the InsertHandler...
but in sdcConnect(&SDCD1) it fails on the call to sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_APP_CMD, 0, resp)
resp = Hex:0x20005fa4, every call to send_cmd returns this response.
I have tried this with older 2GB cards and a newer 8GB SDHC card, neither work..
I am fairly sure I am missing something in my hal / mcu config, but nothing makes sense.
Any pointers on how to debug this ??
In the sdc_lld, I don't see any calls to configure the alternate functions for the SDIO pins, is this configured elsewhere ?
Thank You
John Gentilin
Other Info.
The SDIO expansion connector is directly connected to the SDIO pins on the processor.
I also have a SSD1289 Display which is working fine..
The version of fatfs 0.9-patched.
HAL settings
#define HAL_USE_SDC TRUE
Not sure if this needed to be enabled -> #define HAL_USE_EXT TRUE
ChibiOS Info (I am using current trunk as of a few days ago)
Kernel: 2.5.1unstable
Compiler: GCC 4.6.2
Architecture: ARMv7-ME
Core Variant: Cortex-M4
Port Info: Advanced kernel mode
Platform: STM32F4xx High Performance
Board: STMicroelectronics STM32F4-Discovery
Build time: Nov 25 2012 - 01:42:00