Skip to main content
Ark1
Associate III
September 29, 2018
Question

SDIO driver

  • September 29, 2018
  • 5 replies
  • 1548 views

hi fellows, i'm developing the SD card application for STM32f429 discovery boards. i have the FATFS software with myself. my point i want to develop my own driver for SD card i don't want use HAL driver . i developed the initialization code for SD card. i didn't get the card response command and card status to my commands . i'm writing the CMD8 with argument (set voltage 3v3). but i didn't get response. i need to know the programming flow. i'm attaching my code along with this. so kindly help me to know better.

 SDIO->CLKCR|=(158<<0 | 1<<14); // SDIO_CK sets to 300KHZ & Enalbe the Hardware flow control.
 
	SDIO->CLKCR|=(1<<8); // Enables the SDIO_CK 
	SDIO->CMD|=(1<<12 | 3<<9 | 7<<6 | 0<<0); // send CMD0 to card, which makes software reset.
 
	SDIO->CMD|=(8<<0); // send CMD8 to card, set operation voltage.
	SDIO->ARG|=(0x190); // send argument with CRC code.

    This topic has been closed for replies.

    5 replies

    Tesla DeLorean
    Guru
    September 29, 2018

    ORing every value into the registers seems ill-advised

    http://users.ece.utexas.edu/~valvano/EE345M/SD_Physical_Layer_Spec.pdf

    http://elm-chan.org/docs/mmc/mmc_e.html

    Review the library code, review the Adafruit SPI SD code

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Ark1
    Ark1Author
    Associate III
    October 1, 2018

    thank you @Community member​ 

    Ark1
    Ark1Author
    Associate III
    October 2, 2018

    your suggestion is good:smiling_face_with_smiling_eyes:

    but still facing problems in understanding the code:sad_but_relieved_face:

    could you help me ? @Community member​ 

    Tesla DeLorean
    Guru
    October 2, 2018

    Ok, while discarding the HAL code might be an end goal, it does mean you need to understand the HW/SW at least as well as the people who wrote the original library. You could pay someone to teach you these things, or you could study the documentation and code yourself until you understand the mechanics.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Ark1
    Ark1Author
    Associate III
    October 3, 2018

    ok, how much did you charge for teaching me these embedded stuffs?

    because i need these knowledge badly.

    @Community member​