下面是USB库的SCSI的其中一个功能函数: void SCSI_ReadCapacity10_Cmd(u8 lun) { if (MAL_GetStatus(lun)) { Set_Scsi_Sense_Data(CBW.bLUN, NOT_READY, MEDIUM_NOT_PRESENT); Set_CSW (CSW_CMD_FAILED, SEND_CSW_ENABLE); -------------------------(1) Bot_Abort(DIR_IN); --------------------------------------------------------------(2) return; } ReadCapacity10_Data[0] = (u8)(Mass_Block_Count[lun] - 1 >> 24); ReadCapacity10_Data[1] = (u8)(Mass_Block_Count[lun] - 1 >> 16); ReadCapacity10_Data[2] = (u8)(Mass_Block_Count[lun] - 1 >> 8); ReadCapacity10_Data[3] = (u8)(Mass_Block_Count[lun] - 1); ReadCapacity10_Data[4] = (u8)(Mass_Block_Size[lun] >> 24); ReadCapacity10_Data[5] = (u8)(Mass_Block_Size[lun] >> 16); ReadCapacity10_Data[6] = (u8)(Mass_Block_Size[lun] >> 8); ReadCapacity10_Data[7] = (u8)(Mass_Block_Size[lun]); Transfer_Data_Request(ReadCapacity10_Data, READ_CAPACITY10_DATA_LEN); } 上面红色部分,(1)句发送CSW, (2)句就立刻中止In端口, 这里到底是想发送还是不发送??????? 如果是想发送, 那这里就是BUG; 如果是不想发送, 为什么不直接用Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); 呢???? |
stm32 USB的CDC类传输掉数据
STM32F105 USB接收数据不断进入中断,出现“死机”现象
关于STM32CubeMX配置的USB例程电脑无法识别问题
STM32F407 USB-HS-OTG是否不外接PHY可以做虚拟串口?
如何做一个USB从机键盘用stm32f407
用STM32F4 Cube MX生成的USB Device C代码的BUG
USB Device + FatFS + SDIO 模拟U盘意外只读问题
USB Device + FatFS + SDIO 问题
STM32H7配置成USB DEVICE时,连接电脑时不进入中断
STM32F446 USB和串口1 冲突