SWRA571B August 2017 – August 2020 CC1310 , CC1310 , CC1312PSIP , CC1312PSIP , CC1312R , CC1312R , CC1314R10 , CC1314R10 , CC1350 , CC1350 , CC1352P , CC1352P , CC1352P7 , CC1352P7 , CC1352R , CC1352R
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:
#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.
#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;
// 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;
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 = ¤tReadEntry->rxData;
//---------------------------------------------------------------------------
// Implement code for handling the IQ data
// .
// .
// .
// .
//---------------------------------------------------------------------------
currentReadEntry->status = DATA_ENTRY_PENDING;
currentReadEntry = (rfc_dataEntryPartial_t*)currentReadEntry->pNextEntry;
}
}