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.

[参考译文] LAUNCHXL-CC1312R1:Rx 在接收没有 CRC 的数据时出现 WMbus 433 (434.475 MHz)错误

Guru**** 1555210 points
Other Parts Discussed in Thread: WMBUS, SYSCONFIG
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1372583/launchxl-cc1312r1-error-wmbus-433-434-475-mhz-while-rx-receive-data-with-no-crc

器件型号:LAUNCHXL-CC1312R1
主题中讨论的其他器件:WMBUSSysConfig

工具与软件:

我想在 CC1312R1上从 WMBUS 433 (434.475MHz)接收数据。

数据发送方具有以下配置:

  • 频率: 434.475 MHz
  • 符号速率:100 KB
  • 偏差:50kHz
  • TX 功率:10dBm
  • 同步字: 0x00000000
  • 数据长度:25字节
  • 无 CRC

我在测试使用的是 SmartRF Studio 7时很快便获得了大量数据、而且它可以正常工作。 但是、当我通过程序进行测试时、射频停止接收数据、或者在我接收到一些数据后、电路板停止工作。 有以下程序:

e2e.ti.com/.../1234.ti_5F00_radio_5F00_config.ce2e.ti.com/.../0576.ti_5F00_radio_5F00_config.he2e.ti.com/.../0576.main_5F00_tirtos.ce2e.ti.com/.../0576.rfPacketRx.c

