ATrappmann/PN5180-Library

issueISO15693Command hangs on receiving more than 50+ bytes

ddv2005 opened this issue · 1 comments

Hello,

I tried to implement read multiple blocks (0x23) command and found that it hangs on reading more than 57 bytes. I found that it is because issueISO15693Command reads RX_STATUS (to check received data length) but RF data still in fly and received data length not correct. If I put some delay before reading RX_STATUS then I can read more data without hangs but it should be some procedure to find out exact moment when all data received and buffered.

I found correct way - check RX_IRQ_STAT bit before reading RX_STATUS :

sendData(cmd, cmdLen);
delay(10);

uint32_t irqR = getIRQStatus();
if (0 == (irqR & RX_SOF_DET_IRQ_STAT)) {
return EC_NO_CARD;
}

while(!(irqR & RX_IRQ_STAT))
{
delay(1);
irqR = getIRQStatus();
}

uint32_t rxStatus;
readRegister(RX_STATUS, &rxStatus);