SD card FAT16 with RCM3100

Hello,

I would like connect SD card with FAT16 on the RCM3100 core.

  1. Is it possible and how?
    If yes:
  2. How could I define CS (chip select pin)?
  3. Can I have two SD card with FAT16 on the different CS signals?
  4. Can I call somthing a flush comand after a write to SD card command. I would like be sure that my writing data would be wrote on SD card. Is there any special command for this prupose or should I call the close_fat() function and after reopen file. But this way is not efficient…

Best regards

Perhaps have a look at the rabbit RCM3900 with the SD card functionality. From the hardware manual you could learn a lot if you dont want to purchase a RCM3900 and want to stick to the RCM3100.

kobuseng,

I connected SD card on the RCM3100 and changed CS control in SDFLASH.lib. I tried to run the example SDFLASH_INSPECT.C and it works fine!!!

But I can’t run any examples SD card with FAT, because I get messages:
“Board type does not support FAT filesystem.”
“You need to define _DRIVER_CUSTOM etc.”

Where Could I get more information to solve this problem?
Did anybody try to connect SD card with FAT on board which does not support SD card? Could you help me…
Best regards

Maybe it will be useful for someone. I did it. Now SD card with FAT works fine on the RCM3100 core. I made a few changes in fat_config.lib. See below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/////////////////My code start///////////////////////////////////
#ifndef RCM3100
#define RCM3100 0
#endif
/////////////////////My code end///////////////////////////////////

#elif (RCM4300_SERIES)
#define PC_COMPATIBLE
#define _DRIVER_0 “SD_FAT.LIB”
#define _DRIVER_0_INIT { “SD”, sd_InitDriver, _DRIVER_CALLBACK, },
#define _DEVICE_0 { sd_InitDriver, _DEVICE_CALLBACK, 0, 0,
FDDF_MOUNT_PART_ALL|FDDF_MOUNT_DEV_0, NULL, },
#define FAT_REMOVABLE
#define FAT_ALLOW_HOTSWAP
#define FAT_SD_DEVICE FDDF_MOUNT_DEV_0
#define FAT_SD_PART fat_part_mounted[0]

//////////////////My code start///////////////////////////////////
#elif (RCM3100)
#define FAT_MAXCU 5
#define FAT_REMOVABLE
#define FAT_ALLOW_HOTSWAP
#define FAT_SD_DEVICE FDDF_MOUNT_DEV_0
#define FAT_SD_PART fat_part_mounted[0]
#define PC_COMPATIBLE
//*** IMPORTANT! For removable devices use NULL label (“”)
#define _DRIVER_0 “SD_FAT.LIB”
#define _DRIVER_0_INIT { “SD”, sd_InitDriver, _DRIVER_CALLBACK, },
#define _DEVICE_0 { sd_InitDriver, _DEVICE_CALLBACK, 0, 0,
FDDF_MOUNT_PART_ALL|FDDF_MOUNT_DEV_0, “”, },
//////////////////////My code end///////////////////////////////////
#else
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

It need to insert RCM3100 board type in section: *** Built-in vs. external serial/nand mass storage flash board specifics ***. See below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
#if (BOARD_TYPE & 0xFF00) == (RCM3300A & 0xFF00) ||
(BOARD_TYPE & 0xFF00) == (RCM3700A & 0xFF00) ||
RCM3800_SERIES || RABBITFLEX_SBC40_SERIES || BOARD_TYPE == BL2600D ||
BOARD_TYPE == BL2600K || BOARD_TYPE == BL2600L ||
BOARD_TYPE == BL2600M || BOARD_TYPE == BL2600N ||
BOARD_TYPE == RCM3309 || BOARD_TYPE == RCM3319 ||
BOARD_TYPE == RCM3100 || BOARD_TYPE == RCM3900 || BOARD_TYPE == RCM3910 ||
(DC_BRD_OPT0 & BRDOPT0_NANDFLASHMASK) // w/ NAND
#if BOARD_TYPE == RCM3360A || BOARD_TYPE == RCM3360B ||
BOARD_TYPE == RCM3370A ||
BOARD_TYPE == RCM3365 || BOARD_TYPE == RCM3375 ||
BOARD_TYPE == RCM3100 || BOARD_TYPE == RCM3900 || BOARD_TYPE == RCM3910 ||
BOARD_TYPE == BL2600K || BOARD_TYPE == BL2600L ||
BOARD_TYPE == BL2600M || BOARD_TYPE == BL2600N ||
(DC_BRD_OPT0 & BRDOPT0_NANDFLASHMASK) // w/ NAND
#define __BT__FAT_MAXBUFS 128 // Default maximum number of FAT buffers for
// boards with built-in nand flash.
#else
#define __BT__FAT_MAXBUFS 8 // Default maximum number of FAT buffers for
// boards with built-in serial flash.
#endif
#else
#define __BT__FAT_MAXBUFS 0 // Default maximum number of FAT buffers for
// boards without built-in mass storage flash.
#endif
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
It is evident that you must change SD card CS control in SDFLASH.lib, because it was made special for RCM3900 core which drive CS with BUFEN pin!! If you are going to use card detect pin you should change defines for card detect pin.

Best regards

hi, well i plan to do what you did, i wired the sd card pins to to port D pins, but my question is where in the libs should i define to use port D ? i cant find any code related to the port used.

I have been working with the RCM3700 for some time and now is the time for my first question in this forum.

My goal is to use a SD Card with 1G memory together with the RCM3700, but I don’t know where to tell the software, that I have connected the SD card to the “Serial C” line ? Could comeone help me with this ?

Information:
I have tested the Fmt_Device.C and FAT_SHELL.C without the SD Card connected and it works fine. I guess that these programs are communicationg with the serial flash that is a part of the RCM3700.

Before FAT was included with Dynamic C, it was available as a separate module and had its own manual. This manual had an appendix which covered attaching non-native devices to core modules to give them FAT capability (or add to available storage). Unfortunately, this was not moved to the FAT section within the Dynamic C manual when FAT was rolled into the main compiler system. I will have to look into this. I have cut the appendix covering custom FAT configuration from the old FAT module manual, as the instructions are still correct. Since this module’s manual is not offered for download on our website, I have attached the zip file.