Combining both USB and SD card libraries

07 Jan 2014

Hi ,

I am trying to integrate the USB and SD card libraries to build an application on LPC1768 platform. I am unable to combine both the libraries. I have the USB data read write program from the cook book. Many functions have the same names in both SDFilesystem and FATfilesystem libraries. The same functions have different definitions in both the libraries. Please help me out.

Thanks , Ajit

07 Jan 2014

Do you want to combine it with USBHost, so you can both read/write from an SD card and from a USB flash drive, or do you want to combine it with USBDevice, so you can read/write from an SD card and also access it from your PC as a USB mass storage device?

If the first, it should just work by including both. If you mean the second one, have a look at: http://mbed.org/users/Sissors/code/USBFileSystem/.

Regarding same name in SDFileSystem and FATFileSystem, you don't need FATFilesystem since it is already included in SDFilesystem. If you meant same in SD and USB libraries, correct, but there the have the same function also. Anyway the USBFileSystem library handles all that.

07 Jan 2014

Hi Erik,

Thank you for the response. USB meaning a separate USB mass storage on to which I need to write/read data. I want to write some data continuously to both SD card and USB mass storage device. This USB mass storage device would be taken out from the board and the data needs to be stored in some PC. Same applies with SD card.

Thanks, Ajit

07 Jan 2014

So then we are talking about the first one: USB flash drive + SD card connected to your mbed. Then you should just be able to include both standard libraries in your program, and you should be able to write to both.

07 Jan 2014

I did but there s a conflict of functions

29 Mar 2014

I've got the same problem, Ajit. It seems that only putting both libraries together isn't the solution to work with SD card and USBmsd at the same time. I've noticed that when I remove the "SDFileSystem sd(p5, p6, p7, p8,"sd");", the USB can work, but when I add this line and the SD functions, an error on creating the FATsystem for USB occurs. Have you managed to solve the problem?