|
发表于 2013-8-3 07:12:21
|
显示全部楼层
INT32 MS_BulkRecv ( UINT32 block_number,
UINT16 num_blocks,
volatile UINT8 *user_buffer)
{
INT32 rc;
int i;
volatile UINT8 *c = user_buffer;
for (i=0;i<MS_BlkSize*num_blocks;i++)
*c++ = 0;
Fill_MSCommand(block_number, MS_BlkSize, num_blocks, MS_DATA_DIR_IN, SCSI_CMD_READ_10, 10);
rc = Host_ProcessTD(EDBulkOut, TD_OUT, TDBuffer, CBW_SIZE); //返回正确
if (rc == OK) {
rc = Host_ProcessTD(EDBulkIn, TD_IN, user_buffer, MS_BlkSize * num_blocks); //返回偶尔正确(会返回0xffffffff)
if (rc == OK) {
rc = Host_ProcessTD(EDBulkIn, TD_IN, TDBuffer, CSW_SIZE);//这里会死在void Host_WDHWait (void)这个里头
if (rc == OK){
if (TDBuffer[12] != 0) {
rc = ERR_MS_CMD_FAILED;
}
}
}
}
return (rc);
}
///////////////////////////
搞了好长时间都不知道是怎么回事,枚举或者MS_Init(&blkSize,&numBlks,inquiryResult);这些都是对的,但为什么会死在这里呢,
按8楼的兄弟那样式了,还是不行,
谢谢各位了 |
|