PN7462 lockup at phhalRf_PCD_Exchg call

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN7462 lockup at phhalRf_PCD_Exchg call

1,331 Views
itrslin
Contributor I

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

Labels (1)
0 Kudos
9 Replies

1,102 Views
Kan_Li
NXP TechSupport
NXP TechSupport

There will be PH_ERR_IO_TIMEOUT returned in cases of Transmission does not completed or Reception does not happen.

pastedImage_1.png

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,102 Views
itrslin
Contributor I

Hi Sir,

My problem is the call never return. It locks.

BR,

Sam

0 Kudos

1,102 Views
Kan_Li
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,102 Views
itrslin
Contributor I

The phhalRf_PCD_Exchg() is from

PN7462AU-FW_v05.19.00

BR,

Sam

0 Kudos

1,102 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Sam,

We finally found a 424 FeliCa card, and these are the reproduction steps:

 

  1. First, I started RF example from 5.19
  2. I placed BP (breakpoint) on the phhalRf_PCD_Exchg() so just before reading command is executed
  3. I approached the card to the antenna. I have 424 Felica card here
  4. When the MCU stopped at BP I removed the card and executed the command
  5. Result is that it returns TIMEOUT:r1.jpg

    This is:r2.jpgAlso tested here before ReqC command, with the same outcome again timeout:r3.jpg

    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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,102 Views
itrslin
Contributor I

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

0 Kudos

1,102 Views
Kan_Li
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,102 Views
itrslin
Contributor I

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

0 Kudos

1,102 Views
Kan_Li
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos