LPC2378 usb slave bulk in

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2378 usb slave bulk in

538 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bjorngulf on Wed Apr 09 10:07:41 MST 2014
Hi,

I'm trying to send data from my lpc2378 to the usb over a bulk in endpoint. But the only thing i'm getting out of it are 0 bytes. The length of the data is correct. The full initialization of the uwb works. And i can read data from a bulk out endpoint. I'm using a olimex lpc-p2378 development board. Can somebody help me? I'm stuck here for three days and i can't seem to fix it.

Endpoint init:
USBReEp |= (0x1 << 5);
/* Load Endpoint index Reg with physical endpoint no.*/
USBEpInd = 5;
/* load the max packet size Register */
USBMaxPSize = 64;
/* check whether the EP_RLZED bit in the Device Interrupt Status register is set */
while (!(USBDevIntSt & (1<<8)));
/* Clear the EP_RLZED bit */
USBDevIntSt &= ~(1<<8);
USBEpIntEn|=0x00000030;
USBEpIntPri|=0x00000030;


endpoint read then a write:
uint8_t blkbuf[64]={0};
uint8_t msg[64]={0};
uint32_t size;
int USB_Status;

size = USB_ReadEP(0x02, blkbuf);

USBCtrl = ((2) << 2) | (1<<1);

USBTxPLen = 4;
USBTxData = 0xDEADBEEF;

USBCtrl = 0;  

//WrCmd(CMD_SEL_EP(EPAdr(EPNum)));
USBDevIntClr=(1<<4);//clear CCEMPTY
USBCmdCode=0x00050500;//Select Endpointcommand
while(!(USBDevIntSt&(1<<4)));//wait for CCEMPTY
USBDevIntClr=(1<<4);//Clear CCEMPTY
//WrCmd(CMD_VALID_BUF);
USBDevIntClr=(1<<4);//clear CCEMPTY
USBCmdCode=0x00fa0500;//validate buffercommand
while(!(USBDevIntSt&(1<<4)));//wait for CCEMPTY
USBDevIntClr=(1<<4);//Clear CCEMPTY



wireshark log
[img]http://s24.postimg.org/mbb94xgsl/Screenshot_from_2014_04_09_19_01_06.png[/img]

Kind regards,
Bjorn
Labels (1)
0 Kudos
0 Replies