2006-05-31 07:49 AM
2006-05-31 05:36 AM
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 Luca2006-05-31 07:49 AM
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