Sunday, June 25th 2017, 9:11am UTC+2

You are not logged in.

  • Login
  • Register

Paramasivan

Beginner

Date of registration: Oct 24th 2014

Posts: 3

1

Friday, December 26th 2014, 9:33am

Is it possible to read files from both SD card and USB disk in a single project ?

Hi,

I need to copy some files from SD card to USB pen drive. Now the SD card and USB pen drive is working good separately. How to configure or switch the file system from SD card to USB host pen drive? Is it possible? ?(

This post has been edited 1 times, last edit by "Paramasivan" (Dec 26th 2014, 9:34am)


SEGGER - Marius

Super Moderator

Date of registration: Aug 10th 2011

Posts: 23

2

Monday, January 12th 2015, 1:51pm

Hello Paramasivan,

Yes, it is possible to copy files from SD card to USB drive. All you have to do is to add the SD/MMC and the USB MSD drivers to your emFile configuration as in the following example:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void FS_X_AddDevices(void) {
  FS_AssignMemory(&_aMemBlock[0], sizeof(_aMemBlock));
  //
  // Add the USB MSD driver. Volume name: "msd:0:"
  //
  FS_AddDevice(&USBH_MSD_FS_Driver);
  //
  // Add and configure the SD/MMC driver. Volume name: "mmc:0:"
  //
  FS_AddDevice(&FS_MMC_CardMode_Driver);
  FS_MMC_CM_Allow4bitMode(0, 1);
  //
  // Enable the file buffer to increase performace when reading/writing small amounts of data.
  //
  FS_ConfigFileBufferDefault(512, FS_FILE_BUFFER_WRITE);
}