Duggle Posted December 26, 2011 Report Share Posted December 26, 2011 Hi, I'm using the mass storage driver similar to the example msd example, so that files on the sd card may be accessed at any time simply by plugging in a computer host via usb. Is it possible to (I assume a semiphore is required) simultaneously access files by my mios32 application? I'm about to experiment using FILE_ functions <file.h> for file i/o. I thought I'd ask the question. I'm kind of thinking that the app will need a switch to control which part has sd card file access enabled external_host<->app. It would be nice if they could both have access to files any time. thx. Quote Link to comment Share on other sites More sharing options...
TK. Posted December 26, 2011 Report Share Posted December 26, 2011 Unfortunately semaphores won't work, as the MSD driver handles SD Card accesses from an interrupt service routine. Semaphores can only be used for FreeRTOS tasks. I don't see a solution without overworking the USB and MSD driver. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted December 26, 2011 Author Report Share Posted December 26, 2011 Thanks TK, I'll use a pushbutton toggle with LED to switch between MSD (when USB is connected to a host) and internal sd card usage. Quote Link to comment Share on other sites More sharing options...
TK. Posted December 26, 2011 Report Share Posted December 26, 2011 Alternatively MSD mode could be enabled via the MIOS Terminal. I've added a "msd on" command to all major applications meanwhile, see http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidio128_v3%2Fsrc%2Fterminal.c as an example (search for "msd") Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted January 7, 2012 Author Report Share Posted January 7, 2012 Ive implemented this in my program from your code,TK. The problem I've found with this, is when I type "msd on", I can't then type "msd off" (or anything) because the USB midi is off. If I use MIOS Studio through GM5 on the PC ( and init with MIOS32_MIDI_DebugPortSet(UART0);) I have control as expected. This is a pity because the faster uploading of code using USB is nice as well as the possibility of using the core with wireless usb link: I think I heard that this is not a limitation with Mac (MIDI + COM +MSD at the same time)? Quote Link to comment Share on other sites More sharing options...
TK. Posted January 7, 2012 Report Share Posted January 7, 2012 Ca. two years ago, where I tried to combine MIDI+COM, it worked under MacOS, but caused a blue screen under Windows. Meanwhile this combination is not working under MacOS anymore, I'm not sure why but haven't spent much debugging effort for this topic since this is a very exotic usecase anyhow. I don't think that a MIDI+MSD combination will work in parallel, especially because it seems that Windows can only assign a single driver to a USB port. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted January 7, 2012 Author Report Share Posted January 7, 2012 I think the answer for me at least is to implement a "msd on nn" where nn is number of minutes after which the core reverts back to USB midi. This way I can edit a config or transfer a file etc, but then regain control over the core via USB midi! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.