Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 1 month ago.
MSCFileSystem - Could not enumerate device: -1 ??
I have a lpc1768 & a mbed application board. Recently, I am trying to use MSCFileSytem to read/write file from USB memory stick (FAT). I tried the sample project : MSCUsbHost and have it compiled online, the bin file works fine on my lpc1768 and can access files from usb stick. My problem is, if I compile it offline and copy new bin file to lpc1768, it will stuck on function Host_EnumDev in MSCFIleSystem.cpp. with error message: (ALL leds on bottom twinkle)
================================ USB Mass storage demo program for mbed LPC1768 ================================ In Host_Init Initializing Host Stack Host Initialized Connect a Mass Storage device ERROR: In Host_EnumDev at Line 386 - rc = -1 Could not enumerate device: -1 List of files on the flash drive: Could not open directory!
I am using eclipse c/c++ IDE, win7, Cross ARM GCC and without any error during compiling.
10:34:42 **** Build of configuration Default for project MSCUsbHost **** make all Compiling FatFileSystem/option/ccsbcs.c Compiling main.cpp Compiling MSCFileSystem.cpp Compiling FatFileSystem/diskio.cpp Compiling FatFileSystem/FATDirHandle.cpp Compiling FatFileSystem/FATFileHandle.cpp Compiling FatFileSystem/FATFileSystem.cpp Compiling FatFileSystem/ff.cpp Compiling USBHostLite/usbhost_lpc17xx.cpp Compiling USBHostLite/usbhost_ms.cpp Compiling ../../src/gcc4mbed.c Linking LPC1768/MSCUsbHost.elf Extracting LPC1768/MSCUsbHost.bin Extracting LPC1768/MSCUsbHost.hex Extracting disassembly to LPC1768/MSCUsbHost.disasm text data bss dec hex filename 32804 640 1740 35184 8970 LPC1768/MSCUsbHost.elf - 10:34:53 Build Finished (took 11s.639ms)
How do I fix it? Thanks for any help.