cancel
Showing results for 
Search instead for 
Did you mean: 

USB Mass Storage

luca239955_stm1
Associate II
Posted on May 31, 2006 at 16:49

USB Mass Storage

2 REPLIES 2
luca239955_stm1
Associate II
Posted on May 31, 2006 at 14:36

Hi all, I'm trying to develop a device belonging to the USB Mass Storage class using the STR7 USB Software libray.

My firmware seems to have problems with the GetMaxLun function. I started modifying the Mouse example.

In the file usp_prop I created the following function:

BYTE* Block_GetMaxLun(WORD Length)

{

//printf(''GetMaxLun %d\n\r'',Length);

if(Length == 0)return (BYTE*)1;

return (BYTE*)&Lun;

}

and I put this piece of code in Data_Setup(BYTE RequestNo)

if(RequestNo == GET_MAX_LUN)

{

CopyRoutine = Block_GetMaxLun;

}

The host continue sending me a GetMaxLun Message followed by a GET_STATUS message with wValue = 0 but wLength = 1 instead on 2! After to times i resets the hardware

Does anybody know what am I doing wrong???

best regards

Luca

luca239955_stm1
Associate II
Posted on May 31, 2006 at 16:49

Sorry for the errores I'll retype the message

Hi all, I'm trying to develop a device belonging to the USB Mass Storage class using the STR7 USB Software libray. I started modifying the Mouse example.

At the moment firmware seems to have problems with the GetMaxLun function.

The device have only one LUN.

In the file usp_prop.c I created the following function:

BYTE Lun; //Lun is zeroed in the reset routine

BYTE* Block_GetMaxLun(WORD Length)

{

if(Length == 0)return (BYTE*)1;

return (BYTE*)&Lun;

}

and I put this piece of code in Data_Setup(BYTE RequestNo)

if(RequestNo == GET_MAX_LUN)

{

CopyRoutine = Block_GetMaxLun;

}

The host continue sending to the device a GetMaxLun Message followed by a GET_STATUS message with wValue = 0 but wLength = 1 instead of 2! After two times the host sends a reset signal

Does anybody know what am I doing wrong???

best regards

Luca