Skip to main content
Visitor II
March 13, 2012
Question

Inprove the speed of the ''Mass storage'' as u disk

  • March 13, 2012
  • 15 replies
  • 3244 views
Posted on March 13, 2012 at 09:30

hello everybody,

  I was tested using the TF card as a U disk routines.The read speed is 500KB

-700KB / s, write speed of 100KB/ s. Too slow, I would like to increase its 

transmission speed.I will change the way of the USB to transfer data to double 

buffering, speed does not improve, I would like to speed transmission 

bottlenecks on the TF card flash, and do you have any good suggestions?(In 

this post I willcontinue to update content on the USB.)

    (The operation of the TF card SDIO,DMA, 4bit.)

#usb-sdio-tf-card #usb-tf-dma-sdio #usb-tf-card-sdio
    This topic has been closed for replies.

    15 replies

    Visitor II
    July 12, 2012
    Posted on July 12, 2012 at 11:18

    Hi,

    should I also update usb_bot.c file ? (Mass_Storage_In/Mass_Storage_Out)

    Tanks

    Graduate II
    July 12, 2012
    Posted on July 12, 2012 at 12:16

    Presumably if you wanted initial states correct it would be

    ClearDTOG_TX(ENDP1);
    ClearDTOG_RX(ENDP1);
    ToggleDTOG_RX(ENDP1);
    ClearDTOG_RX(ENDP2);
    ClearDTOG_TX(ENDP2);
    ToggleDTOG_TX(ENDP2);

    Now that's not to say you wouldn't need to change other parts of the code. It might take quite some effort, and understanding. The current release MSC code running on an STM32F4 USB-FS (12Mbps) card can read/write to an SD Card at 600/400 KBps. I'm not sure what your target rate is?

    http://www.wired.com/images_blogs/photos/uncategorized/2008/04/16/450_cp_tank_leopard_061jpg

    Visitor II
    July 12, 2012
    Posted on July 12, 2012 at 14:53

    Thanks clive for your Help, Yopu are Great;

    I'm working on V3.3.0 USB lib from ST, My aim is to implement a double buffering in MSC demo.

    1/ The bit toggling : is it the best way to measure Read/write speed ? I have to measure them before and after Double Bufferinh implementation to get #;

    2/ Can you please tell me if it is correct about Buffering adress in usb_conf.h:

    /* tx buffer base address for Double fuffering */

    #define ENDP1_BUFF0ADDR        (0x98)

    #define ENDP1_BUFF1ADDR        (0xD8)

    /* Rx buffer base address for Double fuffering */

    #define ENDP2_BUFF0ADDR        (0x118)

    #define ENDP2_BUFF1ADDR        (0x158)

    beacuse I have a strange behavi

    * On Reset Led1 On and the Off  (used for configuartion)

    * it takes about more than 10 s to the device for appearing as Removable in windows

    (not the case with simple buffer)

    3/ in usb_bot.c is this correct ?

    /*******************************************************************************

    * Function Name  : Bot_Abort

    * Description    : Stall the needed Endpoint according to the selected direction.

    * Input          : Endpoint direction IN, OUT or both directions

    * Output         : None.

    * Return         : None.

    *******************************************************************************/

    void Bot_Abort(uint8_t Direction)

    {

      switch (Direction)

      {

        case DIR_IN :

          SetDouBleBuffEPStall(ENDP1, EP_DBUF_IN);

          break;

        case DIR_OUT :

          SetDouBleBuffEPStall(ENDP2, EP_DBUF_OUT);

          FreeUserBuffer(ENDP2, EP_DBUF_OUT);

          break;

        case BOTH_DIR :

          SetDouBleBuffEPStall(ENDP1, EP_DBUF_IN);

          SetDouBleBuffEPStall(ENDP2, EP_DBUF_OUT);

          FreeUserBuffer(ENDP2, EP_DBUF_OUT);

          break;

        default:

          break;

    Tanks you very much

    Abdul

    Graduate II
    July 12, 2012
    Posted on July 12, 2012 at 18:39

    1) GPIO Toggling would give you some understanding of the time spent doing various things. For USB/MSC bandwidth testing I use a PC to read/write files that span several dozen MB, and later test some running 500-600 MB. Do large enough individual read requests that require multiple sectors, suggest 32KB (multiple of sector/cluster size, power of 2).

    2) Looks reasonable enough, basically floor-planning the memory, allocating 0x40 bytes to each.

    3) Don't know. I'm not sure if you need to stall specific buffers or the end point. The available examples don't have enough detail for me to be sure.

    http://www.wired.com/images_blogs/photos/uncategorized/2008/04/16/450_cp_tank_leopard_061202.jpg

    Visitor II
    July 12, 2012
    Posted on July 12, 2012 at 23:47

    Thank you