We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I have a problem with ioc_read_sect function. When its called in usbd_msc_read_sect it rerurns __FALSE. When i am trying to call it in main, after ioc_init, it returns __TRUE, and FAT table is entered into the temporary buffer. What am i doing wrong? I am using STM32F103RDT6 microcontroller n custom PCB.
Thanks for answers! Kuba
usbd_msc_read_sect function:
void usbd_msc_read_sect (U32 block, U8 *buf, U32 num_of_blocks) { static BOOL result; if (USBD_MSC_MediaReady) { /* SD card */ result = ioc_read_sect (block, buf, num_of_blocks, mc0); /* Internal memory image */ //memcpy(buf, &Memory[block * USBD_MSC_BlockSize], num_of_blocks * USBD_MSC_BlockSize); } } Manually called ioc_read_sect: mc0 = ioc_getcb (""); if (mc0!=NULL){ ioc_init_d=ioc_init (mc0); if (ioc_init_d == 0){ ioc_read_info (&info_mc0, mc0); } }
result = ioc_read_sect (block, bufo, num_of_blocks, mc0);