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.

RTOS/CC1350: check for RF_postCmd done

Part Number: CC1350

Tool/software: TI-RTOS

If I want just to know that a post command of open Rx

rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback_ACK, RF_EventRxEntryDone); 

was done (for  acknowledge).

Can I check right away the status , and if so what is the define for action done , like this RF_cmdPropRx.status == PROP_DONE_OK ?

If not what action can I do?

Thanks

Bar.

  • Hi,

    Bar Strauss1 said:
    Can I check right away the status , and if so what is the define for action done , like this RF_cmdPropRx.status == PROP_DONE_OK ?

    You can potentially only check the status field:

    rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback_ACK, RF_EventRxEntryDone); 
    
    // Block until the command is running or until it has 
    // been terminated for a reason.
    commandHasStarted = false;
    while (commandHasStarted == false)
    {
        uint32_t status = (volatile RF_Op*)&RF_cmdPropRx)->status;
        if ((status != IDLE) && (status != PENDING))
        {
            commandHasStarted = true;
        }
    }
    // Now the command is either running or it has already been terminated
    // for instance because of an error.

    Please also read this document and its warnings carefully because polling the command status is dangerous when not done carefully.

  • O.K.
    And if I also wan't to know there was an error does it show on the status and what code it show?

    If I do like this after the while loop

    if( ((volatile RF_Op*)&RF_cmdPropRx)->status & 0x0800) // go out because of some error

    Can it work or there more status code not error use this bit?
    Regards
    Bar.

  • Bar Strauss1 said:

    If I do like this after the while loop

    if( ((volatile RF_Op*)&RF_cmdPropRx)->status & 0x0800) // go out because of some error

    Can it work or there more status code not error use this bit?

    Yes, this is the way to do it. You may use switch/case if you want to distinguish between various error cases. Error codes for proprietary commands:

    Generic error codes:

    Those have been taken from the Technical Reference Manual.

  • Understood Richard.

    What is the different between Error codes for proprietary commands and Generic error codes and in my case (postCmd) which one  is relevant for me?

    Bar.

  • Generic error codes relate to any radio operation command. Proprietary error codes relate only to proprietary radio operation commands. Not every command produces all errors. The following generic error codes are relevant for proprietary commands:

    • ERROR_PAST_START 0x0800 ///< The start trigger occurred in the past (only when using absolute triggers)
    • ERROR_START_TRIG 0x0801 ///< Illegal start trigger parameter
    • ERROR_CONDITION 0x0802 ///< Illegal condition for next operation (only when using chains)
    • ERROR_PAR 0x0803 ///< Error in a command specific parameter (applies only to setup command when providing invalid overrides)
    • ERROR_POINTER 0x0804 ///< Invalid pointer to next operation (only when chaining)
    • ERROR_CMDID 0x0805 ///< Next operation has a command ID that is undefined or not a radio operation command
    • ERROR_NO_SETUP 0x0807 ///< Operation using Rx or Tx attemted without CMD_RADIO_SETUP
    • ERROR_NO_FS 0x0808 ///< Operation using Rx or Tx attemted without frequency synth configured
    • ERROR_SYNTH_PROG 0x0809 ///< Synthesizer calibration failed

    Not every error can occur in any situation. For the RX command, you only really need to check ERROR_NO_FS because of a synthesizer issue on revision B (see errata) and ERROR_PAST_START if you use absolute start triggers.