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.

RTOS/CC1310: Reading RSSI level with TIRTOS

Part Number: CC1310


Tool/software: TI-RTOS

Hi,

my problem is the following. We developped a solution based on the collector/sensor examples from TI, and we want, in the collector, to get the RSSI on the RF core in order to perform jamming detection.

The solution I try to set up is as following : I set up a timer every second, in the callback, I am calling the RF_getRssi(rfHandle) function, which returns an error (-128) all the time.

So I have four questions :

- The collector has rx_on_idle set to true. Do we need to send an rx command before trying to get the rssi ?

- Is it safe to perform commands on the RF core while the main program is still executing and can exchange data with devices connected to the pan?

- What is a specific way to get a valid reading of the RSSI ?

- Is there a way to ensure that the RSSI is received when no message is currently being received ?

Here is the code of my opening of the rf core :

RF_Params rfParams;
RF_Params_init(&rfParams);
RF_RadioSetup *pOpSetup = NULL;

// Init jamming period mask
for(i = 0; i < DETECTION_PERIOD_S; ++i) {
    jdParams.jammingPeriodMask <<= 1;
    jdParams.jammingPeriodMask += 1;
}

// Open RF_core to be able to query the rssi values
pOpSetup = (RF_RadioSetup *)&RF_cmdPropRx;
jdParams.rfHandle = RF_open(&jdParams.rfObject, &RF_prop, pOpSetup, &rfParams);
if(jdParams.rfHandle == NULL) {
    System_abort("RF core opening failed");
}

With this cmdPropRx definition :

// CMD_PROP_RX
rfc_CMD_PROP_RX_t RF_cmdPropRx =
{
    .commandNo = 0x3802,
    .status = 0x0000,
    .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .startTime = 0x00000000,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0x0,
    .pktConf.bFsOff = 0x0,
    .pktConf.bRepeatOk = 0x0,
    .pktConf.bRepeatNok = 0x0,
    .pktConf.bUseCrc = 0x1,
    .pktConf.bVarLen = 0x1,
    .pktConf.bChkAddress = 0x0,
    .pktConf.endType = 0x0,
    .pktConf.filterOp = 0x0,
    .rxConf.bAutoFlushIgnored = 0x0,
    .rxConf.bAutoFlushCrcErr = 0x0,
    .rxConf.bIncludeHdr = 0x1,
    .rxConf.bIncludeCrc = 0x0,
    .rxConf.bAppendRssi = 0x0,
    .rxConf.bAppendTimestamp = 0x0,
    .rxConf.bAppendStatus = 0x1,
    .syncWord = 0x930B51DE,
    .maxPktLen = 0xFF, // MAKE SURE DATA ENTRY IS LARGE ENOUGH
    .address0 = 0xAA,
    .address1 = 0xBB,
    .endTrigger.triggerType = 0x1,
    .endTrigger.bEnaCmd = 0x0,
    .endTrigger.triggerNo = 0x0,
    .endTrigger.pastTrig = 0x0,
    .endTime = 0x00000000,
    .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
    .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
};

Thanks very much by advance for your help !

  • Hi Alexandre,

    1) An RX command must be running in order to call RF_getRssi() to get an RSSI reading. rx_on_idle set to true is supposed schedule RX, however, if this is not the case then you must schedule an RX before calling RF_getRssi().
    2) Not sure I understand the question. Could you elaborate?
    3) Depends what you mean; do you want the last valid RSSI from the on-going RX operation, or the RSSI from the last received packet?
    4) You could use the Carrier Sense command instead, which you could configure to measure the RSSI over some configurable period.
  • 1) Does that mean that if my rx_on_idle is set to true I don't need to issue an Rx Command?
    2) What I want to do is perform a jamming detection on the collector that is also running the network. So my question would be : Is it ok to perform rf core commands while the TI15.4 stack is also running ? is it possible that I can miss some data returned by devices if I am running commands on the RF core to perform RX commands to get the RSSI ?
    3) I want the RSSI when no message is received
    4) I will take a look into the carrier sense command.

    Thank you very much for your answers !

  • 1) Setting rx_on_idle means that the stack will put the radio in RX when there are no other active on-going operation. In other words, if the stack is not performing an active operation such as transmitting or carrier sense, the radio is put in RX.
    2) Depends. Calling RF_getRssi() is always safe to call. However, you need to be sure the radio is in RX when called in order to get any meaningful results. Doing this from the "outside" of the stack can be challenging, as you have no direct control of what the stack is doing at any give point. At one point the stack could be in idle, i.e. in RX, but just before you call RF_getRssi() the stack could potentially start some other RF operation. I will check out what would be the best approach here.
  • You can use energy detect to detect jamming, which is initiated with ApiMac_mlmeScanReq(). The result of the ED scan is called with the scan confirmation callback, pScanCnfCb, which is set in Collector_macCallbacks.
  • Understood, so I cannot really be sure that my Get_rssi call will be issued at the right time.

    Waiting for more details from you then on the second point. Thanks a lot for the help !
  • Please refer to my post above regarding second point.
  • I will try this Thank you !

    One last question on this point : what would be a correct scan duration for this matter ? shall i keep the same configurations as already in the regular scanReq ?

    static void sendScanReq(ApiMac_scantype_t type)
    {
        ApiMac_mlmeScanReq_t scanReq;
        /* set common parameters for all scans */
        memset(&scanReq, 0, sizeof(ApiMac_mlmeScanReq_t));
        /* set scan channels from channel mask*/
        memcpy(scanReq.scanChannels, chanMask,
        APIMAC_154G_CHANNEL_BITMAP_SIZ);
        scanReq.scanType = type;
        scanReq.scanDuration = CONFIG_SCAN_DURATION;
        scanReq.maxResults = 0;/* Expecting beacon notifications */
        scanReq.permitJoining = false;
        scanReq.linkQuality = CONFIG_LINKQUALITY;
        scanReq.percentFilter = CONFIG_PERCENTFILTER;
        scanReq.channelPage = CONFIG_CHANNEL_PAGE;
        scanReq.phyID = CONFIG_PHY_ID;
        /* using no security for scan request command */
        memset(&scanReq.sec, 0, sizeof(ApiMac_sec_t));
        /* send scan Req */
        ApiMac_mlmeScanReq(&scanReq);
    }

    or should I make a specific configuration designed for energy detection only ?

  • I would recommend making your own if you want to change the scan duration and the channel mask(on what channels you want to run the scan)

    Please note that currently we have a bug in the energy scan in which the result wont be affected by the scan duration but this will be fixed in the next SDK release.

    I would say that the default scan duration in CONFIG_SCAN_DURATION should be a good duration to start with but if you feel that the device is taking too long doing the scan then you should reduce this duration.
  • Perfect, thank you very much for you help !