AnsweredAssumed Answered

PN7462 lockup at phhalRf_PCD_Exchg call

Question asked by Sam Lin on Oct 16, 2018
Latest reply on Nov 1, 2018 by Sam Lin

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

Outcomes