cancel
Showing results for 
Search instead for 
Did you mean: 

How to deal with I2C Communication for the slave x-nucleo-nfc07a1 in which ST25DV64KC incorporated and is interfaced with STM32WB55RG?

BT.2
Associate II

Hi sir, I am working with I2C in x-nucleo-nfc07a1 where ST25DV IC incorporated interfaced with Nucleo-WB55 board, what is the slave address(device address) for this?

I am firmware engineer, I have I2C Scanning program where

Previously, I work with Temp sensor, the scanning code gives me slave address as 0x4a,

I also work the following,

Heart rate sensor in which it is 0x57

PN532 NFC reader in which it shows 0x24

And right now I work with X-Nucleo-NFC07A1 in which ST25DV64KC is incorporated, here the scanning code shows none. I want to know, why it is not? and how to deal with i2c communication to store data in EEPROM? HAL_I2c functions deals with 5 parameters, DevAddr, TargetAddr, No.of.Bytes req, delay, out of which DevAddr what we can use?

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

Hello @BT.2​ ,

Could you please check the datasheet : Datasheet - ST25DV04K ST25DV16K ST25DV64K - Dynamic NFC/RFID tag IC with 4-, 16-, or 64-Kbit EEPROM, and fast transfer mode capability

In section 6.3. : The ST25DV is one device but responds to THREE I2C addresses: 0x2D, 0x53 (user memory) and 0x57 (system memory)


_legacyfs_online_stmicro_images_0693W00000bkewfQAA.png 

Hope I helped you!

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Foued_KH
ST Employee

Hello @BT.2​ ,

Could you please check the datasheet : Datasheet - ST25DV04K ST25DV16K ST25DV64K - Dynamic NFC/RFID tag IC with 4-, 16-, or 64-Kbit EEPROM, and fast transfer mode capability

In section 6.3. : The ST25DV is one device but responds to THREE I2C addresses: 0x2D, 0x53 (user memory) and 0x57 (system memory)


_legacyfs_online_stmicro_images_0693W00000bkewfQAA.png 

Hope I helped you!

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you !

I want to read the Revision ID, IC Ref reg or UID reg

could you please tell the following code I wrote is correct or not?

/** @brief ST25DVxxKC ICref register address. */

#define ST25DVXXKC_ICREF_REG           (uint16_t)0x0017

/** @brief ST25DVxxKC UID register address. */

#define ST25DVXXKC_UID_REG            (uint16_t)0x0018

/** @brief ST25DVxxKC IC revision register address. */

#define ST25DVXXKC_ICREV_REG           (uint16_t)0x0020

uint8_t Buff[8];

#define command         ST25DVXXKC_ICREF_REG

uint8_t command_buffer = {(command & 0xff ) >> 8, command & 0xff};

 HAL_I2C_Master_Transmit(&hi2c1, (0x57<<1), command_buffer,1,100);

 HAL_I2C_Master_Receive(&hi2c1,((0x57<<1) | 0x01), Buff,1, 100);

And also I tried the following,

 uint8_t ret;

 ret = HAL_I2C_IsDeviceReady(&hi2c1,(uint16_t)0x57<<1, 3 , 5);

 if(ret == HAL_OK)

 {

HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_10);

 }

Here the if condition fails, I also tried with 0x53 and 0x57 also, so how to set the device address inorder to make the if condition true

Hello

I recommend you use :

HAL_I2C_Mem_Write (I2C_HandleTypeDef * hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t * pData, uint16_t Size, uint32_t Timeout);
 
HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size)

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

BT.2
Associate II

The if condition satisfied true for all the addresses(0x2D<<1), (0x53<<1), (0x57<<1) in debug mode step over the code, The LED toggles.

But the same code in debug mode click the play button instead of step over key, it won't get inside the if condition

If the error is :

  • OVR, ARLO, NACK : you can just do a Transmit again
  • BERR : You have to re-enable the peripheral

If you are facing some erratic behavior on STM32, do not forget to check Errata sheet of the device. There are few points related to I2C interface. 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.