ST25DV Mailbox message owner
Hi,
I am currently working with the X-NUCLEO-NFC08A1 as reader another PCB with a stm32 microcontroller and a ST25DV04K tag. I don't have access to the source code of the board with the tag but i know the used protocol to interact with it.
I got everything running but sometimes it seems as if the HOST_PUT_MSG flag is set before the response is fully written. I poll for the response to be written with something like this:
uint8_t waitCounter = 0;
/* wait for response to be written by tag. */
while (ftmGetMessageOwner() != FTM_MESSAGE_PEER
&& waitCounter <= FTM_MAX_RESPONSE_WAIT_TIME) {
platformDelay(1);
waitCounter++;
}
if(waitCounter == FTM_MAX_RESPONSE_WAIT_TIME){
platformLog("Tag response timeout.\n");
return true;
}But with debugging I found out that sometimes the command sent before is still in the mailbox when the message owner already changed and thus being read instead of the answer.
So my question is: When is the HOST_PUT_MSG bit put? Is it put by the user or does the tag do this automatically? If the tag does it, I suppose that it is put after the I2C wrote the first byte and thus causing my problem.
Kind regards,
Jonas
