cancel
Showing results for 
Search instead for 
Did you mean: 

[STR711]USB Mass storage device with an external Flash memory

gfr
Associate II
Posted on July 22, 2007 at 23:37

[STR711]USB Mass storage device with an external Flash memory

9 REPLIES 9
gfr
Associate II
Posted on July 05, 2007 at 13:15

Hello

I'm using STR711 and an external flash !

I'm trying to use USB Mass Storage Device program of the USB dev Kit (UM0290) with the external flash memory but I dont understand which functions I need to modify to communicate with flash memory instead of Ram memory !

I tried to modify Write_Memory function and, UserToPMABufferCopy and PMAToUserBufferCopy functions used by Read_Memory function but it didnt work. I'm not sure of what I've done ,and code explanations and UM0290 User manual are not sufficient for me to understand what to do !!

Can you help me ?!

Thanks in advance

[ This message was edited by: Gregfox on 05-07-2007 18:07 ]

kleshov
Associate II
Posted on July 05, 2007 at 16:35

You should read the datasheet for your external flash memory chip. It will explain how to erase and program it. By the way, not all flash memories have small enough page size to be usable as USB mass storage device.

gfr
Associate II
Posted on July 06, 2007 at 07:41

Thanks but I used already the memory flash before using Mass storage device so I programmed a driver which works well ! My question is more about changes I need to do on Mass Storage device program : which functions need to be rewriten ?

anis2399
Associate II
Posted on July 16, 2007 at 12:50

Hi Gregfox;

Your flash should be a NAND flash... The NOR flash have a big block size and it's dedicated for code storage and not data storage...

In the STR710 mass storage demo I think you have just to modify the following functions:

-> Get_Medium_Characteristics(): (file hw_config.c) in this function you should add the protocol to get the size of your NAND flash and the related block size (512 or 2Kbyte)...

-> Read_Memory(): (file memory.c)add your firmware to read from the NAND

-> Write_Memory ():(file memory.c)add your firmware to write from the NAND.

Note: the two functions Read_Memory & Write_Memory are called every 64 bytes received or send from/to the host, so you should manage the transfer using for example a temporary buffer with the size of your NAND block (512 or 2K)...

Regards...

Richard

gfr
Associate II
Posted on July 16, 2007 at 14:45

Hi Richard

I used a Serial Flash (SST25VF010A)with CMOS SuperFlash Technology from SST :

- 4 KByte sectors

- 32 KByte blocks

Do you think that it's possible to use mass storage device ?

I changed the functions (Get_Medium_Characteristics(), Write_Memory ()and I copied and modified UserToPMABufferCopy() to change Read_Memory()) , and it doesnt work but maybe I maid mistakes.

I dont understand what you mean by using a temporary buffer to manage the transfer! Can you give some explanations ?

Thanks for your help

Gregfox

suixingzhu
Associate II
Posted on July 20, 2007 at 06:31

Hello

I'm using STR711

I'm trying to use USB Mass Storage Device program of the USB dev Kit (UM0290) to transfer something,but I have some troubles

When the USB cable is plugged in Windows does not recognize the device and does not recognoze the device driver provided for windows. I really could use some advice on where to go forward. I am currently compiling under the Green Hills enviroment with the a Hitex Board with a STR710 chip

here is the snipet of code

void MASS_init()

{

pInformation->Current_Configuration = 0;

/* Connect the device */

PowerOn();

/* USB interrupts initialization */

_SetISTR(0); /* clear pending interrupts */

wInterrupt_Mask = IMR_MSK;

_SetCNTR(wInterrupt_Mask); /* set interrupts mask */

pInformation->Current_Feature = MASS_ConfigDescriptor[7];

/* Wait until device is configured */

while (pInformation->Current_Configuration == 0) NOP_Process();

bDeviceState = CONFIGURED;

}

How can I modify the program??

Thanks

suixingzhu
Associate II
Posted on July 22, 2007 at 23:37

Hello

I'm using STR711

I'm trying to use USB Mass Storage Device program of the USB dev Kit (UM0290) to transfer something,but I have some troubles

When the USB cable is plugged in Windows does not recognize the device and does not recognoze the device driver provided for windows. I really could use some advice on where to go forward. I am currently compiling under the Green Hills enviroment with the a Hitex Board with a STR710 chip

here is the snipet of code

void MASS_init()

{

pInformation->Current_Configuration = 0;

/* Connect the device */

PowerOn();

/* USB interrupts initialization */

_SetISTR(0); /* clear pending interrupts */

wInterrupt_Mask = IMR_MSK;

_SetCNTR(wInterrupt_Mask); /* set interrupts mask */

pInformation->Current_Feature = MASS_ConfigDescriptor[7];

/* Wait until device is configured */

while (pInformation->Current_Configuration == 0) NOP_Process();

bDeviceState = CONFIGURED;

}

How can I modify the program??

Thanks

simon2399
Associate II
Posted on April 07, 2014 at 10:50

Hi,

Did you ever get the USB to work ?

If so how ?

I have the same problem.

Regards

Simon

Posted on April 11, 2014 at 02:14

Please observe you are posting to a thread that is almost seven years old, to participants of a prior incarnation of the forum. It is highly improbable that they visit the STR7 forum any more.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..