- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello I use the cy7c67200 (EZ-OTG) on a fpga (Altera DE2-115). I successfully implemented The enumeration process and want to read now some data from a usb flash drive. But i have issues on that. Im not fully sure if I understand right how to do that, sadly i didnt found any examples which don't use high level frameworks and where i can see how i send CBWs (command block wrapper) and how i receive the CSW (Command Status Wrapper).
Thats why i like to describe how i do it in the hope someone can tell me if I do it right in general . What i do is: i issue a bulk reset. Then i write a setup TD (Transfer Descriptor) which points with its BaseAddr to the CBW content. CBW (on position 0x50C): Signature: 0x43425355 Tag: 0xfefefeed DataTransferLength 0x200 Flags: 0x8 Lun: 0x0 Length: 0xa CDB: 28 00 00 00 00 00 00 00 08 00 My wMaxPacketSize as reported by the endpoint descriptor is 64 so i think I have to define the length in the CDB as 8 if i want 512bytes? TD (at position 0x500): base_addr: 0x50c port_length: 0x1c pid_ep: 0x12 dev_addr: 0x2 ctrl_reg: 0x41 status: 0x0 retry_cnt: 0x1b residue: 0x0 next_td_addr: 0x528 Then i write a (data) TD with PID_IN and point with the BaseAddr where i want the data should be written. TD (at 0x528) base_addr: 0x534 port_length: 0x200 pid_ep: 0x91 dev_addr: 0x2 ctrl_reg: 0x1 status: 0x0 retry_cnt: 0x1b residue: 0x0 next_td_addr: 0x734 Then i write a (status) TD which points with BaseAddr where i want to read the CSW TD(at 0x734) base_addr: 0x740 port_length: 0x0 pid_ep: 0x11 dev_addr: 0x2 ctrl_reg: 0x1 status: 0x0 retry_cnt: 0x1b residue: 0x0 next_td_addr: 0x0 Then i set the CurrentTDPointer to 500 and wait until the HPI_STATUS register reports TDListDone. Then i read the data buffer at 0x534 where I expect the content from my usb device and i read the content from 0x740 where i expect my CSW content. But the data contains garbage, the csw signature for example is wrong and the csw tag is not equal to the value in my cbw. Also the data which should be the 512 bytes of the flashdrive from LBA: 0 are not identical with the contents from the flashdrive.Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page