I am testing out the usb mass storage function on the AD527 EZ-KIT and I find that the return value for the SCSI READ CAPACITY command is way to large for the 8Megabyte setting the application is supposed to provide.
For 8Megabytes I would expect a value around 0x4000, but the returned value and the value stored in the blackfin memory is 0x003ffffe.
Either there is an memory address offset problem (there is alot of EndianSwap here), or the initialization is not correct. This is what I have from the library adi_usb_msd_scsi.c file (version 5 with update 7).
pDevice->MediaInfo.SizeInSectors = adi_usb_msd_max_memory_size/pDevice->MediaInfo.SectorSize;
pDevice->MediaInfo.FirstUsableSector = 0;
pDevice->MediaInfo.SectorSize = MSD_BLOCK_SIZE;
*(u32 *)(&adi_msd_ReadCapacityReport) = EndianSwap ((pDevice->MediaInfo.SizeInSectors - 1));
*(u32 *)(&adi_msd_ReadCapacityReport) = EndianSwap (pDevice->MediaInfo.SectorSize);
/* Initialize and setup the Format Capacity Report */
Note that Sector size is initialized after SizeInSectors is computed.
Can someone provide instruction on how to rebuild a single library (I am new to visualDSP).