我能知道如何解决此问题吗?

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

    尊敬的 Muhammad:

    您不会在测试时在程序中设置任何断点、对吧?

    此致、

    Arthur

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

    为什么要将同步字设置为0x00000000? 这与 wmBus 无关。

    同样、也会关闭 CRC、但会对 CRC 进行滤波。

    你到底想做什么(为什么?)

    Siri

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

    您好、Arthur、

    我完成了这两项操作(放置断点而不是断点)。 但在我进行更深入的调试后、我认为在以下情况后会出现错误:

    memcpy(packet, packetDataPointer, (packetLength + 1));

    RFQueue_nextEntry();

    调用此函数。

    我尝试打印数据包、 有时我从数据包中获得数据、但有时不会。 但当我遇到错误时、程序始终会在 RFQueue_nextEntry()执行时在函数中停止  readEntry = (rfc_dataEntryGeneral_t*)readEntry->pNextEntry;

    uint8_t
    RFQueue_nextEntry()
    {
    /* Set status to pending */
    readEntry->status = DATA_ENTRY_PENDING;

    /* Move read entry pointer to next entry */
    readEntry = (rfc_dataEntryGeneral_t*)readEntry->pNextEntry;

    return (readEntry->status);
    }

    Regards,

    Juan

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

    你好、Siri、

    很抱歉我知道 Sync Word 与 WMBus 无关。 从其他器件发送的数据包 未启用 CRC、在 CRC 上进行过滤您的意思是.rxConf.bAutoFlushCrcErr = 0x0?

    我想创建 WMBus 网关。

    此致、

    Juan

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

    您好、Juan

    如果您要创建 wmbus 网关、并且正在使用 CT 模式 PHY、则无法更改同步长度或同步字(如果在 Studio 中进行测试、则会看到无法再获取链接)

    您应该使用从 SysConfig 中导出的设置、但可以更改长度、频率和输出功率等

    我看到在 SysConfig 中启用了 CRC、这能够测试链路/射频性能、但请记住、在实现"实际"wmbus 数据包时、必须禁用此功能、因为 wmbus CRC 与 OUT 器件使用的不同。

    必须修改 rfPacketRX 示例、以便能够使用从 SysConfig 导入的设置(这些设置使用固定的数据包长度、而代码示例为可变数据包长度编写。

    下面是 rfPacketRX 示例的修改版本、可用于接收 SmartRF Studio 发送的数据包格式(选择 wmbus T 模式时):

    /* Packet RX Configuration */
    #define DATA_ENTRY_HEADER_SIZE 8  /* Constant header size of a Generic Data Entry */
    #define LENGTH                 25
    #define NUM_DATA_ENTRIES       2  /* NOTE: Only two data entries supported at the moment */
    #define NUM_APPENDED_BYTES     0
    
    /***** Prototypes *****/
    static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES, LENGTH, NUM_APPENDED_BYTES)] __attribute__((aligned(4)));
    
    /* Receive dataQueue for RF Core to fill in data */
    static dataQueue_t dataQueue;
    static rfc_dataEntryGeneral_t* currentDataEntry;
    static uint8_t* packetDataPointer;
    rfc_propRxOutput_t rxStatistics;
    
    static uint8_t packet[LENGTH];
    
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        GPIO_setConfig(CONFIG_GPIO_RLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
        GPIO_write(CONFIG_GPIO_RLED, CONFIG_GPIO_LED_OFF);
    
        if( RFQueue_defineQueue(&dataQueue,
                                rxDataEntryBuffer,
                                sizeof(rxDataEntryBuffer),
                                NUM_DATA_ENTRIES,
                                LENGTH + NUM_APPENDED_BYTES))
        {
            /* Failed to allocate space for all data entries */
            while(1);
        }
    
        /* Modify CMD_PROP_RX command for application needs */
        /* Set the Data Entity queue for received data */
        RF_cmdPropRx.pQueue = &dataQueue;
        /* Discard ignored packets from Rx queue */
        RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1;
        /* Discard packets with CRC error from Rx queue */
        RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1;
        /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
        RF_cmdPropRx.maxPktLen = LENGTH;
        RF_cmdPropRx.pktConf.bRepeatOk = 1;
        RF_cmdPropRx.pktConf.bRepeatNok = 1;
        RF_cmdPropRx.pOutput = (uint8_t*)&rxStatistics;
    
        /* 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);
    
        RF_EventMask terminationReason = RF_EventCmdAborted | RF_EventCmdPreempted;
        while(( terminationReason & RF_EventCmdAborted ) && ( terminationReason & RF_EventCmdPreempted ))
        {
            /* Enter RX mode and stay forever in RX */
            // Re-run if command was aborted due to SW TCXO compensation
            terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,
                                                   RF_PriorityNormal, &callback,
                                                   RF_EventRxEntryDone);
        }
    
        switch(terminationReason)
        {
            case RF_EventLastCmdDone:
                // A stand-alone radio operation command or the last radio
                // operation command in a chain finished.
                break;
            case RF_EventCmdCancelled:
                // Command cancelled before it was started; it can be caused
                // by RF_cancelCmd() or RF_flushCmd().
                break;
            case RF_EventCmdAborted:
                // Abrupt command termination caused by RF_cancelCmd() or
                // RF_flushCmd().
                break;
            case RF_EventCmdStopped:
                // Graceful command termination caused by RF_cancelCmd() or
                // RF_flushCmd().
                break;
            default:
                // Uncaught error event
                while(1);
        }
    
        uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdPropRx)->status;
        switch(cmdStatus)
        {
            case PROP_DONE_OK:
                // Packet received with CRC OK
                break;
            case PROP_DONE_RXERR:
                // Packet received with CRC error
                break;
            case PROP_DONE_RXTIMEOUT:
                // Observed end trigger while in sync search
                break;
            case PROP_DONE_BREAK:
                // Observed end trigger while receiving packet when the command is
                // configured with endType set to 1
                break;
            case PROP_DONE_ENDED:
                // Received packet after having observed the end trigger; if the
                // command is configured with endType set to 0, the end trigger
                // will not terminate an ongoing reception
                break;
            case PROP_DONE_STOPPED:
                // received CMD_STOP after command started and, if sync found,
                // packet is received
                break;
            case PROP_DONE_ABORT:
                // Received CMD_ABORT after command started
                break;
            case PROP_ERROR_RXBUF:
                // No RX buffer large enough for the received data available at
                // the start of a packet
                break;
            case PROP_ERROR_RXFULL:
                // Out of RX buffer space during reception in a partial read
                break;
            case PROP_ERROR_PAR:
                // Observed illegal parameter
                break;
            case PROP_ERROR_NO_SETUP:
                // Command sent without setting up the radio in a supported
                // mode using CMD_PROP_RADIO_SETUP or CMD_RADIO_SETUP
                break;
            case PROP_ERROR_NO_FS:
                // Command sent without the synthesizer being programmed
                break;
            case PROP_ERROR_RXOVF:
                // RX overflow observed during operation
                break;
            default:
                // Uncaught error event - these could come from the
                // pool of states defined in rf_mailbox.h
                while(1);
        }
    
        while(1);
    }
    
    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if (e & RF_EventRxEntryDone)
        {
            GPIO_toggle(CONFIG_GPIO_RLED);
    
            /* Get current unhandled data entry */
            currentDataEntry = RFQueue_getDataEntry();
    
            packetDataPointer = (uint8_t*)(&currentDataEntry->data);
    
            memcpy(packet, packetDataPointer, LENGTH);
    
            RFQueue_nextEntry();
        }
    }

    Studio 中的设置可确保使用正确的 PHY 参数、同步字等、并且 C/T 模式补丁会为您进行编码/解码。

    不过、C 和 T 模式的数据包格式与我们在 rfPacketRX 和 rfPacket TX 示例中使用的数据包格式大不相同。  

     有关详细信息、请参阅 CC13xx 组合的 wM-Bus C 模式和 T 模式应用手册(修订版 E)。

    当接收到适当的 C 和 T 模式数据包时、接收器不知道数据包中的长度信息从哪里开始、因此您需要使用部分读取条目。

    wmbus 规范。  不开放、这意味着您必须付费、因此我们不能为您提供如何接收这些数据包的示例。 您将需要购买该规范并实施应用手册中所述的代码。

    Siri