Author Topic: THUMB DRIVE WRITE PAUSE  (Read 9486 times)

avais20

  • Member
  • ***
  • Posts: 3
THUMB DRIVE WRITE PAUSE
« on: March 24, 2013, 03:59:30 pm »
Hi,

I made a serial to USB dataloger , which logs successfully upto 460kbps to a USB disk.
Originally i used Microchip USB host stack. I am using PIC32mx440f512.
The problem is that  at some points during logging the USB disk takes about 200 to 400milliseconds
to store a buffer of 10240 Bytes.  While otherwise the time is less then 100ms.
In order to increase write speed i implemented FatFs and also implemented Multisector write
advised by Sr. Tsuneo. This improved the write time to 30milli seconds. But still the
200 to 400ms  arbitrary pause is unresolved.
Can some one point to the exact cause of this delay? It is too large to buffer anyway.

Avais

nvd

  • Member
  • ***
  • Posts: 42
Re: THUMB DRIVE WRITE PAUSE
« Reply #1 on: March 25, 2013, 12:40:03 am »
To make sure that the USB disk you are using, One suggestion would to connect it to Windows or other host, and see that data traffic using analyzer.
This will make sure that the USB disk itself is not a problem.

With your host does the 200-400msec delay happen at particular sector or range of sectors? that might give some hints.
May be trying different sector sizes can give some hints.

avais20

  • Member
  • ***
  • Posts: 3
Re: THUMB DRIVE WRITE PAUSE
« Reply #2 on: March 25, 2013, 09:13:50 am »
Hi ,

I am attaching an image in which the orange trace clearly shows the dips in write speed.
It happens on other disks also. I need to know what is causing this delay and how to
overcome this.

[attachment deleted by admin]

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: THUMB DRIVE WRITE PAUSE
« Reply #3 on: March 25, 2013, 10:25:21 am »
Sound like the write pause is caused by FLASH erase period on the USB sticks.

Unlike (micro-)SDHC cards, USB sticks don't have any speed class spec, which guarantees minimum sustained write speed. You may get better performance using a compact USB card reader with a micro-SDHC, instead of USB sticks.

Tsuneo

avais20

  • Member
  • ***
  • Posts: 3
Re: THUMB DRIVE WRITE PAUSE
« Reply #4 on: March 25, 2013, 10:55:35 am »
Dr. Tsuneo,

First of all i want to thankyou for replying  to my post. I have found you advice
most valuable in Microchip and LVR forums.

If the USB disk is freshly formatted and there is only one text file on the stick in
which data is being written , will there still be a Flash Erase Pause? Can i pre erase
the whole disk?

I  have used a datalogger which is able to successfully write to the same usb stick
without errors and it also uses the same chip PIC32MX440F512H and there is no
extra memory on this logger.


Thanks

Avais

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: THUMB DRIVE WRITE PAUSE
« Reply #5 on: March 26, 2013, 03:09:14 am »
Quote
If the USB disk is freshly formatted and there is only one text file on the stick in which data is being written , will there still be a Flash Erase Pause? Can i pre erase
the whole disk?

Wear leveling, which controls FLASH erase, works independently from file system on the USB stick. Deleting files, directories / formatting the drive don't result in bulk erase of the FLASH.

Select a USB stick of short response, or move to (micro-)SDHC.

Tsuneo