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.

CC1350: Simultaneous Receive/Transmit Not Working With CC1350 Using RF Driver

Part Number: CC1350


Dear Support:

I am trying to get a simultaneous transmit and receive example working such that I can receive a packet and parse the packet and based on the contents create a new packet and transmit it.  I am using the CC1350 LP running SDK1.30 .  I have my own CCS project where I used code from the rfPacketRx and rfPacketTx examples to create a task that can receive and transmit packets.  When I am just receiving packets back to back - no problem.  I can receive packets over and over with no problem.  And when I transmit packets over and over - also no issue.  I am using the code below when transmitting a packet:

RF_cancelCmd(rfHandle, rfRxCmd, 0);
RF_cmdPropTx.commandNo = CMD_PROP_TX;
RF_cmdPropTx.pPkt = ( uint8_t * )message.FramePtr;
RF_cmdPropTx.pktLen = message.FrameBytes;
RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
RF_cmdPropTx.startTrigger.pastTrig = 1;
RF_cmdPropTx.startTime = 0;
rfTxCmd = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0 );
EventMask = RF_pendCmd(rfHandle, rfTxCmd,
(RF_EventCmdDone | RF_EventCmdError | RF_EventLastCmdDone | RF_EventCmdAborted | RF_EventCmdCancelled | RF_EventCmdStopped));

where I do a cancel of any previous rfRxCmd with the RF_cancelCmd(...) and then update the Tx structure RF_cmdPropTx prior to transmitting the packet and then transmit the packet.  I have also used the code below:

RF_cancelCmd(rfHandle, rfRxCmd, 0);
RF_cmdPropTx.commandNo = CMD_PROP_TX;
RF_cmdPropTx.pPkt = ( uint8_t * )message.FramePtr;
RF_cmdPropTx.pktLen = message.FrameBytes;
RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
RF_cmdPropTx.startTrigger.pastTrig = 1;
RF_cmdPropTx.startTime = 0;
EventMask = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, TxCallback,
IRQ_COMMAND_DONE | IRQ_LAST_COMMAND_DONE | IRQ_TX_DONE | IRQ_TX_ENTRY_DONE );

and also no issues where in this case I am using a transmit callback to know that I transmitted the packet successfully.  As long as I transmit over and over - no issues.  However if I receive a packet and then follow the reception of this packet with a transmit of a new packet and it runs this code above, it never transmits the packet and either blocks in the RF_pendCmd(...) in the 1st case or the RF_runCmd(...) in the 2nd case.  However the receiving of the packets continues along just fine.  For some reason, after receiving a packet and then calling this code above, I can no longer transmit any packets.  Do you know what I may be doing wrong?  Please advise.

Alternatively when doing simultaneous transmit and receive what is the proper procedure to follow such that the transmission of a packet does not lock up as I am experiencing in the above 2 cases?

Thanks,
Tim

  • Hi Tim

    I used the rfPacketRX example and modified it to transmit a packet every time a packet is received with CRC OK.
    I transmit the payload of the received packet.
    The code is found below:

    static uint8_t rxPacket[MAX_LENGTH + NUM_APPENDED_BYTES - 1]; /* The length byte is stored in a separate variable */
    static uint8_t txPacket[MAX_LENGTH];
    
    static void rxTaskFunction(UArg arg0, UArg arg1)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        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);
        }
    
        /* Modify CMD_PROP_RX command for application needs */
        RF_cmdPropRx.pQueue = &dataQueue;           /* Set the Data Entity queue for received data */
        RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1;  /* Discard ignored packets from Rx queue */
        RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1;   /* Discard packets with CRC error from Rx queue */
        RF_cmdPropRx.maxPktLen = MAX_LENGTH;        /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
        RF_cmdPropRx.pktConf.bRepeatOk = 0;         /* Exit RX if a good packet is received */
        RF_cmdPropRx.pktConf.bRepeatNok = 1;
        
        RF_cmdPropTx.pPkt = txPacket;
        RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        while(1)
        {
            rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, NULL, 0);
            RF_pendCmd(rfHandle, rxCmdHndl, RF_EventLastCmdDone);
            
            currentDataEntry = RFQueue_getDataEntry();
    
            packetLength      = *(uint8_t*)(&currentDataEntry->data);
            packetDataPointer = (uint8_t*)(&currentDataEntry->data + 1);
            memcpy(rxPacket, packetDataPointer, (packetLength + 1));
    
            RFQueue_nextEntry();
            
            memcpy(txPacket, rxPacket, (packetLength + 1));
             
            RF_cmdPropTx.pktLen = packetLength;
            
            txCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
            RF_pendCmd(rfHandle, txCmdHndl, RF_EventLastCmdDone);
        }
    }

    Hope this helps

    BR

    Siri

  • Hey Siri:

    Thanks for your reply.  I duplicated what you have done and was able to get it to work ok.  Only difference I can see with what I am using is a semaphore that supports events and a mailbox that is used in addition with my code.  I will try to isolate the problem and try to determine what is going wrong with my code.  Thanks for providing me an easy example that works and allows me to test to a known working reference.  Will get back with you later on what I find out.

    Thanks,
    Tim

  • Hi Tim

    God luck with your debugging :-)
    If you are not able to get your code up and running you can send us your complete code so that we can take a look at it here. The easiest is if you send us a .c file that we can replace the rfPacketRX.c file with.

    BR
    Siri