cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to configure GPO pin on ST25DV

Shruthi
Associate II

Hi,

I'm trying to set the GPO static register to 0xF1 to get corresponding interrupts.

I am presenting the password first and then configuring GPO register at address 0000.

Here is the program-

NFCTAG_StatusTypeDef Set_GPO_reg(uint16_t flags)  // Here flags=0xF1
{
 
	ext_drv=BSP_NFCTAG_GetExtended_Drv();
 
	ST25DV_PASSWD pwd;
	ST25DV_I2CSSO_STATUS security_status;
 
	pwd.MsbPasswd=0x00000000;
	pwd.LsbPasswd=0x00000000;
 
	ext_drv->ReadI2CSecuritySession_Dyn(&security_status);
	ESP_LOGI("Security session","security session before presenting pwd is %d", security_status);
 
	while (ext_drv->PresentI2CPassword(pwd) != NFCTAG_OK);
 
	ext_drv->ReadI2CSecuritySession_Dyn(&security_status);
	ESP_LOGI("Security session","security session after presenting pwd is %d", security_status);
 
	while (BSP_NFCTAG_ConfigIT(condition) != NFCTAG_OK);
 
	return NFCTAG_OK;
}

I am reading security session before and after presenting password. I'm correctly seeing 0 and 1 respectively.

While the security session is open, I'm configuring GPO register with system address 0xAE and reg address-0x0000

I2C write operation is success. But after this, when I read the same static GPO register- ST25DV_i2c_GetGPOStatus(&GPOStatus), Im unable to see the configured 0xF1 value. I'm seeing as 0x11.

I'm unable to attach saleae file here. I can mail it though.

I referred to other answers as well - link1, link2

I'm using ST25DV04K 8pin IC. I have pulled up the GPO pin.

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

Hello Shruthi,

Sorry for the delay for answering and thank you for the salae trace.

Looking at the trace, I think I can see where the problem is.

At 3s and 129ms, I think you are trying to write into the GPO static register (address 0x0000). But the I2C command is not complete, the value 0xF1 is never sent. The command there is:

START/AE/ACK/00/ACK/00/ACK/STOP.

The correct command would be:

START/AE/ACK/00/ACK/00/ACK/F1/ACK/STOP

So it seems that you miss the part of the I2C sequence where the value 0xF1 is sent, this explains why the GPO register is not updated.

Best regards.

View solution in original post

3 REPLIES 3
JL. Lebon
ST Employee

Hello Shruthi,

I don't see in your code where the "flags" value is used ?

What is the value of "condition" when you call BSP_NFCTAG_ConfigIT ?

It would probably help to see the saleae trace. I think this is possible, you should have the attach button available under the response window on the left of the answer button, no ?

Best regards.

Shruthi
Associate II

Apologies for the mistake. Here 'condition' is same as 'flags' i.e., 0xF1

Here is the saleae trace. Password present starts from 3s:91ms.

JL. Lebon
ST Employee

Hello Shruthi,

Sorry for the delay for answering and thank you for the salae trace.

Looking at the trace, I think I can see where the problem is.

At 3s and 129ms, I think you are trying to write into the GPO static register (address 0x0000). But the I2C command is not complete, the value 0xF1 is never sent. The command there is:

START/AE/ACK/00/ACK/00/ACK/STOP.

The correct command would be:

START/AE/ACK/00/ACK/00/ACK/F1/ACK/STOP

So it seems that you miss the part of the I2C sequence where the value 0xF1 is sent, this explains why the GPO register is not updated.

Best regards.