cancel
Showing results for 
Search instead for 
Did you mean: 

ST25DV HOW TO USE FAST MAILBOX ?

oziesin
Associate III

How can i use FTM buffer i do not understand what should I do exactly. I have problems first step. I can read all block of system memory , user memory and dynamic registers also i can write on user memory(EEPROM) but when i try to initalize Fast transfer mode , i encountered problem that cannot change static configuration registers like i want. 

I am waiting your advises.

1 ACCEPTED SOLUTION

Accepted Solutions

I solved the problem. it was a pointer problem. Function has pointer type but i was writing single number if i write any variable before passing argument that is working. Maybe helps someone.

View solution in original post

10 REPLIES 10
Brian TIDAL
ST Employee

Hi,

X-CUBE-NFC4 software package provides a mailbox application example with source code. This can help you to develop your own application.

Rgds

BT

In order 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.
oziesin
Associate III

Thanks for reply,

I am going to check it.

Basically, why the problem that writing incorrect value on static registers exist. it can be anyone of them. I cannot understand where is the problem ? Software part or hardware part. I confused. What could I be missing ?

Hi,

have you followed §4.3 of the datasheet: "static registers located in the system configuration area can be accessed with I2C read and write

commands with device select E2=1. Readable system areas could be read in continuity. I2C security session must first be open, by presenting a valid I2C password, to grant write access to system configuration registers."

I would recommend to base your development on middleware provided on st.com rather that starting from scratch. An example of FTM is provided in X-CUBE-NFC4. Also, a user lever FTM library is provided as part of the ST25 Embedded NFC library . See AN5512 ST25 fast transfer mode embedded library. This FTM library provides support for chaining, error detection and recovery.

Feel free to provide more information about your application .

Rgds

BT

In order 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 for interest, I read I2CSSO Pin in dynamic register and it is open. My application is simple if you want i can share some code. I do not want to use high level libraries, i want to do that from scratch. I am going to look at AN5512. I have been reading datasheet for 1 week , i've looked almost in all. May be I missed something, but i can read/write eeprom block and i can read all memory section so really i started to thinking about that ic is damaged.

Hi,

basically, the following steps should work:

  • 1 - read the MB_MODE bit in the MB_MODE register
  • 2 - if the MB_MODE is not set, read the I2C_SSO bit in I2C_SSO_Dyn
    • 2.1 - if the I2C_SSO is not set, present the i2C password. Check the I2C_SSO bit in I2C_SSO_Dyn
    • 2.2 - set the MB_MODE bit ( (@0x000D, slave address 0xAE)
  • 3 - Security session can be closed
  • 4 - set MB_EN in MB_CTRL_Dyn  (@0x2006, slave address 0xA6).

Feel free to share your code

Rgds

BT

In order 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.
 uint8_t errCnt, status[10];
 
  iDrvNfc_I2C_Read(I2C2,ST25DV_ADDR_DYN_REG_READ_I2C,ST25DV_EH_CTRL_DYN_REG,(uint8_t*)&status[0],1);	// Read vcc status
	if (!(status[0] & 1<<3))
	{
		++errCnt;			// ERROR VCC is not present
	}
uint8_t  psw [ 8 ];
memset (&psw, 0 , 8 );	// psw = 00000000 (8byte)
iDrvNfc_I2C_Read(I2C2,ST25DV_ADDR_SYST_READ_I2C,ST25DV_MB_MODE_REG,(uint8_t*)&status[1],1);					// 1 - read the MB_MODE bit in the MB_MODE register
  if( ! (status[1] & 1) )
	{
  	e_psw e_psw_t = iDrvNfc_I2C_Present_Password( psw ); if(e_psw_t){};																//	2.1 - if the I2C_SSO is not set, present the i2C password. Check the I2C_SSO bit in I2C_SSO_Dyn
    iDrvNfc_I2C_Write(I2C2,ST25DV_ADDR_SYST_WRITE_I2C,ST25DV_MB_MODE_REG,(uint8_t*)1,1);							// 2.2 - set the MB_MODE bit ( (@0x000D, slave address 0xAE)
    iDrvNfc_I2C_Read(I2C2,ST25DV_ADDR_SYST_READ_I2C,ST25DV_MB_MODE_REG,(uint8_t*)&status[2],1);				// 1 - read the MB_MODE bit in the MB_MODE register
 
	}
  iDrvNfc_I2C_Write(I2C2,ST25DV_ADDR_DYN_REG_WRITE_I2C,ST25DV_MB_CTRL_DYN_REG,(uint8_t*)1,1);					// 4 - set MB_EN in MB_CTRL_Dyn  (@0x2006, slave address 0xA6).
  iDrvNfc_I2C_Read(I2C2,ST25DV_ADDR_DYN_REG_WRITE_I2C,ST25DV_MB_CTRL_DYN_REG,(uint8_t*)&status[3],1);	//  - read the MB_EN in the MB_CTRL_Dyn 	

0693W00000DpwfGQAR.png 

  • You can see the values till 4th byte after debug session.Other bytes are garbage.
  • These functions are mine and works properly. Actually these are almost same HAL library functions but includes LL library.
  • These macros are in st25dv.h and st25dv_reg.h written by ST almost all of them.
  • Finally, still problem is constant. Any suggestion make me so happy :)

Hi,

are you sure that Address AEh/AFh are being used when writing/reading MB_MODE register? Can you connect a logic analyzer and provide a trace?

Rgds

BT

In order 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.

0693W00000Dpx7jQAB.pngThanks for helps i will try logic analyzer or i can try new hardware