hello kerryzhou
i want to show my SD as a MSD using SPI protocol.
here i attach my implementation.
first i enable SD_CARD_APP function (Macro).
then i set block_no and block_size
case USB_MSC_DEVICE_GET_INFO:
device_lba_info_ptr = (device_lba_info_struct_t*) size;
#if RAM_DISK_APP
device_lba_info_ptr->total_lba_device_supports = TOTAL_LOGICAL_ADDRESS_BLOCKS_NORMAL;
device_lba_info_ptr->length_of_each_lab_of_device = LENGTH_OF_EACH_LAB;
#elif SD_CARD_APP
#if (OS_ADAPTER_ACTIVE_OS == OS_ADAPTER_SDK)
device_lba_info_ptr->total_lba_device_supports = 63;
device_lba_info_ptr->length_of_each_lab_of_device = 512;
now i change read_request and write_request and send_data complete event in usb_class_callback
case USB_MSC_DEVICE_READ_REQUEST:
lba_data_ptr = (lba_app_struct_t*) size;
#elif SD_CARD_APP
returnCode=MMCReadSingleBlock(lba_data_ptr->offset >> SDCARD_BLOCK_SIZE_POWER,&buffer_s);
USB_PRINTF("RC:%d",returnCode);
g_msc_bulk_in_buff=buffer_s;
if(data != NULL)
{
*data = g_msc_bulk_in_buff;
}
lba_data_ptr->buff_ptr = g_msc_bulk_in_buff;
is it true?
i just run the project with this edition there are create disk and ask for format. when i apply to format format is not completed.
my question is that what should i do for stop format disk and show sd data to that disk instead of RAM.