2025-03-25 4:07 AM
I'm developing an app that writes and reads settings from an STM32 over NFC. I can write settings to the ST25DV mailbox and poll the RF_PUT_MSG register to detect when data has been written. Which register should I poll to know if the app has requested to read data?
2025-03-25 7:26 AM
Hello,
There are two ways to detect messages: the MB_CTRL_Dyn register and the IT_STS_Dyn register.
The IT_STS register informs the MCU of the nature of received interrupts. Each time the RF reader writes a message into the mailbox (and if the interrupt RF_PUT_MSG has been enabled), the IT_STS.RF_PUT_MSG bit is set to 1. This way, the MCU knows there is a new message to read into the mailbox.
Each time the RF reader reads a message that has been put into the mailbox by the MCU, the IT RF_GET_MSG is trigged, and the MCU is informed that the RF reader has read the message.
Off course, this is available only on MCU side (there is obviously no interrupts going to the RF reader)
The MB_CTRL_Dyn register provides you the RF_PUT_MSG and HOST_PUT_MSG.
RF_PUT_MSG bit is set each time a new message has been written by the RF reader into the mailbox. It is cleared when there MCU has read the last byte of the message. MCU can poll this register (or only read it when receiving the RF_PUT_MSG IT) to check for a new message from RF.
HOST_PUT_MSG is set when the MCU has written a new message into the mailbox. It is cleared when RF reader has read the last byte of the message. RF Reader can poll this bit to know if there is a new message in the mailbox that has to be read.
You can check the application note https://www.st.com/resource/en/application_note/an4910-data-exchange-between-wired-ic-and-wireless-rf-iso-15693-using-fast-transfer-mode-supported-by-st25dvi2c-series-stmicroelectronics.pdf and the datasheet for further details.
Best regards.
2025-03-25 2:02 PM
Thank you for that. From what I understand after reading the datasheet (page 32) I can see that GPO/RF_GET_MSG is set to high AFTER the ST25DV responds to RF tead request (i.e sends the mailbox data to the RF).
Here is a layout of my application
write steps
1. mailbox empty -> rf puts msg on mailbox
2. rf_put_msg bit gets high. mcu polls this bit
3. Mcu reads the data and parses the settings data. Mailbox gets empty again
This works beautifully. However,
read steps:
1. Maibox empty -> rf sends read request (0xAC)
2. Should I poll rf_get_msg? According to datasheet, this bit gets High after the st25dv responds (in this case with 0's since mailbox is empty?
3. Once read request is detected send settings data over i2c to rf