Hello,
I'm trying to use the RSSI of received packets to inform some behavior in my application, but I'm having some issues reading the value of the received packet. I am using a CC1312 with SDK v5.20 and the proprietary rf mode. When I connect my MCU through to SmartRF studio, with the same configuration settings, I see correctly reported RSSI values that make sense to me and vary relative to distance between tx and rx as expected.
In my own application, however, when I try to read the RSSI value that has been appended to the queue entry, is appears to be a nonsense value. The other values appear to be correct, the appended timestamp is increasingly monotonically.
if (e & RF_EventRxEntryDone) { rfc_dataEntryGeneral_t* queue_entry = queueCurrentEntry(&waitForSyncQueue); uint8_t *data_entry = (uint8_t *)&queue_entry->data; message_length = *data_entry; memcpy(operating_message, data_entry + 1, message_length); memcpy(&message_rssi, data_entry + 1 + MAX_PACKET_LENGTH, 1); memcpy(&message_status, data_entry + 6 + MAX_PACKET_LENGTH, 1); memcpy(&message_timestamp, data_entry + 2 + MAX_PACKET_LENGTH, 4); int8_t func_rssi = RF_getRssi(radio_.handle); queueNextEntry(&waitForSyncQueue); SMPost(kSMEventPacketReceived); }
I am attempting to read the RSSI value through both the appended value and the RF_getRssi() function provided by the SDK, but that always reports RF_GET_RSSI_ERROR_VAL. I am confident in the behavior of my data_queues, since the data is correct in addition to the timestamps making sense.
The following is the radio command that I am currently testing with:
static rfc_CMD_PROP_RX_t waitforSyncRX = { .commandNo = 0x3802, .status = 0x0000, .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = TRIG_NOW, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, .condition.rule = 0x1, .condition.nSkip = 0x0, .pktConf.bFsOff = 0x0, .pktConf.bRepeatOk = false, .pktConf.bRepeatNok = true, .pktConf.bUseCrc = 0x1, .pktConf.bVarLen = 0x0, .pktConf.bChkAddress = 0x0, .pktConf.endType = 0x0, .pktConf.filterOp = 0x0, .rxConf.bAutoFlushIgnored = true, .rxConf.bAutoFlushCrcErr = true, .rxConf.bIncludeHdr = false, .rxConf.bIncludeCrc = 0x0, .rxConf.bAppendRssi = true, .rxConf.bAppendTimestamp = true, .rxConf.bAppendStatus = true, .syncWord = 0x930B51DE, .maxPktLen = MAX_PACKET_LENGTH, .address0 = 0xAA, .address1 = 0xBB, .endTrigger.triggerType = TRIG_NEVER, .endTrigger.bEnaCmd = 0x1, .endTrigger.triggerNo = 0x2, .endTrigger.pastTrig = 0x0, .endTime = 0x00000000, .pQueue = &waitForSyncQueue.data_queue, .pOutput = 0 };
Here are the radio overrides and the setup function:
uint32_t pOverrides[] = { // override_prop_common.json // DC/DC regulator: In Tx, use DCDCCTL5[3:0]=0x7 (DITHER_EN=0 and IPEAK=7). (uint32_t)0x00F788D3, // override_prop_common_sub1g.json // Set RF_FSCA.ANADIV.DIV_SEL_BIAS = 1. Bits [0:16, 24, 30] are don't care.. (uint32_t)0x4001405D, // Set RF_FSCA.ANADIV.DIV_SEL_BIAS = 1. Bits [0:16, 24, 30] are don't care.. (uint32_t)0x08141131, // override_tc106.json // Tx: Configure PA ramp time, PACTL2.RC=0x3 (in ADI0, set PACTL2[4:3]=0x3) ADI_2HALFREG_OVERRIDE(0,16,0x8,0x8,17,0x1,0x1), // Rx: Set AGC reference level to 0x1A (default: 0x2E) HW_REG_OVERRIDE(0x609C,0x001A), // Rx: Set RSSI offset to adjust reported RSSI by -1 dB (default: -2), trimmed for external bias and differential configuration (uint32_t)0x000188A3, // Rx: Set anti-aliasing filter bandwidth to 0xD (in ADI0, set IFAMPCTL3[7:4]=0xD) ADI_HALFREG_OVERRIDE(0,61,0xF,0xD), // Tx: Set wait time before turning off ramp to 0x1A (default: 0x1F) HW_REG_OVERRIDE(0x6028,0x001A), // override_patable_14dbm.json // Tx: Set PA trim to max to maximize its output power (in ADI0, set PACTL0=0xF8) ADI_REG_OVERRIDE(0,12,0xF8), // radio_overrides.h APP_OVERRIDES(), (uint32_t)0xFFFFFFFF }; // CMD_PROP_RADIO_DIV_SETUP // Proprietary Mode Radio Setup Command for All Frequency Bands rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup = { .commandNo = 0x3807, .status = 0x0000, .pNextOp = 0, .startTime = 0x00000000, .startTrigger.triggerType = 0x0, .startTrigger.bEnaCmd = 0x0, .startTrigger.triggerNo = 0x0, .startTrigger.pastTrig = 0x0, .condition.rule = 0x1, .condition.nSkip = 0x0, .modulation.modType = 0x1, .modulation.deviation = 0x1F4, .modulation.deviationStepSz = 0x0, .symbolRate.preScale = 0xF, .symbolRate.rateWord = 0x50000, .symbolRate.decimMode = 0x0, .rxBw = 0x60, .preamConf.nPreamBytes = 0x2, .preamConf.preamMode = 0x1, .formatConf.nSwBits = 0x20, .formatConf.bBitReversal = 0x0, .formatConf.bMsbFirst = 0x1, .formatConf.fecMode = 0x0, .formatConf.whitenMode = 0x1, .config.frontEndMode = 0x0, .config.biasMode = 0x1, .config.analogCfgMode = 0x0, .config.bNoFsPowerUp = 0x0, .config.bSynthNarrowBand = 0x0, .txPower = 0x013F, .pRegOverride = pOverrides, .centerFreq = 0x0393, .intFreq = 0x8000, .loDivider = 0x05 };
My application has had no other issues using the radio thus far, and I would appreciate any information about what may be the issue with reporting of the RSSI value.