2020-10-09 04:33 AM
Hello,
I am working with ST25DV04k nfc tag and i have problem with password present routine.
Generally i tested this module on nucleo board with STs library and it works well. Now i am trying to use this module with RSL10 SoC. I can read data from registers, so i2c communication works.
My problem occurs when i try to present password to the module.
First i send module address and pswd register address, then 8 bytes of password + validation code = 0x09 + 8 bytes of password.
Here is the code:
void st25dv_i2c_pswd_present(void){
uint8_t pswd_present_data[17] = { 0 };
pswd_present_data[8] = 0x09; // validation code
uint16_t reg_addr = 0x0009;
uint32_t module_addr = 0xae >> 1;
i2c->MasterTransmit(module_addr, (uint8_t*)(®_addr), 2, true);
while(!tx_cmplt);
tx_cmplt = false;
PRINTF("Data Transferred: %d\n\r", i2c->GetDataCount());
i2c->MasterTransmit(module_addr, pswd_present_data, 17, false);
while(!tx_cmplt);
tx_cmplt = false;
PRINTF("Data Transferred: %d\n\r", i2c->GetDataCount());
PRINTF("PASSWORD PRESENT DONE\n\r");
}
What i had noticed is that, when i am transmitting pswd data only three bytes are transferred. I belive that receiver does not ack received byte, but have no idea why.
I am using CMSIS library to handle i2c.
If you have any ideas what can cause this behaviour, i will be grateful if you share them with me =)
Best regards,
mf
Solved! Go to Solution.
2020-10-14 12:10 AM
HI @MFo.1 ,
Sequence to send the password need to be in 1 part, are you sure that between both transmission there is no i²c STOP generated (I mean if the time between is too long, is there a timeout)? Can you try this sequence using only 1 command.
It seems that you are using interrupt to control end of transmission, does i²c raised other interrupt flags (errors)? Using ARM_I2C_GetStatus could inform about error raised.
Regards.
2020-10-14 12:10 AM
HI @MFo.1 ,
Sequence to send the password need to be in 1 part, are you sure that between both transmission there is no i²c STOP generated (I mean if the time between is too long, is there a timeout)? Can you try this sequence using only 1 command.
It seems that you are using interrupt to control end of transmission, does i²c raised other interrupt flags (errors)? Using ARM_I2C_GetStatus could inform about error raised.
Regards.
2020-10-14 02:25 AM
Hi @Rene Lenerve ,
thank for your reply.
I looked at the transmision using logic analyzer and there was generated STOP condition as you mentioned.
I thought that, the stop condition is not generated. According to documentation, when last parameter in MasterTransmit() function is false, then STOP is not generated. But maybe there is some timeout or something. I use this lib for the first time.
I should have figured it out myself.
Anyway, if i send all data in one transmission it works well.
Thank you.
Regards,
mf