Hello,
I use the Evalboard MCB4300 and µVision 5.14 MDK-ARM Professional. Is it possible to initialize MCI0 to read/write to an SD-Card using fopen()..fwrite()..fclose(), AND also allow the user to use the SD-card as a mass storage device via USB? (access not at the same time, user selects when the USB-connection is alive) ?
I'm trying to do this, but currently it does not work, but I also do not get any errors from the functions I call. I call fopen(), fwrite() fputc(), fclose() without errors, but afterwards the file on the sdcard has not changed. All function calls return without an error (fwrite(), USBD_Initialize(0),USBD_Connect(0),...) Access to the card from USB works fine.
Am I doing something wrong, or is this basically not supported?
What's wrong with this:
finit("M0:"); fmount("M0:"); f=fopen("M0:test1.txt","a"); fputs("Hello!", f); fclose (f); funmount ("M0:"); funinit("M0:"); => file is correct on SDCard
stat=finit ("M0:"); // init again => stat=7(fsDriverError) : why?
Later in the code there would follow calls to ustat=USBD_Initialize (0); /* USB Device 0 Initialization */ ustat=USBD_Connect (0);
Thank you.
Gunnar, you found the solution to that problem. Please note that we have implemented the Media Ownership control in the Middleware 6.3.0
Refer also to: www.keil.com/.../group__usbd__msc_functions.html under headline: Media Ownership
Let us know if you have further questions. Reinhard