AnsweredAssumed Answered

BF548 EZ-KIT Lite - Add support for second ATAPI harddisk

Question asked by MichaelD on Apr 8, 2010
Latest reply on Apr 30, 2010 by MartinK

Hello all!

 

I have connected two harddisks to the ATAPI-Interface of the BF548 EZ-KIT. Now I wonder how to add support for the second disk through the FSS-service. Both of my harddisks are FAT32 partioned and one is jumpered as master, the other one is jumpered as slave.

I have tried to initialize the ATAPI-driver through the FSS-Service as follows:

 

/*******************************************************************
* InitFileSystem
*       Initializes the File System Service for use and adds it to the
*       C runtime extensible I/O table to make it the default for
*       the standard C I/O functions.
*******************************************************************/

u32 InitFileSystem(void)
{
    u32 Result;
    
    /*******************************************************************
    * Customized heaps for General, fat and atapi 'cache' type data
    *******************************************************************/
    int GeneralHeapID = heap_lookup(1);
 
    ADI_DEV_CMD_VALUE_PAIR ATAPI_ConfigTable [] = { 
 
     { ADI_PID_CMD_SET_NUMBER_DEVICES, (void*)2 }, 
 
     { ADI_PID_CMD_MEDIA_ACTIVATE, (void*)1 }, 
 
     { ADI_DEV_CMD_END, NULL }, 
 
    };
 
    ADI_ATAPI_Def.pConfigTable = ATAPI_ConfigTable;
 
    
    /*******************************************************************
    * Configuration table to initialize the FSS
    *******************************************************************/
    ADI_FSS_CMD_VALUE_PAIR adi_fss_Config[] = {
 
        /* Set up File Cache Size */
        //{ ADI_FSS_CMD_SET_NUMBER_CACHE_BLOCKS,  (void*)2 },
        { ADI_FSS_CMD_SET_NUMBER_CACHE_BLOCKS,    (void*)8 },
 
        /* Set up Heap Index of the FSS General Heap */
        { ADI_FSS_CMD_SET_GENERAL_HEAP_ID,        (void*)GeneralHeapID },
 
        /* Register the ATA/ATAPI interface driver */
        { ADI_FSS_CMD_ADD_DRIVER,                 (void*)&ADI_ATAPI_Def },
 
        /* Register the FAT File System driver */
        { ADI_FSS_CMD_ADD_DRIVER,                 (void*)&ADI_FAT_Def },
 
        /* Assign the DMA Manager Handle */
        { ADI_FSS_CMD_SET_DMA_MGR_HANDLE,         (void*)adi_dma_ManagerHandle },
 
        /* Assign the Device Manager Handle */
        { ADI_FSS_CMD_SET_DEV_MGR_HANDLE,         (void*)adi_dev_ManagerHandle },
 
        /* Assign the DCB Queue Handle */
        { ADI_FSS_CMD_SET_DCB_MGR_HANDLE,         (void*)adi_dcb_QueueHandle },
 
        /* Command Table Terminator */
        { ADI_FSS_CMD_END,                        (void*)NULL }
    };
 
 
    /* Initialize the file system service */
 
    Result = adi_fss_Init ( adi_fss_Config );
 
 
    /* Add to C runtime device table - which will make it the default - so we
       can use fopen(), fread(), ..., to access files on the Hard disk
    */
    if (!Result) {
        Result = add_devtab_entry( &adi_fss_entry );
    }
        
 
    // add_devtab_entry returns negative error code or device ID
    return (Result > 0) ? 0 : Result;
}

This results in hanging up the application on initialization of the second harddisk.

If I connect only one of the disks to the EZ-KIT they work fine.

 

So are there any other things I have to do to use two harddisks on the ATAPI interface through the FSS-driver?

 

Thanks,

Michael

Outcomes