SWRA571B August   2017  – August 2020 CC1310 , CC1310 , CC1312PSIP , CC1312PSIP , CC1312R , CC1312R , CC1314R10 , CC1314R10 , CC1350 , CC1350 , CC1352P , CC1352P , CC1352P7 , CC1352P7 , CC1352R , CC1352R

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
  4. 2IQ Dump Patch
    1. 2.1 Recommended Operating Limits
      1. 2.1.1 Register Overrides
      2. 2.1.2 API Configuration
  5. 3Building a Software Example
  6. 4Testing the Patch Using the Built-In Test Pattern
  7. 5References
  8. 6Revision History

Building a Software Example

To test the RF performance of the patch, see the rfPacketRX example available when downloading [2] or [3].

The smartrf_settings.c file must be replaced with the one from the zip file that can be downloaded from the following link: http://www.ti.com/lit/zip/swra571. The following modifications must be done to rfPacketRX.c to be able to test the patch:

  1. Define how many IQ sample pairs you want.
    #define NUMBER_OF_SAMPLE_PAIRS 300

    Setting NUMBER_OF_SAMPLE_PAIRS to 300 means that each data entry used must have room for 300 x 3 bytes.

  2. Configure two partial read buffers for the received data. Make sure that the buffers are 4 byte aligned.
    #define PARTIAL_RX_ENTRY_HEADER_SIZE 12
    
    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_ALIGN (rxDataEntryBuf1, 4);
    static uint8_t rxDataEntryBuf1[PARTIAL_RX_ENTRY_HEADER_SIZE + 
                                  (NUMBER_OF_SAMPLE_PAIRS * 3)];
    #pragma DATA_ALIGN (rxDataEntryBuf2, 4);
    static uint8_t rxDataEntryBuf2[PARTIAL_RX_ENTRY_HEADER_SIZE + 
                                  (NUMBER_OF_SAMPLE_PAIRS * 3)];
    #endif
    rfc_dataEntryPartial_t* partialReadEntry1 = (rfc_dataEntryPartial_t*)&rxDataEntryBuf1;
    rfc_dataEntryPartial_t* partialReadEntry2 = (rfc_dataEntryPartial_t*)&rxDataEntryBuf2;
    rfc_dataEntryPartial_t* currentReadEntry = (rfc_dataEntryPartial_t*)&rxDataEntryBuf1;
    
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
        partialReadEntry1->length = (NUMBER_OF_SAMPLE_PAIRS * 3) + 4;
        partialReadEntry1->config.type = DATA_ENTRY_TYPE_PARTIAL;
        partialReadEntry1->status = DATA_ENTRY_PENDING;
    
        partialReadEntry2->length = (NUMBER_OF_SAMPLE_PAIRS * 3) + 4;
        partialReadEntry2->config.type = DATA_ENTRY_TYPE_PARTIAL;
        partialReadEntry2->status = DATA_ENTRY_PENDING;
    
        partialReadEntry1->pNextEntry = (uint8_t*)partialReadEntry2;
        partialReadEntry2->pNextEntry = (uint8_t*)partialReadEntry1;
    
        dataQueue.pCurrEntry = (uint8_t*)partialReadEntry1;
        dataQueue.pLastEntry = NULL;
  3. Remove RFQueue_defineQueue and the modifications of RF_cmdPropRX, except for the RF_cmdPropRx.pQueue.
    // if( RFQueue_defineQueue(&dataQueue,
    //                        rxDataEntryBuffer,
    //                        sizeof(rxDataEntryBuffer),
    //                        NUM_DATA_ENTRIES,
    //                        MAX_LENGTH + NUM_APPENDED_BYTES))
    //{
    //    /* Failed to allocate space for all data entries */
    //    while(1);
    //}
    
    RF_cmdPropRx.pQueue = &dataQueue;
    /* Discard ignored packets from Rx queue */
        // RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1;
        /* Discard packets with CRC error from Rx queue */
        // RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1;
        /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
        // RF_cmdPropRx.maxPktLen = MAX_LENGTH;
        // RF_cmdPropRx.pktConf.bRepeatOk = 1;
        // RF_cmdPropRx.pktConf.bRepeatNok = 1;
  4. Implement handling of the IQ samples in the callback. In the callback the samples should simply be read from the data entries to make the data entries available for new samples. The processing of the IQ samples should be done outside the callback. It is not the scope of this application report to show how this can be done. The code below simply shows how to get access to the samples and how to handle the queue.
    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if (e & RF_EventRxEntryDone)
        {
            // Toggle pin to indicate RX
            PIN_setOutputValue(pinHandle,
                               Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
            // Get a pointer to the first IQ sample byte
            packetDataPointer = &currentReadEntry->rxData;
            //---------------------------------------------------------------------------
            // Implement code for handling the IQ data
            //    .
            //    .
            //    .
            //    .
            //---------------------------------------------------------------------------
            currentReadEntry->status = DATA_ENTRY_PENDING;
            currentReadEntry = (rfc_dataEntryPartial_t*)currentReadEntry->pNextEntry;
        }
    }