cancel
Showing results for 
Search instead for 
Did you mean: 

What is detailed definition about "I2C read full message" in ST25DV64K?

MMoro.4
Associate II

I am using a ST25DV64K.

I am trying to exchange data between the MCU on the board and Mobile Phone using I2C/RF and FTM.

The RAM capacity of the MCU on the board is small, and I am trying to divide the RF Message and read it.

For example, I am trying to send 100 bytes by RF Message, and MCU is trying to read by dividing this 100 bytes by 50 bytes + 50 bytes.

First 50bytes: 2008h - 2039h

2nd 50byte: 203Ah - 206Bh

At this time, assuming that all I2C read msgs are received normally, will MB_CTRL_DYN becomes "81h"?

Or MB_CTRL_DYN becomes "91h" because it don't read at once?

BR

Morooka

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

Hello,

"I2C read full message" means that the I2C has read the last byte of the message stored in the mailbox.

So, assuming that you have not activated the watchdog, here are the steps in your case:

  • write 100bytes in mailbox from RF: MB_CTRL_DYN becomes 85h (MB_EN=1, RF_PUT_MSG=1, RF_CURRENT_MSG=1, all others=0)
  • read first 50bytes 2008h-2039h from I2C: MB_CTRL_DYN is unchanged at 85h.
  • read second 50bytes 203Ah-206Bh from I2C: MB_CTRL_DYN becomes 81h when last I2C byte (at address 206Bh) is read (MB_EN=1, RF_PUT_MSG=0, RF_CURRENT_MSG=1, all others=0). Only RF_PUT_MSG bit is cleared. RF_CURRENT_MSG is not cleared since data in the mailbox are not removed, but mailbox is free to receive another message (and overwrite the previous one).

MB_CTRL_DYN will becomes 91h only if the watchdog as been enabled and if you fail to read the last byte of the message from I2C before the watchdog is triggered.

You can disable the watchdog by programing value 00h in MB_WDG (at I2C address 000Eh).

Hope this helps.

Best regards.

View solution in original post

2 REPLIES 2
JL. Lebon
ST Employee

Hello,

"I2C read full message" means that the I2C has read the last byte of the message stored in the mailbox.

So, assuming that you have not activated the watchdog, here are the steps in your case:

  • write 100bytes in mailbox from RF: MB_CTRL_DYN becomes 85h (MB_EN=1, RF_PUT_MSG=1, RF_CURRENT_MSG=1, all others=0)
  • read first 50bytes 2008h-2039h from I2C: MB_CTRL_DYN is unchanged at 85h.
  • read second 50bytes 203Ah-206Bh from I2C: MB_CTRL_DYN becomes 81h when last I2C byte (at address 206Bh) is read (MB_EN=1, RF_PUT_MSG=0, RF_CURRENT_MSG=1, all others=0). Only RF_PUT_MSG bit is cleared. RF_CURRENT_MSG is not cleared since data in the mailbox are not removed, but mailbox is free to receive another message (and overwrite the previous one).

MB_CTRL_DYN will becomes 91h only if the watchdog as been enabled and if you fail to read the last byte of the message from I2C before the watchdog is triggered.

You can disable the watchdog by programing value 00h in MB_WDG (at I2C address 000Eh).

Hope this helps.

Best regards.

Thanks @JL. Lebon_O (ST Employee)

I understood that when I2C reads the last byte, MB_CTRL_Dyn replaces 85h to 81h.

If that is the case, I won't have to change the sequence I am considering.

Thank you.

Best regards.