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 |