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.

SMPL_TX_CCA_FAIL CC1200

Other Parts Discussed in Thread: SIMPLICITI, CC1200, CC2500, CC1100

Hi All

my platform is TM4C129X+CC1200, I porting the simpliciTI protocol on this platform,

  if (MRFI_TX_RESULT_SUCCESS == MRFI_Transmit(&pFrameInfo->mrfiPkt, txOption))
  {
    rc = SMPL_SUCCESS;
  }
  else
  {
    /* Tx failed -- probably CCA. free up frame buffer. We do not have NWK
     * level retries. Let application do it.
     */
    rc = SMPL_TX_CCA_FAIL;
  }

when I send the packet, the rc return SMPL_TX_CCA_FAIL.so I analysis some possibilies.

1. in this Area, I sure about that have no others expect me use this channel, certainly, no others use the sub-1G.

2.in IAR debug mode, the program run step by step , the rc return SMPL_SUCCESS, but when I just run full speed. the rc return SMPL_TX_CCA_FAIL.

3.my SPI rate is 1M, I'm not sure this rate has influence on the rc value.

4.change the MRFI_CCA_RETRIES has no change no rc value,

  • Hi

    The MRFI_Transmit function implements delays of the type MRFI_WaitTimeoutUsec etc. Have you checked that these delays are of the correct length after porting your code?

    I looks like you have a timing problem since you get different results when stepping through your code compared to what you get when running it “real time”

    Siri

  • Hi Siri
    When I debug program step by step, the rc value return SMPL_SUCCESS, but when I just run it , the rc return SMPL_TX_CCA_FAIL.
    1.first I think the delay is not enough, /* radio must be awake to transmit */
    MRFI_ASSERT( mrfiRadioState != MRFI_RADIO_STATE_OFF );
    /* Turn off reciever. We can ignore/drop incoming packets during transmit. */
    Mrfi_RxModeOff(); MRFI_PrepareToTx( pPacket );
    /* ------------------------------------------------------------------
    * Immediate transmit * --------------------- */
    if (txType == MRFI_TX_TYPE_FORCED) { //#ifdef NWK_PLL
    // BSP_ENTER_CRITICAL_SECTION(s);//#endif
    // MRFI_CompleteTxPrep( pPacket );#ifdef NWK_PLL do {
    BSP_ENTER_CRITICAL_SECTION(s);
    if( stx_active == false ) // if the channel was changed {
    BSP_EXIT_CRITICAL_SECTION(s);
    Mrfi_RxModeOff(); // turn off the radio
    MRFI_PrepareToTx( pPacket ); // setup transmission again
    continue; // restart the loop } MRFI_CompleteTxPrep( pPacket );
    } while( 0 );#endif /* Issue the TX strobe. */
    mrfiSpiCmdStrobe( STX );#ifdef NWK_PLL BSP_EXIT_CRITICAL_SECTION(s);
    #endif /* Wait for transmit to complete */
    Mrfi_DelayUsecLong( MRFI_MAX_TRANSMIT_TIME_us / 1000,
    MRFI_MAX_TRANSMIT_TIME_us % 1000,
    mrfi_TxImmediateDone );
    /* Clear the interrupt flag */ MRFI_CLEAR_SYNC_PIN_INT_FLAG(); } else
    { /* ------------------------------------------------------------------
    * CCA transmit * --------------- */
    MRFI_ASSERT( txType == MRFI_TX_TYPE_CCA );
    /* set number of CCA retries */ ccaRetries = MRFI_CCA_RETRIES;
    /* For CCA algorithm, we need to know the transition from the RX state to
    * the TX state. There is no need for SYNC signal in this logic. So we
    * can re-configure the GDO_0 output from the radio to be PA_PD signal
    * instead of the SYNC signal.
    * Since both SYNC and PA_PD are used as falling edge interrupts, we
    * don't need to reconfigure the MCU input. */
    MRFI_CONFIG_GDO0_AS_PAPD_SIGNAL();
    /* ===============================================================================
    * Main Loop * ============= */ for (;;) {
    /* Radio must be in RX mode for CCA to happen.
    * Otherwise it will transmit without CCA happening. */
    /* Can not use the Mrfi_RxModeOn() function here since it turns on the
    * Rx interrupt, which we don't want in this case. */
    mrfiSpiCmdStrobe( SRX );
    Mrfi_DelayUsec(461); // calibaration time when moving from idle to RX/TX //<<<<<<<<<<<<<<<<<<<<<<<
    /* wait for the rssi to be valid. */#ifdef MRFI_TIMER_ALWAYS_ACTIVE
    MRFI_WaitTimeoutUsec(MRFI_RSSI_VALID_DELAY_US, Mrfi_ValidateRSSI);
    #else // MRFI_TIMER_ALWAYS_ACTIVE MRFI_RSSI_VALID_WAIT();
    #endif // MRFI_TIMER_ALWAYS_ACTIVE#ifdef NWK_PLL
    BSP_ENTER_CRITICAL_SECTION(s);
    if( stx_active == false ) // if the channel was changed {
    BSP_EXIT_CRITICAL_SECTION(s);
    Mrfi_RxModeOff(); // turn off the radio
    MRFI_PrepareToTx( pPacket ); // setup transmission again
    continue; // restart the cca loop }
    MRFI_CompleteTxPrep( pPacket );#endif /*
    * Clear the PA_PD pin interrupt flag. This flag, not the interrupt itself,
    * is used to capture the transition that indicates a transmit was started.
    * The pin level cannot be used to indicate transmit success as timing may
    * prevent the transition from being detected. The interrupt latch captures
    * the event regardless of timing. */
    MRFI_CLEAR_PAPD_PIN_INT_FLAG(); /* Issue the TX strobe. */
    mrfiSpiCmdStrobe( STX );#ifdef NWK_PLL BSP_EXIT_CRITICAL_SECTION(s);
    #endif /* Delay long enough for the PA_PD signal to indicate a
    * successful transmit. This is the 250 XOSC periods
    * (9.6 us for a 26 MHz crystal) See section 19.6 of 2500 datasheet.
    * Found out that we need a delay of atleast 20 us on CC2500 and
    * 25 us on CC1100 to see the PA_PD signal change. */
    Mrfi_DelayUsec(25);
    /* PA_PD signal goes from HIGH to LOW when going from RX state.
    * This transition is trapped as a falling edge interrupt flag
    * to indicate that CCA passed and the transmit has started. */
    if (MRFI_PAPD_INT_FLAG_IS_SET()) {
    /* ------------------------------------------------------------------
    * Clear Channel Assessment passed.
    * ---------------------------------- */
    /* Clear the PA_PD int flag */ MRFI_CLEAR_PAPD_PIN_INT_FLAG();
    but I have no idea about where the delay length need change,also change to what size should be suitable.
  • Hi

    First I would recommend that you test that your Mrfi_DelayUsec() and MRFI_WaitTimeoutUsec function works as it should.

    If you toggle a led before and after calling the function Mrfi_DelayUsec(100), is the delay 100 us as it should be or something else? If the delay is OK you either check all your calculations.

    The MRFI_RSSI_VALID_DELAY_US can be calculated based on the excel sheet found here:

    www.ti.com/.../swra428.

    The delay for the PA_PD signal must be measure etc.

    You can also just increase one and one delay to see how much they must be increased for your code to work OK.

    Siri