8 years, 3 months ago.

USBDevice & USBMSD_SD

Having just updated the USBDevice library because of strange compilation error (on code that was working only a few days ago) USBMSD_SD will no longer work - what is going on? Anyone managing to get MSD on an SD card working with current libraries?

2 Answers

7 years ago.

No have not managed to get this working. This is typical of mbed, Code that works when it was written against current libraries soon seems to stop working as mbed is further developed. I've given up.

7 years ago.

Try this updated USBMSD_SD library:

Import libraryUSBMSD_SD

USB Mass Storage Device with SD card, updated with block count for compatibility with latest USB library

It works in this example on the MAX32630FTHR platform:

Import programFTHR_USBMSD_Demo

USB Mass Storage Device demo with SD card

Thanks Greg. I had found that problem (count args) earlier on in my dealing with USMMSD_SD. I'm compiling for STM32F4 and using Seeed Arch Max as mbed target. When connecting board to PC via usb cable Device Manager displays that its found USB Mass Storage Device but after a further 10 secs or so I then get a yellow ! mark and when clicking I get the device could not start (code 10) message. I've done some debugging within coide 1.78. It seems the inquiry request fails. I don't know why. The PC driver does send CBWs and these are decoded by USBMSD but still it fails. Also diskRead() and diskWrite() are never called so it doesn't seem to get that far. All a bit inconclusive.

posted by Bob Kendrick 28 Feb 2017

Hi Greg, thank you for the very helpful librairies and hints. When compiling the USBMSD library, i get the following error:

Error: Argument of type "std::uint32_t" is incompatible with parameter of type "irq_fn" in "USBDevice/USBDevice/USBHAL_Maxim.cpp", Line: 144, Col: 31

Same error with USB_Serial example.

NVIC_SetVector(USB_IRQn, (uint32_t)&_usbisr);

Thank you !

posted by Joe Lumpanda 19 Oct 2017

Matt, please note that some changes to the mbed libraries have created some compatibility issues. The FTHR_USBMSD_Demo is now updated so it will work with mbed-os 5.6.2

posted by Greg Steiert 19 Oct 2017