This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

System hangs on RF_pendCmd

I set up the EasyLink txPacket to my liking and attempt to transmit the data. Within the EasyLink_transmit routine, “RF_postCmd” executes, “RF_pendCmd” hangs up my program. Documentation says that the “_pend” is waiting for the above command to end, but it appears that it never does. The program ends up at SysCallback when I break.

How can I debug this hangup? I can’t prove it, but it appears that if “result” returned, it would return as “RF_EventCmdError”. The original packet I pass looks like any other I’ve transmitted in other routines.

Thanks in advance,

 

1)      KeypadRadioTask.C : sendKPCmd()

/* Send packet */
if(EasyLink_transmit(&txPacket) != EasyLink_Status_Success) {
System_abort("EasyLink_transmit failed");

}

2)      EasyLink.C : EasyLink_transmit()

// Send packet
RF_CmdHandle cmdHdl = RF_postCmd(rfHandle, (RF_Op*)&EasyLink_cmdPropTx,
RF_PriorityNormal, 0, EASYLINK_RF_EVENT_MASK);

// Wait for Command to complete
RF_EventMask result = RF_pendCmd(rfHandle, cmdHdl, (RF_EventLastCmdDone |
RF_EventCmdError));

1)      SysCallback.c

/*
* ======== xdc_runtime_SysCallback_defaultAbort ========
* Default implementation of abort callback function
*/
Void xdc_runtime_SysCallback_defaultAbort(CString str)
{
for (;;) {
/* spin forever */
}
}

  • What is the str value when you are spinning in xdc_runtime_SysCallback_defaultAbort? Can you look at RTOS Object Viewer (ROV) to see if there are any corruption issues? The easiest way is to select ROV->BIOS->Scan for Errors...

    Todd
  • In addition to Todd's suggestions, in EayLink.c make sure the below are not defined as static:

    rfc_CMD_PROP_TX_t EasyLink_cmdPropTx

    uint8_t txBuffer[1 + EASYLINK_MAX_ADDR_SIZE + EASYLINK_MAX_DATA_LENGTH];

    After the lockup halt the debugger and post the value of these variables, expanded in hex, for txBuffer it might be best to view in the memory browser.

    Regards,

    TC.

  • 1) I made sure neither variable was declared static(only had to changer txBuffer)

    2) txBuffer filled with 0x00, except first to bytes, which are both set to destination address (0xCC)

    3) str = "EasyLink_transmit failed"

    4) CAN NEVER FIGURE OUT HOW TO PASTE A GRAPHIC HERE. Then I can convey the "Scan for errors" output.

  • What is the return from EasyLink_transmit? It looks like there are only 4 unique error conditions returned from the call: EasyLink_Status_Tx_Error, EasyLink_Status_Config_Error, EasyLink_Status_Busy_Error, or EasyLink_Status_Param_Error.
  • Saycoda,
    Thanks you for sharing your source code, after reviewing your code I think I see the issue:

    After sending the Ack it goes back to Rx:

    /* If valid packet received */
    if(events & RADIO_EVENT_VALID_PACKET_RECEIVED) {

    sendAck(ackPacket.header.sourceAddress);

    /* Call packet received callback */
    notifyPacketReceived(&latestRxPacket);


    /* Go back to RX */
    if(EasyLink_receiveAsync(rxDoneCallback, 0) != EasyLink_Status_Success) {
    System_abort("EasyLink_receiveAsync failed");
    }


    While already in Rx you do:

    /* Send packet */
    if(EasyLink_transmit(&txPacket) != EasyLink_Status_Success) {
    System_abort("EasyLink_transmit failed");

    }

    As the Rx is already running the EasyLink_transmit will return EasyLink_Status_Busy_Error. Before trying to Tx you should abort the Rx:

    /* Abort to leave RX */
    if(EasyLink_abort() != EasyLink_Status_Success) {
    System_abort("EasyLink_abort failed");
    }

    Note that the rxDoneCallback will be called with the EasyLink_Status_Aborted status, so you will need to handle this case.

    Regards, TC.