SDIO with STM32L4 (Nucleo-64 board)
Posted: Thu Mar 17, 2016 12:35 pm
Hi,
First of all, let me congratulate you Giovani for your excelent work with ChibiOS RTOS.
I am developing an application with an SD card and I was using the SPI peripheral to read/write the card. But now with this new board, I was trying the SDIO interface (4 bits), but unfortunately I was unable to read or write from the card. The SD cards are 8GB class 10 and 8GB class 4.
So is there any particular option to set in this microcontroller to make this working properly?
Thanks in advance for your help.
I attached the chibios project that I was using. It is adapted from the STM32F4 discovery board. To test the code, the CHIBIOS var in makefile must be set to the proper path (I am using chibios 16.1.4).
In this particular board, I had to set the SDIO pins to their alternate functions (12, according to the datasheet)
palSetPadMode(GPIOC, 11, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOD, 2, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 12, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 8, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 9, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 10, PAL_MODE_ALTERNATE(12));
The shell outputs the following text after sending this command "sdc all".
ChibiOS/RT Shell
ch> sdc all
Connecting... failed
ch> sdc all
Connecting... failed
ch> sdc all
Connecting... failed
ch> sdc all
Connecting... OK
Card Info
CSD : 400E0032 5B590000 3B377F80 0A4040AE
CID : 03534453 4C303847 8029795F 7100F89C
Mode : SDV20
Capacity : 7580MB
Single block aligned read performance: failed
ch> sdc all
Connecting... failed
ch>
First of all, let me congratulate you Giovani for your excelent work with ChibiOS RTOS.
I am developing an application with an SD card and I was using the SPI peripheral to read/write the card. But now with this new board, I was trying the SDIO interface (4 bits), but unfortunately I was unable to read or write from the card. The SD cards are 8GB class 10 and 8GB class 4.
So is there any particular option to set in this microcontroller to make this working properly?
Thanks in advance for your help.
I attached the chibios project that I was using. It is adapted from the STM32F4 discovery board. To test the code, the CHIBIOS var in makefile must be set to the proper path (I am using chibios 16.1.4).
In this particular board, I had to set the SDIO pins to their alternate functions (12, according to the datasheet)
palSetPadMode(GPIOC, 11, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOD, 2, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 12, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 8, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 9, PAL_MODE_ALTERNATE(12));
palSetPadMode(GPIOC, 10, PAL_MODE_ALTERNATE(12));
The shell outputs the following text after sending this command "sdc all".
ChibiOS/RT Shell
ch> sdc all
Connecting... failed
ch> sdc all
Connecting... failed
ch> sdc all
Connecting... failed
ch> sdc all
Connecting... OK
Card Info
CSD : 400E0032 5B590000 3B377F80 0A4040AE
CID : 03534453 4C303847 8029795F 7100F89C
Mode : SDV20
Capacity : 7580MB
Single block aligned read performance: failed
ch> sdc all
Connecting... failed
ch>