Hi
I am using a STM32F4xx part. One part of the application makes use of the USB-MSC functionality (the ST supplied USB lib modified to run the RTX) using the Keil supplied SD/SDIO MMC Interface Driver for ST STM32F4xx. The SD routines ioc_read_sect, ioc_write_sect etc - all work fine. The whole USB device mode MSC functionality all works - no problems there.
Additionally I also want to use the Keil file I/O routines - ffind, fopen,fgets etc. My startup looks like this
FAT_VI *mc0; /* FAT Media Control Block */ Media_INFO info; /* Media information */ __task void init (void) { t_UsbdDataOutTask = os_tsk_create (UsbdDataOutTask, 4); t_UsbdDataInTask = os_tsk_create (UsbdDataInTask, 4); t_UsbdSetupStageTask = os_tsk_create (UsbdSetupStageTask, 4); t_UsbdDeviceTask = os_tsk_create (UsbdDeviceTask, 6); finit (NULL); mc0 = ioc_getcb (NULL); if (ioc_init (mc0) != 0) { } ioc_read_info (&info, mc0); USBD_Init(&USB_OTG_dev,USB_OTG_FS_CORE_ID,&USR_desc,&USBD_MSC_cb,&USR_cb); t_LedTickTask = os_tsk_create (LedTickTask, 2); t_MallocFreeTask = os_tsk_create (MallocFreeTask, 4); t_LedDspQTask = os_tsk_create (LedDspQTask, 5); t_LedDspTimerTask = os_tsk_create (LedDspTimerTask, 5); t_ShowTimeTask = os_tsk_create (ShowTimeTask, 5); t_SpinImageLoaderTask = os_tsk_create (SpinImageLoaderTask, 5); os_tsk_delete_self (); }
When I compile and run my app - the USB MSC functionality all works - but all SD disk - file I/O routines fail - ffind, fopen,fgets etc.
If I take out this code
mc0 = ioc_getcb (NULL); if (ioc_init (mc0) != 0) { } ioc_read_info (&info, mc0);
then the file I/O routines all work - but the USB MSC functionality does not.
My question is simple - how do I make both work - if possible?
Thanks Peter