Hi All,
Here is my code snip:
/** ======= Generate FeliCa Read Block Command */
if (FCLIB_ReadBlockv2(blockNum, blockList, gTxBuffer, &timeout) !=
FCLIB_SUCCESS) {
LOG_TXT("FCLIB_ReadBlockv2 failed.\n");
igs_record_err(idm, FC_ERR_READ_BLOCKV2);
return false;
}
DBG_OUT("Read blk\r\n");
phUser_Wait(10000);
// igs_print_hex(gTxBuffer, 20);
phUser_Wait(1000000);
=======> remove card here
phhalWdt_Refresh();
cmdRetry = 1;
/** Send Short command for Req C*/
do {
wStatus = phhalRf_PCD_Exchg(gTxBuffer, gRxBuffer, gTxBuffer[0],
&sRxParams); // =======> blocked here
phUser_Wait(100000);
} while (wStatus != 0 && cmdRetry > 0);
if (wStatus != 0) igs_record_err(idm, FC_ERR_READ_BLOCKV2);
PH_RETURN_ON_FAILURE(wStatus)
DBG_OUT("Read blk cmd\r\n");
phUser_Wait(10000);
The code is used to issue block reading for Felica card. However there is potential lockup on block reading if card is removed before the phhalRf_PCD_Exchg() call. It's blocking and never return.
I tried using debug and here is screenshot of call trace as attachment.
Any idea and solution to avoid never back blocking ?
BR,
Sam
There will be PH_ERR_IO_TIMEOUT returned in cases of Transmission does not completed or Reception does not happen.
Please kindly check the return value of phhalRf_PCD_Exchg() in your case.
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Sir,
My problem is the call never return. It locks.
BR,
Sam
Hi Sam,
Thanks for the information! Would you please specify the version of NFC reader library for PN7462?
Thanks for your patience!
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
The phhalRf_PCD_Exchg() is from
PN7462AU-FW_v05.19.00
BR,
Sam
Hi Sam,
We finally found a 424 FeliCa card, and these are the reproduction steps:
Result is that it returns TIMEOUT:
This is:Also tested here before ReqC command, with the same outcome again timeout:
So, my conclusion is that under normal circumstances this is not reproducible.
Is there a possibility you test with the same card, so we can corner the problem?
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kan,
In our case:
a. detect Felica card
b. Authenticate Felica with SAM card
c. After authentication, read block data from Felica
d. print out data
The lockup happens on c. (block data reading) when removing card.
It's 100% reproducable. However I understand for you to setup the SAM environment is not easy.
(The SAM / Felica is from project, SAM is from SONY RC-S500)
BR,
Sam
Hi Sam,
Thanks for the information! Did you set a breakpoint at a line before calling phhalRf_PCD_Exchg()?When did you remove the card ? right after the breakpoint hit? Did this issue happen after you continue to run the application? Please kindly clarify.
Thanks for your patience!
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kan,
1. set breackpoint at line before calling phhalRf_PCD_Exchg()
2. remove card
3. continue to run
The code blocked at phhalRf_PCD_Exchg() and never return.
BR,
Sam
Hi Sam,
We are trying to reproduce this issue here, but without any FeliCa card, did you try with other types of card? Did it behave the same? Please kindly clarify.
Thanks for your patience!
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------