Skip to main content
Visitor II
May 31, 2006
Question

USB Mass Storage

  • May 31, 2006
  • 2 replies
  • 722 views
Posted on May 31, 2006 at 16:49

USB Mass Storage

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 31, 2006
    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

    Visitor II
    May 31, 2006
    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