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.

Code question from a customer - proprietary radio code provided by TI

"The questions relate to the example proprietary radio code provided by TI,  either all possible error results are not enumerated, or they are handled by case statements that just immediately break out, so there is no indication how to handle the error condition and I have not found any guidance in the documentation.  If you can point me to the documentation that specifically answers my questions, that would also be great.

I would like to have the code I am writing to be able to correctly handle any radio conditions that occur. I have not encountered any of the error conditions I list below in my current testing but since they are a possibility, the code must handle them.  Also, if I understand how they can occur, they I can make them happen and ensure that the code handles them correctly.

If more or better details are needed to address my questions, happy to provide it.  As always, I appreciate your help.

1.

AESCBS_oneStepDecrypt

Our proprietary protocol using CBC based encryption/decryption.  The code I have written is working, specifically, for example, the result from the AESCBC_oneStepDecrypt() function is always AESCBC_STATUS_SUCCESS. But there are 3 more possibilities the function could return

    case AESCBC_STATUS_ERROR:   // decryption operation failed (-1)

    case AESCBC_STATUS_RESOURCE_UNAVAILABLE: // decryption required hardware resource was not available. Try again later. (-2)

    case AESCBC_STATUS_CANCELED: // decryption operation was canceled. (-3)

 

How should any of these conditions be handled?

 

2.

In the radio callback function for the ‘receiver’, I have encountered only two status values, PROP_DONE_OK, and PROP_DONE_TXTIMEOUT. Handling the PROP_DONE_RXTIMEOUT status is easy and straightforward, the PROP_DONE_OK leads to 5 possible status values for the message that has been queued shown below. The DATA_ENTRY_FINISHED status is what is desired and so far, always what I have observed, I would like to know what action(s) to take for the other status values if they occur.

 

PROP_DONE_OK

                  case  DATA_ENTRY_FINISHED:    // Radio CPU is finished accessing the entry

                    case DATA_ENTRY_PENDING:      // Entry not yet used

                    case DATA_ENTRY_ACTIVE:       // Entry in use by radio CPU

                    case DATA_ENTRY_BUSY:         // Entry being updated

                    case DATA_ENTRY_UNFINISHED:   // Radio CPU is finished accessing the entry, but packet could not be finished

 

start of callback furnction

void callback_RFRX(RF_Handle h, RF_CmdHandle cmdHnd, RF_EventMask e)

{

    bool cleanup_receive_queue = false;

 

    if ((e & RF_EventLastCmdDone))

    {

            g_got_a_RF_callback_at_RAT_time = RF_convertUsToRatTicks(RF_getCurrentTime());

 

            RF_Op* cmdRF_Op =  RF_getCmdOp(h, cmdHnd);   // RF_Op (defined in rf_common_cmd.h), struct __RFC_STRUCT rfc_radioOp_s, get the 'just completed command'

 

            // See rf_prop_mailbox.h for list of all possible radio operation status

            switch(cmdRF_Op->status)

            {

                case PROP_DONE_OK:

                …….

 

The other possible radio callback status values as I understand it are the following. How should they be handled?

    case PROP_DONE_BREAK:   // RX stopped due to timeout in the middle of a packet

    case PROP_DONE_ENDED:   // Operation stopped after end trigger during reception

    case PROP_DONE_STOPPED: // Operation stopped after stop command

    case PROP_DONE_ABORT:   // Operation aborted by abort command

    case PROP_DONE_RXERR:   // Operation ended after receiving packet with CRC error

    case PROP_DONE_IDLE:    // Carrier sense operation ended because of idle channel

    case PROP_DONE_BUSY:    // Carrier sense operation ended because of busy channel

    case PROP_DONE_IDLETIMEOUT: // Carrier sense operation ended because of timeout with csConf.timeoutRes = 1

    case PROP_DONE_BUSYTIMEOUT: // Carrier sense operation ended because of timeout with csConf.timeoutRes = 0

    case PROP_ERROR_PAR: // Illegal parameter

    case PROP_ERROR_RXBUF: // No available Rx buffer at the start of a packet

    case PROP_ERROR_RXFULL: // Out of Rx buffer during reception in a partial read buffer

    case PROP_ERROR_NO_SETUP: // Radio was not set up in proprietary mode

    case PROP_ERROR_NO_FS: // Synth was not programmed when running Rx or Tx

    case PROP_ERROR_RXOVF: // Rx overflow observed during operation

    case PROP_ERROR_TXUNF: // Tx underflow observed during operation"

  • Hi Emil,

    Thank you for providing a substantial amount of detail in your post, please hold while I find an expert to answer your questions.

    Regards,
    Ryan

  • Emil,

    In general, how to handle and which cases to handle depend on the application and it's up to the developer to decide which cases apply to their application. 

    How should any of these conditions be handled?

    I would recommend looking at the source for the AESCBC driver to see how these conditions can happen. For example, AESCBC_STATUS_CANCELED will be returned if AESCBC_cancelOperation() is called. If you don't intend to ever cancel the operation then nothing is required. AESCBC_STATUS_ERROR is a more generic error that can be caused by other errors. If this is returned you may want to run the operation again.

                      case  DATA_ENTRY_FINISHED:    // Radio CPU is finished accessing the entry

                        case DATA_ENTRY_PENDING:      // Entry not yet used

                        case DATA_ENTRY_ACTIVE:       // Entry in use by radio CPU

                        case DATA_ENTRY_BUSY:         // Entry being updated

                        case DATA_ENTRY_UNFINISHED:   // Radio CPU is finished accessing the entry, but packet could not be finished

    These are status of the data queue and are defined in rf_mailbox.h. These are used when you are accessing your txEntry or rxEntry queues and they are used by the device when the radio or application core accesses the queues. They are not returned values from PROP_DONE_OK.

    The other possible radio callback status values as I understand it are the following. How should they be handled?

    How you handle these depends on your application. Depending on the returned status you may want to retransmit, flush the packet, reset the FIFO or queue, or resubmit the Radio command. How you handle these cases is also dependent on how you set up your radio commands (for example, if you set up the PropRF command to automatically flush CRC errors you won't need the PROP_DONE_RXERR case.) That's why the examples only have a framework showing the possible statuses.

    the Proprietary RF User Guide is available here: https://dev.ti.com/tirex/explore/node?node=AKo8sAEb13jFuenht-NmOQ__BSEc4rl__LATEST&r=BSEc4rl__5.30.00.56 You can find more documentation on specific RF in the header files specific to the PHY you are using (e.g. rf_prop_cmd.h, rf_prop_mailbox.h, etc.)

    Regards,

    Daniel

  • Hi Daniel,

    Thanks for the help! One last follow up question, regarding the second question:

    "Question 2: I could have written it more clearly, I should have taken more care in writing, I understand that the responses are for the status of the queue and not the command. I got the possible queue status values from looking at rf_mailbox.h, I just wanted more clarification of the actions to take if not DATA_ENTRY_FINISHED, I have added error indications in my code if those other status results occur."

    Best,

    Emil

  • DATA_ENTRY_PENDING is the default status of the queue before it is used. Active and Busy mean the queue is in use or being updated and you shouldn't modify the queue or current entry. DATA_ENTRY_UNFINISHED is for partial RX entries only.

    Read more about data queues here: https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/docs/proprietary-rf/proprietary-rf-users-guide/rf-core/data-queues.html#id3 

    Regards,

    Daniel