rfalST25xVPollerFastWriteMessage() fails writing to mailbox
hi,
I have some code for reading/writing to a mailbox from the ST25R3916B transceiver to a ST25DV64KC tag. The read passes but the write fails every time;its errcode is ERR_PROTO;
My code is following:
static void demo2Nfcv(rfalNfcvListenDevice *nfcvDev)
{
ReturnCode err;
uint16_t rcvLen;
uint8_t blockNum = 0;
//uint8_t rxBuf[1 + DEMO_NFCV_BLOCK_LEN + RFAL_CRC_LEN]; /* Flags + Block Data + CRC */
uint8_t *uid;
uint8_t cir = 0; //循环次数
uint8_t wrData[DEMO_NFCV_BLOCK_LEN] = {0}; /* Write block example */
/* DEMO_NFCV_WRITE_TAG */
uint8_t tempTxBuf[256] = {0};
uint8_t i=0;
uint8_t pointer;
uint8_t reg;
static uint8_t pwd[8] = {0,0,0,0,0,0,0,0};
uint8_t pwdLen = 8;
uint8_t pwdNum = 0;
uint8_t msgLen;
uint8_t msgBuf[4] = {0x01,0x02,0x03,0x04};
static uint8_t rxBuf[256];
uid = nfcvDev->InvRes.UID;
/* Open RF configuration security session */
err = rfalST25xVPollerPresentPassword(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, pwdNum, pwd, pwdLen);
/* set MB_MODE to 1: Enabling fast transfer mode is authorized.*/
pointer = ST25DV04K_SYSTEM_CONFIG_MB_MODE;
reg = ST25DV04K_REG_MB_MODE_FTM_AUTHORIZED;
err = rfalST25xVPollerWriteConfiguration(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, pointer, reg);
/* set MB_EN to 1: Enable FTM. Read, update and write */
pointer = ST25DV04K_DYN_REG_MB_CTRL;
err = rfalST25xVPollerFastReadDynamicConfiguration(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, pointer, ®);
reg |= ST25DV04K_REG_MB_CTRL_DYN_MB_EN;
err = rfalST25xVPollerFastWriteDynamicConfiguration(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, pointer, reg);
err = rfalST25xVPollerFastWriteMessage(RFAL_NFCV_REQ_FLAG_DEFAULT, uid,3,msgBuf,tempTxBuf,256);
/* Read Msg Len */
err = rfalST25xVPollerFastReadMsgLength(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, &msgLen);
/* Read Msg */
err = rfalST25xVPollerReadMessage(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, 0,0, rxBuf, sizeof(rxBuf), &rcvLen);
}Can anyone help me solve that probl
