Hello experts, I have been testing the Mass Storage example for the MCB2140 and found some strange behaviour. Example, the storage shows 14kB of space but if I try and copy a 3kB txt file the board crashes. File transfers appear to be limited to 1kB at a time? In addition I attempted to modify the example so that the storage was based on SPI FLASH. I copied the Disk Image to the Flash and redirected the MSC_MemoryRead/Write command to FLASH. Reading works fine and the test file appears in windows explorer. But writing fails due to some timing constraint. This timing problem can be recreated by just putting a small delay inside the MSC_MemoryWrite function of the example code. {int counter = 200; while(counter--);} My thoughts are that the Mode Sense(6) command as not been implemented so no Flexible disk page data is offered giving transfer rate caperbility. Would appreciate your experiences on this. Many thanks, Malcom
It depends what demo code you are talking about. The USB Mass storage device example that Keil wrote has no handling for formatting media. This command is part of the SCSI 3 specification which is a seperate layer from the USB handling. The MSC write problem is a different problem. SCSI spec includes a Read Format command where you are given the opportunity to tell windows about the media, specifying access time and spool time. Sending the correct information to this command would prevent windows from timing out the write command so quickley but you could fudge it by reading the data into a buffer and stalling the endpoint whist you deal with it. Keil said some time ago that they had fixed the access problem but the current demo code still has the same problem. They also said that some FAT/MMC code for the MCB2140 dev board would be available in October so I guess that are busy fixing the problems as their MMC code wont work either. Either way, good luck. Malcom