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.

[参考译文] CC1312R:获取接收到的数据包的 RSSI 时出现问题

Guru**** 2540720 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1165382/cc1312r-issues-fetching-the-rssi-of-a-received-packet

器件型号:CC1312R

您好!

我尝试使用接收到的数据包的 RSSI 来通知我的应用中的某些行为、但我在读取接收到的数据包的值时遇到了一些问题。 我使用的是具有 SDK v5.20和专有射频模式的 CC1312。 当我使用相同的配置设置将 MCU 通过连接到 SmartRF Studio 时、我会看到正确报告的 RSSI 值对我来说是有意义的、并且根据预期 TX 和 Rx 之间的距离而变化。

但是、在我自己的应用程序中、当我尝试读取附加到队列条目的 RSSI 值时、似乎是一个无效值。 其他值似乎是正确的、附加的时间戳越来越单调。

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);
    }

我尝试通过附加的值和 SDK 提供的 RF_getRssi()函数读取 RSSI 值、但这始终报告 RF_GET_RSSI_ERROR_VAL。 我对 DATA_QUEUES 的行为充满信心、因为除了时间戳之外、数据是正确的。

以下是我当前正在测试的无线电命令:

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
};

以下是对讲机覆盖和设置功能:

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
};

到目前为止、我的应用在使用无线电方面没有其他问题、如果能获得有关 RSSI 值报告可能存在的问题的任何信息、我将不胜感激。