We are facing some trouble while evaluating the USB host application for emUSB. When we connect the USB we get following error
We are trying to use the following application "USB_MSD_FS_WriteOnDisconnect.c"
This error come once it executes the following piece of code
=================================================================================
/*********************************************************************
*
* _AddMSD
*
* Function description
* Add mass storage device to USB stack
*
* Notes:
* (1) - This examples uses the internal driver of the file system.
* The module intializes the low-level part of the file system if necessary.
* If FS_Init() was not previously called, none of the high level functions
* such as FS_FOpen, FS_Write etc will work.
* Only functions that are driver related will be called.
* Initialization, sector read/write, retrieve device information.
* The members of the DriverData are used as follows:
* DriverData.pStart = VOLUME_NAME such as "nand:", "mmc:1:".
* DriverData.NumSectors = Number of sectors to be used - 0 means auto-detect.
* DriverData.StartSector = The first sector that shall be used.
* DriverData.SectorSize will not be used.
*/
static void _AddMSD(void) {
static U8 _abOutBuffer[USB_MAX_PACKET_SIZE];
USB_MSD_INIT_DATA InitData;
USB_MSD_INST_DATA InstData;
InitData.EPIn = USB_AddEP(1, USB_TRANSFER_TYPE_BULK, USB_MAX_PACKET_SIZE, NULL, 0);
InitData.EPOut = USB_AddEP(0, USB_TRANSFER_TYPE_BULK, USB_MAX_PACKET_SIZE, _abOutBuffer, USB_MAX_PACKET_SIZE);
USB_MSD_Add(&InitData);
//
// Add logical unit 0: Use default device.
//
memset(&InstData, 0, sizeof(InstData));
InstData.pAPI = &USB_MSD_StorageByName;
InstData.DriverData.pStart = "";
USB_MSD_AddUnit(&InstData);
}
==================================================================================
the panic occurs as last line of the above piece of code i.e.
USB_MSD_AddUnit(&InstData);
Though the same USB works for other FAT demo code from EA LPC 2478 board vendor but the Segger doesn't work.
Can you explain what might be going wrong
Regards,
Satyajit
void FS_X_Panic(int ErrorCode) {
FS_USE_PARA(ErrorCode);
while (1);
}
With Errorcode "1".
FS_USE_PARA(ErrorCode);
while (1);
}
With Errorcode "1".
We are trying to use the following application "USB_MSD_FS_WriteOnDisconnect.c"
This error come once it executes the following piece of code
=================================================================================
/*********************************************************************
*
* _AddMSD
*
* Function description
* Add mass storage device to USB stack
*
* Notes:
* (1) - This examples uses the internal driver of the file system.
* The module intializes the low-level part of the file system if necessary.
* If FS_Init() was not previously called, none of the high level functions
* such as FS_FOpen, FS_Write etc will work.
* Only functions that are driver related will be called.
* Initialization, sector read/write, retrieve device information.
* The members of the DriverData are used as follows:
* DriverData.pStart = VOLUME_NAME such as "nand:", "mmc:1:".
* DriverData.NumSectors = Number of sectors to be used - 0 means auto-detect.
* DriverData.StartSector = The first sector that shall be used.
* DriverData.SectorSize will not be used.
*/
static void _AddMSD(void) {
static U8 _abOutBuffer[USB_MAX_PACKET_SIZE];
USB_MSD_INIT_DATA InitData;
USB_MSD_INST_DATA InstData;
InitData.EPIn = USB_AddEP(1, USB_TRANSFER_TYPE_BULK, USB_MAX_PACKET_SIZE, NULL, 0);
InitData.EPOut = USB_AddEP(0, USB_TRANSFER_TYPE_BULK, USB_MAX_PACKET_SIZE, _abOutBuffer, USB_MAX_PACKET_SIZE);
USB_MSD_Add(&InitData);
//
// Add logical unit 0: Use default device.
//
memset(&InstData, 0, sizeof(InstData));
InstData.pAPI = &USB_MSD_StorageByName;
InstData.DriverData.pStart = "";
USB_MSD_AddUnit(&InstData);
}
==================================================================================
the panic occurs as last line of the above piece of code i.e.
USB_MSD_AddUnit(&InstData);
Though the same USB works for other FAT demo code from EA LPC 2478 board vendor but the Segger doesn't work.
Can you explain what might be going wrong
Regards,
Satyajit