2009-02-13 06:16 AM
Bulk Read Fail
2011-05-17 04:02 AM
So I've come to a bit of a roadblock. We are trying to do a Bulk Write and Read basing it off of the Mass Storage demo provided in um0424 and find that the Bulk Read interrupt is never triggered.
We used libUSB to create our driver and have been able to create a sample program to interface with our hardware. Our test setup is a write to a buffer, and then read back what we wrote. It consists of the following: 1. Matched the VID and PID on our sw and fw, hardware is detected just fine on plug in (also changed the device class to user specified 0xFF) 2. Defined and made sure that Endpoint Descriptor address’ match with sw and fw. 0x81 for EPIN, and 0x02 for EPOUT 3. Do a bulk write function in hardware and store that data in an array: (We Check if what we send from host to device is what we expect after PMAtoUSER() call. Write works and writes what we expect into an array/buffer, we are happy. 4. Try to do a bulk read function to readback what we just wrote in that array. Anyway, we are looking for some insight on why bulk read is failing. We tried: 1. Changing the IN endpoint address' 2. Reverting to the original Mass Storage files, only changing the usb_desc.c file to match our VID and PID. Read still fails. 3. Setting breakpoints in the IAR debugger. We set breakpoints before certain calls, but never see anything happen in the debugger when we run our sample application. Only thing that we've seen is a ''Cannot access Memory'' message in the KEIL debugger. The read interrupt is never being triggered, in fact, MassStorageIn() is never being called. We trace it back to the USBLib core files (usb_int.c) and check to see if it enters the block by Setting a GPIO/LED. We handle it the same exact way we do as the write, so we're not sure why write is being triggered and not the read. What we would like answered/help on: 1. Why isn't the read interrupt being triggered? 2. Pointers on properly using the IAR debugger to help us in figuring out #1