Wednesday, November 22nd 2017, 11:00pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

ievgen

Beginner

Date of registration: Aug 30th 2012

Posts: 2

1

Thursday, August 30th 2012, 1:46pm

emUSBH + emFS + emOS - low speed in USBH (MSD)

Hello!
I downloaded
Segger Eval Software (emFile, emWin, embOS/IP, embOS, emUSB-Device, emUSB-Host) for Keil MDK (tested with V4.50), install and run examples. I need use emUSBH + emFS + emOS for read and write some information on USB Stick (Mass Storage Device). I runed example OS_USBH_MSD.c and tested functionality this library. Test board KEIL MCB1700(LPC176).

I don't know why, when I write some text information in file TestFile.txt on USB stick it takes a lot time (about 7 seconds for 100 rows - 3kbyte).

Example code

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
static void _CreateFile(const char * sPath) {
  FS_FILE * pFile;
  char      ac[40];
  sprintf(&ac[0], "%s\\TestFile.txt", sPath);
  printf("\nCreating file %s...", ac);
  pFile = FS_FOpen(&ac[0], "w");
  if (pFile) {
    sprintf(ac, "1-2-3-4-5-6-7-8-9-0\r\n");
    for (i=0;i<100;i++) {
       FS_Write(pFile, ac, strlen(ac));
    }
    FS_FClose(pFile);
    printf("Ok\n");
  } else {
    printf("Failed. Could not create file\n");
  }
}




I think it must be more fast than 7 seconds. How set high speed? What i do incorrect?

ievgen

Beginner

Date of registration: Aug 30th 2012

Posts: 2

2

Friday, August 31st 2012, 3:31pm

speed write in file with USBH + embOS + emFS

Hello!



I found in documentation function FS_SetFileWriteMode(FS_WRITEMODE_FAST). With this function write in file is faster then without this function (about 4 sec = 1Mb). But it also not fast. In documentation write that speed must be about 800kb/sec (32 - bit CPU running 72MHz). But I have only 256 kbyte/sec whith CPU lpc1768 100MHz.

What can I do for send by USB in high speed? What settings I need set in embOS or USBH or emFS?

Help, please.

Thanks!