Jump to content

MSP430f5529 launchpad interface with SD card

Recommended Posts

I am a novice to MSP430 so my prior apologies for asking basic or stupid questions. I am trying to interface SD Card with msp430f5529 launchpad using FatFS file system of elm-chen. Luckily I found some of the files on the github via google which included mmc.c, mmc.h, HAL_SDCard.c and \HAL_SDCard.h .


I wrote the main file and somehow my SD card is being mounted but root directory is not being opened and I am always getting SD Card not ready message. I tried changing the card but it did no benefit. Can someone guide where is it going wrong and whats the way to resolve it. Let me know if I should attach some other stuff like files and stuff or a sample code where I can somehow compare to find out where am I going wrong.


Below is the code for fat_init


void fat_init(void){

    errCode = -1;

    while (errCode != FR_OK){                               //go until f_open returns FR_OK (function successful)
        errCode = f_mount(0, &fatfs);                       //mount drive number 0
        errCode = f_opendir(&dir, "/");                        //root directory

        errCode = f_open(&file, "/Data.csv", FA_CREATE_ALWAYS | FA_WRITE);
        if(errCode != FR_OK)
            result=0;                                       //used as a debugging flag


Link to post
Share on other sites
  • 9 months later...

Hi ! I am trying to make the same you was last year, writing in a SD Card with FatFS. I have spent three months with no success. Did you make it ?Could you help me anyway ? I changed the GPIO pins and the clock speed but I get no answer and the code stucks in the "Card Not Ready" part. I am using the same board that you, MSP430F5529 - LaunchPad.


Thank you very much !

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...