ST官方的大容量存储设备的例程你有吧,没有的话从官网上下。例程里实现的是一个U盘。
你在例程里找到Standard_Inquiry_Data这个数组,按我的数组修改一下,其他地方可能需要修改,你需要单步调试才能发现。时间久了我只记得这个修改是必须的。
uint8_t Standard_Inquiry_Data[] =
{
0x05, /* Direct Access Device */----05是光盘,00是U盘。
0x80, /* RMB = 1: Removable Medium */
0x02, /* Version: No conformance claim to standard */
0x02,
36 - 4, /* Additional Length */
0x00, /* SCCS = 1: Storage Controller Component */
0x00,
0x00,
/* Vendor Identification */
'H', 'K', 'R', 'T', ' ', ' ', ' ', ' ',
/* Product Identification */
'2', 'M', ' ', 'F', 'l', 'a', 's', 'h', ' ',
'D', 'i', 's', 'k', ' ', ' ', ' ',
/* Product Revision Level */
'1', '.', '0', ' '
};
|