Did anyone get STM32F4DIS-BB 'baseboard' SD card slot running with ChibiOS?
Where do I start configuring the SDC Driver in SDIO mode (the one with four data lines)?
PB15 NCD
PC8 DAT0
PC9 DAT1
PC10 DAT2
PC11 DAT3
PC12 SDIO_CK
PD2 SDIO_CMD
STM32F4DIS-BB anyone? at least SD card...
Moderators: RoccoMarco, barthess
Re: STM32F4DIS-BB anyone? at least SD card...
You might want to check out the applications in the demos directory of the ChibiOS/RT repo. For example, the OLIMEX_STM32_E407 demo shows how to use SDIO with an F407. The pin config is done in the board.h file in the corresponding boards/ directory. If your board doesn't exist yet, you have to create one yourself.
I hope this helps.
~ Tectu
I hope this helps.
~ Tectu
- russian
- Posts: 364
- Joined: Mon Oct 29, 2012 3:17 am
- Location: Jersey City, USA
- Has thanked: 16 times
- Been thanked: 14 times
Re: STM32F4DIS-BB anyone? at least SD card...
Tectu wrote:You might want to check out the applications in the demos directory of the ChibiOS/RT repo. For example, the OLIMEX_STM32_E407 demo shows how to use SDIO with an F407. The pin config is done in the board.h file in the corresponding boards/ directory. If your board doesn't exist yet, you have to create one yourself.
It took me some time to realize that these are in the unstable branch, but I have finally found them. Thank you for the hint!
- russian
- Posts: 364
- Joined: Mon Oct 29, 2012 3:17 am
- Location: Jersey City, USA
- Has thanked: 16 times
- Been thanked: 14 times
Re: STM32F4DIS-BB anyone? at least SD card...
OLIMEX_STM32_E407, board.h gives me proper configuration for the GPIOC port pins, is this all I need? How does the driver know if it should use single-line MOSI or the four-line D* mode? Or it does not, because that's taken care by setting proper AF modes on the pins? I guess I just do not get the difference between these two schematics. Is one MMC specific and other SD specific?
So far my code is hanging with just the adjustment of C port right at the 'sdc_lld_send_cmd_none(sdcp, MMCSD_CMD_GO_IDLE_STATE, 0)' command
So far my code is hanging with just the adjustment of C port right at the 'sdc_lld_send_cmd_none(sdcp, MMCSD_CMD_GO_IDLE_STATE, 0)' command
- russian
- Posts: 364
- Joined: Mon Oct 29, 2012 3:17 am
- Location: Jersey City, USA
- Has thanked: 16 times
- Been thanked: 14 times
Re: STM32F4DIS-BB anyone? at least SD card...
What can I say... It took me six months to connect an external sd card module to my STM32F4Discovery
Two lessons:
1) if you connect an external module with some wires, this would not work with full speed SPI - and unfortunately too many samples assume a dev board with build-in slot
2) looks like three wire SPI mode is called mmc, not sd...
Two lessons:
1) if you connect an external module with some wires, this would not work with full speed SPI - and unfortunately too many samples assume a dev board with build-in slot
2) looks like three wire SPI mode is called mmc, not sd...
Re: STM32F4DIS-BB anyone? at least SD card...
I'm glad to hear that you finally got it working. This means that the SD card on the BB is connected over SPI, not SDIO?
~ Tectu
~ Tectu
- russian
- Posts: 364
- Joined: Mon Oct 29, 2012 3:17 am
- Location: Jersey City, USA
- Has thanked: 16 times
- Been thanked: 14 times
Re: STM32F4DIS-BB anyone? at least SD card...
Tectu wrote:This means that the SD card on the BB is connected over SPI, not SDIO?
Nope, it's just me confusing everyone BB board uses SDIO, but I did not get it working with Chibios. What I got working with Chibi was a small SPI SD pin-out module.
Re: STM32F4DIS-BB anyone? at least SD card...
I am having a similar issue with the breakout board for the STM32F4. I am attempting to talk to the sdcard over SDIO using the HAL interface but I am consistently getting the FatFS return code of FR_DISK_ERR : An unrecoverable error occured in the lower layer, disk_read(), disk_write() or disk_ioctl() function.
SdcIsCardInserted() and sdConnect() both return success, as well as f_mount. When calling f_open is where the FR_DISK_ERR code happens. Looking at the alternate function table for the STM32F4 tells me that the following pins need alternate mode 12, is this correct for SDIO? I have attached the Pin schematic for the SDcard on the breakout board. Any help is appreciated!
SdcIsCardInserted() and sdConnect() both return success, as well as f_mount. When calling f_open is where the FR_DISK_ERR code happens. Looking at the alternate function table for the STM32F4 tells me that the following pins need alternate mode 12, is this correct for SDIO? I have attached the Pin schematic for the SDcard on the breakout board. Any help is appreciated!
Code: Select all
palSetPadMode(GPIOC, 8, PAL_MODE_ALTERNATE(12) ); // SDIO_D0
palSetPadMode(GPIOC, 9, PAL_MODE_ALTERNATE(12) ); // SDIO_D1
palSetPadMode(GPIOC, 10, PAL_MODE_ALTERNATE(12) ); // SDIO_D2
palSetPadMode(GPIOC, 11, PAL_MODE_ALTERNATE(12) ); // SDIO_D3
palSetPadMode(GPIOC, 12, PAL_MODE_ALTERNATE(12) ); // SDIO_CK
palSetPadMode(GPIOD, 2, PAL_MODE_ALTERNATE(12) ); // SDIO_CMD
sdcStart(&SDCD1, NULL);
Re: STM32F4DIS-BB anyone? at least SD card...
Never mind on the previous post, bitwise OR on the GPIO pins with the appropriate STM32-specific I/O mode flags did the trick.
Re: STM32F4DIS-BB anyone? at least SD card...
chiVelle wrote:Never mind on the previous post, bitwise OR on the GPIO pins with the appropriate STM32-specific I/O mode flags did the trick.
Could you post your code? I have this same setup and would like to get the SD card working.
Who is online
Users browsing this forum: No registered users and 33 guests