Hi Kan,
Sorry I missed to mention that. I am switching the direction to I2C_TO_RF before writing to the SRAM. Following is my API to write to the SRAM.
==============
void SendDataToNFCReader(uint8_t *buffer)
{
if (NfcFieldPresent){
#if (DEBUG_PRINTS_SWITCH ==1)
printBuffer("\r\nSRAM send buffer:", buffer, 64);
#endif
if( invisible_ok != ntag_set_transfer_direction(I2C_TO_RF) ) {
PRINTF("%s, %s[%d] ntag_set_transfer_direction failed!\r\n", __FILE__, __func__, __LINE__);
}
else if( invisible_ok != ntag_write_bytes(NTAG_MEM_ADDR_START_SRAM, buffer, NTAG_MEM_SRAM_SIZE) ) {
PRINTF("%s, %s[%d] ntag_write_bytes failed!\r\n", __FILE__, __func__, __LINE__);
}
#if (DEBUG_PRINTS_SWITCH ==1)
uint8_t ns_reg;
invisible_status_t status = ntag_read_session_register( NS_REG, &ns_reg );
if( invisible_ok != status ) {
PRINTF("%s, %s()[%d], ntag_read_session_register failed! NS_REG\r\n", __FILE__, __func__, __LINE__);
}
PRINTF("\r\n NS_REG = 0x%x" , ns_reg);
#endif
}
}
==============
Best regards,
Gaurav Banyal.