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.

LP-CC1312R7: Transmit 2 different TX_ENTRY Data

Part Number: LP-CC1312R7


Hello everyone,

I am trying to create a structure by defining 2 different txEntry, one 260bit/32byte and the other 255byte, sending one of them 50 times and sending the other one once. This is exactly what I want to do:

sync_entry[33] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33}  -->  send 1 times. When 50 sends(sync_data_entry) are completed

data_entry[255] = {0}; --> send 50 times 

To perform the above operation;

 1. First of all, I define 2 different entities.

 2. I'm running the RF_EventTxEntryDone callback with RF_runCmd.

 3. I keep a counter every time the callback is active.

 4. I change txQueu.pCurrEntry according to the status of this counter.  

The relevant code is below;

rfc_dataEntryPointer_t txEntry;
rfc_dataEntryPointer_t sync_txEntry;
dataQueue_t txQueue;

void *rf_transmitThread(void *arg0)
{
txEntry.pNextEntry = (uint8_t*)&txEntry;
txEntry.status = DATA_ENTRY_PENDING;
txEntry.config.type = DATA_ENTRY_TYPE_PTR;
txEntry.pData = (uint8_t*)data_entry;
txEntry.length = sizeof(data_entry);

sync_txEntry.pNextEntry = (uint8_t*)&sync_txEntry;
sync_txEntry.status = DATA_ENTRY_PENDING;
sync_txEntry.config.type = DATA_ENTRY_TYPE_PTR;
sync_txEntry.pData = (uint8_t*)sync_entry;
sync_txEntry.length = sizeof(sync_entry);

txQueue.pCurrEntry = (uint8_t*)&sync_txEntry;
txQueue.pLastEntry = NULL;

    while(1)
    {
        RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, &callback, RF_EventTxEntryDone);
    }

}

void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
   if ( e & RF_EventTxEntryDone)
   {
       tx_entry_counter++;
   }
   if(tx_entry_counter % 50 == 0)
   {
      txQueue.pCurrEntry = (uint8_t*)&sync_txEntry;
   }
   else
   {
      txQueue.pCurrEntry = (uint8_t*)&txEntry;
   }
}



When I decode the data in the spectrum analyzer, I observe that the sync packet is not sent at all.

What I'm wondering is this. Does RF_EventTxEntryDone inform that the block we want has left the RF? When I read the description, I see that it only informs the queue that the packet has been received. Do you think there is any problem in the example I gave?

Sincelery

  • Hi Faruk,

    Looking at what you are trying to do, I would recommend you to use the CMD_COUNT_BRANCH rfcore command.

    If you look at the code posted there: https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1201184/cc1352p-radio-command-chain-for-tdma/4530400#4530400

    You can see that you could, for instance, start your counter at 50, and branch to your sync tx entry when you reached 0.

    Regards,

    Arthur

  • Hello @Arthur R,

    Thanks for reply.

    I understood what you wanted to say. but I'm not quite sure how to use CMD_COUNT_BRANCH?
    For example;
    - Will sync_byte or data byte_be sent first?
    - Can I configure it to send data_byte 50 times and then send sync_byte once?

    - Will the RF_cmdCountBrach.counter variable be automatically decremented?

    Sincelery

  • Hi Faruk,

    Here I have an example for CMD_COUNT_BRANCH.

        RF_cmdNop.startTrigger.triggerType = TRIG_NOW;
        RF_cmdNop.pNextOp = (RF_Op*)&RF_cmdPropTx;
    
        RF_cmdPropTx.pktConf.bUseCrc = 0;
        RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
        RF_cmdPropTx.condition.rule = COND_ALWAYS;
        RF_cmdPropTx.pNextOp = (RF_Op*)&RF_cmdCountBranch;
    
        RF_cmdCountBranch.counter = 49;
        RF_cmdCountBranch.startTrigger.triggerType = TRIG_NOW;
        RF_cmdCountBranch.pNextOpIfOk = (RF_Op*)&RF_cmdPropTx;
        RF_cmdCountBranch.condition.rule = COND_ALWAYS;
    
        /* Send packet 50 times using chaining */
        RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdNop,
                                                       RF_PriorityNormal, NULL, 0);


    If you want to start sync_byte, simply place it first in the chain, and configure pNextOp to be CMD_COUNT_BRANCH (RF_cmdCountBranch here).
    RF_cmdCountBranch, as long as the counter value is above 0, will execute the command pointed to by pNextOpIfOk.
    When the counter (decremented by CMD_COUNT_BRANCH itself, automatically) reaches 0, it will then execute the command pointed to by pNextOp.

    So, in your case, pNextOp has to be your data byte TX command. data byte's pNextOp will have to point the TX SYNC BYTE .

    Let me know if it is unclear.

    Regards,

    Arthur