Jan, Barry and everybody else !
Issue fixed !
The issues was - delay in sending the remaining 3 bytes of config descriptor data.
After sending first 64 bytes, I was checking the interrupt bit to make sure if the 64 bytes have been sent.
Removing this check fixed it !
Here is the code of sending config descriptor :
if ((desclen!=0)) // one of the case statements above filled in a value
{
sendlen = (reqlen <= desclen) ? reqlen : desclen; // send the smaller of requested and avaiable
//Send length is less than or equal to 64
if(sendlen<=64)
{
WriteBytes(rEP0FIFO,sendlen,pDdata);
WriteMax3421RegAS(rEP0BC,sendlen); // load EP0BC to arm the EP0-IN transfer & ACKSTAT
}
//Send length is greater than
else
{
do
{
sendlen = 64;
WriteBytes(rEP0FIFO,sendlen,pDdata);
WriteMax3421RegAS(rEP0BC,sendlen); // load EP0BC to arm the EP0-IN transfer & ACKSTAT
desclen=desclen-sendlen;
pDdata=pDdata+sendlen;
}while(desclen>64);
sendlen = desclen;
//while(!ReadMax3421Reg(rEPIRQ& bmIN0BAVIRQ));
if(sendlen>0) WriteBytes(rEP0FIFO,sendlen,pDdata);
WriteMax3421RegAS(rEP0BC,sendlen);
}
Commenting the line in red worked for me.
Thank you all for your precious time !
Regards,
Nik