2019-02-12 01:39 AM
Hi,
I'm working with the Software "STSW-ST25DV001" for the ST25DV Discovery Kit as part of my seminar paper. Unfortunately I can't enable the FTM Mode. I'm a little bit confused because the FTM Demo of the Software enables the FTM, but I can't find the specific code in the project.
Can anyone help me?
I found the following function in the Code "ST25DV_i2c_WriteMBMode" but after checking the pMB_mode with the debugger of Keil uVision 5 the value of pMB_mode hasn't changed after execution the function.
Thank you in advance!
Best regards
Rebecca
Solved! Go to Solution.
2019-02-12 03:38 AM
Hi Rebecca,
Your code example tries to enable the Mailbox using the static register MB_MODE.
But, for a security reason, this is allowed only after an I2C session has been open by presenting the I2C password.
And once the static MBMode is enabled, the code must also enable the MB_EN bit in MB_CTRL_dyn dynamic register, in order to be able to write data to the Mailbox.
Here a simple working example enabling the mailbox:
#include "st25_discovery_nfctag.h"
#include "mailboxfunc.h"
#include "commonfunc.h"
int Enable_FTM_MB (void)
{
NFCTAG_StatusTypeDef status;
ST25DV_I2CSSO_STATUS session_status;
// initialize the I2C
status = BSP_NFCTAG_Init();
if(status != NFCTAG_OK)
return 0;
// open I2C session
session_status = PresentPasswd( true );
if(session_status != ST25DV_SESSION_OPEN)
return 0;
// enable mailbox static register
status = InitMailBoxMode();
if(status != NFCTAG_OK)
return 0;
// enable mailbox in dynamic register
status = BSP_NFCTAG_GetExtended_Drv( )->SetMBEN_Dyn( );
if(status != NFCTAG_OK)
return 0;
// this is a success
return 1;
}
For your information the STSW-ST25DV001 provides an example of mailbox management to exchange frames with a NFC reader or smartphone: this is implemented in mailbox.c.
Regards,
Ronald
2019-02-12 03:38 AM
Hi Rebecca,
Your code example tries to enable the Mailbox using the static register MB_MODE.
But, for a security reason, this is allowed only after an I2C session has been open by presenting the I2C password.
And once the static MBMode is enabled, the code must also enable the MB_EN bit in MB_CTRL_dyn dynamic register, in order to be able to write data to the Mailbox.
Here a simple working example enabling the mailbox:
#include "st25_discovery_nfctag.h"
#include "mailboxfunc.h"
#include "commonfunc.h"
int Enable_FTM_MB (void)
{
NFCTAG_StatusTypeDef status;
ST25DV_I2CSSO_STATUS session_status;
// initialize the I2C
status = BSP_NFCTAG_Init();
if(status != NFCTAG_OK)
return 0;
// open I2C session
session_status = PresentPasswd( true );
if(session_status != ST25DV_SESSION_OPEN)
return 0;
// enable mailbox static register
status = InitMailBoxMode();
if(status != NFCTAG_OK)
return 0;
// enable mailbox in dynamic register
status = BSP_NFCTAG_GetExtended_Drv( )->SetMBEN_Dyn( );
if(status != NFCTAG_OK)
return 0;
// this is a success
return 1;
}
For your information the STSW-ST25DV001 provides an example of mailbox management to exchange frames with a NFC reader or smartphone: this is implemented in mailbox.c.
Regards,
Ronald
2019-02-18 05:40 AM
Hi Ronald,
thank you very much for your message! Now enabling of the FTM is possible! And thank you for the hint concerning the mailbox.c file. Before I didn't recognise the fille because the file isn't listed in the upgraded Firmware-Version.
Do you have any other helpful tips for using the ST25DV Discovery Board?
Regards,
Rebecca