microSD FAT32

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

Hi freaks, trying to setup a FAT32 microSD card.  I've ported the ASF example of the AT45DBXX to sd_mmc, i.e. I have initialised the microSD SPI instead of the AT45DBXX SPI.  I've have enabled and disabled the following:

 

#define LUN_0                DISABLE  //!< On-Chip Virtual Memory.
#define LUN_1                DISABLE   //!< AT45DBX Data Flash.
#define LUN_2                ENABLE  //!< SD/MMC Card over SPI.
#define LUN_3                DISABLE
#define LUN_4                DISABLE
#define LUN_5                DISABLE
#define LUN_6                DISABLE
#define LUN_7                DISABLE
#define LUN_USB              DISABLE  //!< Host Mass-Storage Memory.

the following simple test fails:

 

 if (mem_test_unit_ready(LUN_ID_SD_MMC_SPI_MEM) == CTRL_GOOD)
  {
    // Get and display the capacity
    mem_read_capacity(LUN_ID_SD_MMC_SPI_MEM, &VarTemp);
    print(SHL_USART, "OK:\t");
    print_ulong(SHL_USART, (VarTemp + 1) >> (20 - FS_SHIFT_B_TO_SECTOR));
    print(SHL_USART, " MB\r\n");
  }
  else
  {
    // Display an error message
    print(SHL_USART, "Not initialized: Check if memory is ready...\r\n");
  }

​so this leaves me thinking that either the microSD card is too large, "8 GBytes" or I have missed something in the porting of the example.  Maybe I have to change other things to to get it to work with the micorSD.  Any help ill be really appreciated.  Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Got it guys, was using the wrong SPI Peripheral.  Duh!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Fianawariror,

Have you succeeded? I am trying to connect MicroSD 2GB FAT16 with UC3A3 so i can save some data in a .txt file. I have tried with ASF Examples (FSACCESS_EXAMPLE, FAT_EXAMPLE) but without success. I could use some help. :)

Greetings

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll get back to you. I'm busy at the moment mate.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dont bother, but thank you anyway :)

I've done it . I have used FAT_EXAMPLE from ASF, changed it a little bit and it works like a charm now.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi m@rko, I adopted the  AT45DBX example.  Have a look at it and please ask if you have any problems.