2021-08-19 10:41 PM
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.
Solved! Go to Solution.
2021-08-23 04:38 AM
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.
2021-08-20 01:39 AM
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
2021-08-20 01:47 AM
Thanks for reply,
I am going to check it.
2021-08-20 02:43 AM
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 ?
2021-08-20 04:27 AM
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
2021-08-20 05:07 AM
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.
2021-08-20 05:36 AM
Hi,
basically, the following steps should work:
Feel free to share your code
Rgds
BT
2021-08-20 07:19 AM
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
2021-08-20 07:51 AM
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
2021-08-20 08:14 AM
Thanks for helps i will try logic analyzer or i can try new hardware