PN7462 HSU UART TX Complete Callback Not Triggering

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

PN7462 HSU UART TX Complete Callback Not Triggering

110件の閲覧回数
uday_gowda
Contributor II

Hi Team,

I am working on HSU UART communication on PN7462 and have implemented HIF initialization as below:

void Hif_UartInit(void)
{
    phStatus_t status;

    gHifConfig.eInterface = E_HIF_HSU;

    gHifConfig.sConfig.sHsuConfig.bIsHsuBoot  = 0;
    gHifConfig.sConfig.sHsuConfig.bBaudRate   = E_HSU_BAUDRATE_9_6K;
    gHifConfig.sConfig.sHsuConfig.bStopBits   = 1;
    gHifConfig.sConfig.sHsuConfig.bDummyBytes = 0;
    gHifConfig.sConfig.sHsuConfig.bEOF        = 0;

    gHifConfig.bTimeout       = 0;
    gHifConfig.eBufferType    = E_BUFFER_FORMAT_FREE;
    gHifConfig.bShortFrameLen = 0;
    gHifConfig.bStoreErrData  = 0;
    gHifConfig.bHeaderSize    = 0;

    status = phhalHif_Init(
        &gHifConfig,
        (pphhalHif_Callback_t)Hif_UartErrorCallback
    );

    status = phhalHif_InitRxBuffer(
        E_RX_BUFFER_ID0,
        HIF_UART_RX_MAX_FRAME,
        gHifRxBuffer,
        (pphhalHif_Callback_t)Hif_UartRxCallback
    );

    gUartStream = xStreamBufferCreate(
        HIF_UART_STREAM_SIZE,
        1
    );
}

Observed behavior in my implementation:

  • RX callback triggers correctly

  • Commands are received successfully

  • TX API is invoked

  • However, TX complete callback is not triggered consistently

  • Continuous transmission from main() does not complete as expected

My simplified implementation is:

int main(void)
{
    phFlashBoot_Main();
    phhalTimer_Init();
    phOsal_Init();

    Hif_UartInit();

    while(1)
    {
        LOG_TXT("sending....\n");

        Hif_Print("hello");

        phUser_Wait(10000000);
    }

    return 0;
}

I also compared this with the PN7462 phExDoorAccess example.

In DoorAccess example:

int main(void)
{
    phFlashBoot_Main();
    phhalTimer_Init();
    phOsal_Init();

    phExDoorAccess_SystemTaskInit();

    phExDoorAccess_BootHandler();

    phRtos_Start();

    return 0;
}

Observed behavior in DoorAccess:

  • System tasks are initialized

  • RTOS scheduler is started using phRtos_Start()

  • After card detection/authentication, UART transmission over Host interface works correctly

  • TX completion callback is received successfully

However, in my implementation where transmission is triggered continuously from main(), TX completion callback is not observed.

I would like to understand:

  1. Is additional HIF/HSU configuration required apart from phhalHif_Init() and phhalHif_InitRxBuffer()?

  2. Does HSU TX callback require explicit registration or enabling?

  3. Is phRtos_Start() / scheduler mandatory for HSU TX completion callbacks?

  4. Does HIF require a separate API to start RX/TX handling after buffer initialization?

  5. Are there dependencies in the DoorAccess example (tasks/events/RTOS context) that enable UART TX completion handling?

  6. Are there known conditions where transmit API is called successfully but TX complete callback is not generated?

Please let me know if any initialization sequence or configuration is missing.

Thanks.

0 件の賞賛
返信
2 返答(返信)

89件の閲覧回数
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @uday_gowda

Hope you are doing well.

I am checking your inquiry.

In the meantime, could you please take a look at the post PN7462 UART Communication? Perhaps you may find some useful hints in that discussion; please let me know your findings.

Also, by any chance, have you referred to ex_phExHif demo from NFC Reader Library for PN7462?

Regards,
Eduardo.

0 件の賞賛
返信

61件の閲覧回数
uday_gowda
Contributor II

Hello,

Thank you for the inputs and for sharing the references. I will go through the PN7462 UART Communication discussion as well as the ex_phExHif demo from the NFC Reader Library.

In the meantime, I tried a simple periodic UART transmission test directly in the phExDoorAccess example project using the following implementation:

#include <phExDoorAccess_Utils.h>

int main(void)
{
    phFlashBoot_Main();
    phhalTimer_Init();
    phOsal_Init();

    /* Initialize HSU */
    phExDoorAccess_Utils_HsuHifConfig();

    while(1)
    {
        LOG_TXT("sending....\n");

        phExDoorAccess_Utils_Fill_Tx_Buffer("hello nxp ");

        phExDoorAccess_Utils_Hsu_Print(
            gphExDoorAccess_Utils_SysHsuTxBuffer);

        phUser_Wait(10000000);
    }

    return 0;
}

The transmit API used is:

void phExDoorAccess_Utils_Hsu_Print(uint8_t *inBuf)
{
#ifdef PHFL_ENABLE_HSU
    phhalHif_Transmit(
        (uint32_t *)inBuf,
        (uint16_t)strlen((const char *)inBuf),
        (pphhalHif_Callback_t)
        &phExDoorAccess_Utils_HsuHifTransmitCallBack);
#endif
}

Observation:

  • When UART transmission is triggered from normal DoorAccess flow (for example after card detection/authentication), transmission works and TX callback is received.
  • However, when using the above periodic transmission test directly from main() before starting the RTOS/task flow, transmission does not work as expected.

Could you please help clarify why this periodic HSU transmit approach in main() does not work, while UART transmission in the regular DoorAccess flow functions correctly? I would like to understand whether HSU TX completion depends on RTOS/task initialization, additional HIF setup, or another required execution context.

Thanks.

0 件の賞賛
返信