I am using usbmem example(msc class) as a firmware for my lpc3131 device to communicate with the host. Host is windows pc with driver as standard example USBSAMP provided by winddk.
Observations : 1. I am able to enumerate my device correctly . 2. I am not able to enter in to switch case in the endpoint function which is called by host for the IN event(lets say EP1). What i can do is if i put usb_write() outside switch case, data gets read and host can display the data (this i think is because endpoint1() is called every time even in case of NAK , so usb_write() also gets called irrespectively of event (IN,OUT,NAK).) 3. I get the data from the device (read) only after host first writes something to device.So from host side i have to put two requests, first write then read.Otherwise, it won't happen.
So what should i do to effectively communicate between host and device . Also , are these examples meant for this purpose or i have to tweak in more because enumeration is perfect.
Thanks