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.

LP-CC1352P7: No transmission when using RF_cmdPropTxAdv

Part Number: LP-CC1352P7
Other Parts Discussed in Thread: ENERGYTRACE, SYSCONFIG

Tool/software:

I’m currently working with the RF_cmdPropTx function using SimpleLink and a custom PHY, and the packets are transmitting and receiving correctly. However, when I switch the configuration to Wi-SUN and use the advertisement command (RF_cmdPropTxAdv) to transmit packets, I encounter issues.

Here’s the function call I’m using to transmit the packet:

RF_runCmd(rfHandle, (RF_Op *)&RF_cmdPropRxAdv, RF_PriorityNormal, &callback, RF_EventRxEntryDone);

While the command returns RF_EventLastCmdDone, indicating that the last command executed successfully, I’m experiencing no signal transmission on the SMA line most of the time. I am using spectrum analyzer to confirm the signal. Although I do occasionally observe a signal and can receive packets on the receiver end, it is inconsistent.

Could anyone assist in determining whether this is a bug in the SDK or if there might be an issue with my implementation? Your help would be greatly appreciated!

  • Hi Saugat,

    from what you are explaining it seems like the selection of the phy and sending of the packet is executed correctly.
    In the command that you shared I see "(RF_Op *)&RF_cmdPropRxAdv" I guess that is a typo as you need to use a Tx command for sending data?

    Please try to use EnergyTrace (https://www.ti.com/tool/ENERGYTRACE) that is part of Code Composer Studio to observe if you can see all the packet transmits.

    If you still encounter problems please share your code and settings with me so that I can reproduce it.

    Kind regards,
    Theo

  • Thank you for your fast response and sorry about the typo, it was supposed to be (RF_Op *)&RF_cmdPropTxAdv. 

    I did the energy trace and it looks like the radio never consumes current required to transmit the packet. My current configuration uses 0 dBm output power at 920 MHz frequency. A/c to the datasheet it should be ~9mA current consumption on every transmission. Here is the screenshot of the observed energy trace (completed for 5 minutes), 

     .

     

    Here is my sysconfig file.

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --board "/ti/boards/LP_CC1352P7_1" --rtos "tirtos7" --product "simplelink_cc13xx_cc26xx_sdk@7.41.00.17"
     * @versions {"tool":"1.18.1+3343"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const CCFG        = scripting.addModule("/ti/devices/CCFG");
    const custom      = scripting.addModule("/ti/devices/radioconfig/custom");
    const rfdesign    = scripting.addModule("/ti/devices/radioconfig/rfdesign");
    const GPIO        = scripting.addModule("/ti/drivers/GPIO");
    const GPIO1       = GPIO.addInstance();
    const RF          = scripting.addModule("/ti/drivers/RF");
    const UART2       = scripting.addModule("/ti/drivers/UART2", {}, false);
    const UART21      = UART2.addInstance();
    const Settings    = scripting.addModule("/ti/posix/tirtos/Settings");
    const BIOS        = scripting.addModule("/ti/sysbios/BIOS");
    const Event       = scripting.addModule("/ti/sysbios/knl/Event");
    const Idle        = scripting.addModule("/ti/sysbios/knl/Idle", {}, false);
    const Idle2       = Idle.addInstance();
    const Mailbox     = scripting.addModule("/ti/sysbios/knl/Mailbox");
    const Error       = scripting.addModule("/ti/sysbios/runtime/Error");
    const SysCallback = scripting.addModule("/ti/sysbios/runtime/SysCallback");
    const Timestamp   = scripting.addModule("/ti/sysbios/runtime/Timestamp");
    
    /**
     * Write custom configuration values to the imported modules.
     */
    CCFG.xoscCapArray            = true;
    CCFG.xoscCapArrayDelta       = 0xC1;
    CCFG.enableBootloader        = true;
    CCFG.dioBootloaderBackdoor   = 15;
    CCFG.levelBootloaderBackdoor = "Active low";
    CCFG.ccfgTemplate.$name      = "ti_devices_CCFG_CCFGCC26XXTemplate0";
    
    custom.prop8                                                               = ["2gfsk100kbps50dev915wsun2b"];
    custom.radioConfig2gfsk100kbps50dev915wsun2b.$name                         = "ti_devices_radioconfig_settings_prop0";
    custom.radioConfig2gfsk100kbps50dev915wsun2b.txPower                       = "0";
    custom.radioConfig2gfsk100kbps50dev915wsun2b.codeExportConfig.$name        = "ti_devices_radioconfig_code_export_param0";
    custom.radioConfig2gfsk100kbps50dev915wsun2b.codeExportConfig.symGenMethod = "Custom";
    
    GPIO1.$hardware = system.deviceData.board.components.LED_GREEN;
    GPIO1.$name     = "CONFIG_GPIO_GLED";
    
    RF.$hardware = system.deviceData.board.components["SKY13317-373LF"];
    
    UART21.$name     = "CONFIG_UART2_0";
    UART21.$hardware = system.deviceData.board.components.XDS110UART;
    
    BIOS.assertsEnabled = false;
    BIOS.heapBaseAddr   = "__primary_heap_start__";
    BIOS.heapEndAddr    = "__primary_heap_end__";
    
    const Clock      = scripting.addModule("/ti/sysbios/knl/Clock", {}, false);
    Clock.tickPeriod = 10;
    
    const Timer = scripting.addModule("/ti/sysbios/family/arm/cc26xx/Timer", {}, false);
    
    Idle2.$name   = "powerIdle";
    Idle2.idleFxn = "Power_idleFunc";
    
    const Semaphore            = scripting.addModule("/ti/sysbios/knl/Semaphore", {}, false);
    Semaphore.supportsPriority = false;
    
    const Swi         = scripting.addModule("/ti/sysbios/knl/Swi", {}, false);
    Swi.numPriorities = 6;
    
    const Task             = scripting.addModule("/ti/sysbios/knl/Task", {}, false);
    Task.checkStackFlag    = false;
    Task.defaultStackSize  = 512;
    Task.idleTaskStackSize = 512;
    Task.numPriorities     = 6;
    
    Error.policy       = "Error_SPIN";
    Error.printDetails = false;
    
    const System           = scripting.addModule("/ti/sysbios/runtime/System", {}, false);
    System.abortFxn        = "System_abortSpin";
    System.exitFxn         = "System_exitSpin";
    System.extendedFormats = "%f";
    System.supportModule   = "SysCallback";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    GPIO1.gpioPin.$suggestSolution     = "boosterpack.40";
    RF.rfAntennaPin0.$suggestSolution  = "DIO_28";
    RF.rfAntennaPin1.$suggestSolution  = "DIO_29";
    RF.rfAntennaPin2.$suggestSolution  = "DIO_30";
    UART21.uart.$suggestSolution       = "UART0";
    UART21.uart.txPin.$suggestSolution = "boosterpack.4";
    UART21.uart.rxPin.$suggestSolution = "boosterpack.3";
    Timer.rtc.$suggestSolution         = "RTC0";
    

    And here is code snippets for radio configuration and packet transmission. And the below code snippet runs on a loop for continuous transmission at the specified interval.

    RF_Params rfParams;
    RF_Params_init(&rfParams);
    ...
    // Encode the dummy packet
    encode_all(&pkt_demo_pkt, pkt_demo_buf);
    RF_cmdPropTxAdv.pktLen = MSG_LEN_ALL + 2;
    RF_cmdPropTxAdv.pPkt = on_air_pkt_demo;
    RF_cmdPropTxAdv.startTrigger.triggerType = TRIG_NOW;
    ...
    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);
    ...
    on_air_pkt_demo[0] = (uint8_t)(seqNumber >> 8);
    on_air_pkt_demo[1] = (uint8_t)(seqNumber++);
    uint8_t i;
    for (i = 2; i < MSG_LEN_ALL + 2; i++)
    {
        on_air_pkt_demo[i] = pkt_demo_buf[i-2];
    }
    ...
    /* Send sense_nano_on_air_pkt_demo */
    RF_EventMask terminationReason = RF_EventCmdAborted | RF_EventCmdPreempted;
    while(( terminationReason & RF_EventCmdAborted ) && ( terminationReason & RF_EventCmdPreempted ))
    {
        // Re-run if command was aborted due to SW TCXO compensation
        terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv,
                                      RF_PriorityNormal, NULL, 0);
    }
    ...
    switch(terminationReason)
        {
            case RF_EventLastCmdDone:
                // Log last command was execeuted successfully.
                // I have a seperate function to log the outputs in all the termination and command status condition
                break;
            case RF_EventCmdCancelled:
                break;
            case RF_EventCmdAborted:
                break;
            case RF_EventCmdStopped:
                break;
            default:
                while(1);
    }
    
    uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdPropTxAdv)->status;
    switch(cmdStatus)
    {
        case PROP_DONE_OK:
            break;
        case PROP_DONE_STOPPED:
            break;
        case PROP_DONE_ABORT:
            break;
        case PROP_ERROR_PAR:
            break;
        case PROP_ERROR_NO_SETUP:
            break;
        case PROP_ERROR_NO_FS:
            break;
        case PROP_ERROR_TXUNF:
            break;
        default:
            while(1);
    }
    RF_yield(rfHandle);
    
    sleep(PACKET_INTERVAL);

    I have a separate function to log the outputs in all the termination and command status condition and every return indicates a successful transmission or RF_EventLastCmdDone. According to the the documentation it should only return that on successful packet transmit. I would really appreciate your help. Thank you. 

  • I incorrectly measured using the energy trace  on the last reply and it was showing the wrong current consumption. Here is the energy trace data, 

    The current consumption seem to be accurate. However still no signal out of SMA line. 

  • Hi Saugat,

    on your last energy trace I can see that there are definitely messages sent.

    1. How do you capture the activity on the sma?
    2. Can you setup a receiver with SmartRF Studio 7 (SMARTRFTM-STUDIO Calculation tool | TI.com)? You need to connect another launchpad that supports the Wi-SUN phy and run it in packet rx. Please share then a screenshot of the received packets with me.

    Kind regards,
    Theo

  • 1) For observing the activity on the SMA line, we currently have a setup with the spectrum analyzer. We connect the SMA line to a Siglent SSA3032 spectrum analyzer, with a 10 dB attenuator and short sweep time. When transmitting with RF_cmdPropTx we observe a expected signal at a regular interval, but do not observe so on the RF_cmdPropTxAdv. In addition, we also have another setup of launch pad with Rx application running to capture the packet, we have similar observation. 

    2) According to your suggestion, I used SmartRF studio on our Windows machine with same protocol configuration as set on my Tx application with advanced command structure RF_cmdPropTxAdv. I do observe similar current consumption curve on the Tx end and also packets on the RF studio at correct interval as expected. I have attached the screenshot. We observe, a really high bit error rate which was unexpected. In couple of the run I do not receive any successful packet at all. I also tried lowing the packet length on the sysconfig to 64 bytes but with no prevail. What could be the issue, is it just the wireless environment or something I did in the radio configuration which makes such a high likelihood of bit error rate. And also, none of this properly explains non reliable signal observed on the spectrum analyzer. 

    Thank you for your time. Looking forward to your comment. 

  • I redid the test today as well, however I could not receive any packets at all on the RFPacket Studio. It is still running the same firmware with the same exact configuration. Here is a screenshot for that,  .

    In the mean time, I was also looking at the current consumption.

    It has been like this, since I have started the test. There would be radio signals sometime without any issue, I would receive packets on my Rx devkit and the signal on the spectrum analyzer for some certain period and would stop again. There is no definite pattern I saw in any of this beside using the Adv structure or simple radio packet structure.

  • When you are using rfPacketTX example with any of the PHYs using the Advanced TX command (like the Wi-SUN PHYs) it is not enought to just replace the normal TX command in the code with the Advanced command and expect it to work.

    If you look at the documentation of the command in the TRM, you will see that while the normal TX command expect the packet length to only be written to the API, the advanced TX command expect the length to be written as part of the packet.

    Also, the Wi-SUN PHYs uses 802.15.4g mode, so the packets have a 2 bytes header, and the length is the 11 LSB of this header:

    Taking the rfPacketTX example, and changing for example the settings to Wi-SUN mode #2B, the following changes must be done in the rfPacketTX example to be able to receive the packets with another device using this modein SmartRF Studio

    /* Packet TX Configuration */
    #define PAYLOAD_LENGTH      30
    
    #define PACKET_INTERVAL     100000  /* Set packet interval to 100000 us or 100 ms */
    
    
    static uint8_t lsbFirst(uint8_t b);
    
    /***** Prototypes *****/
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    static uint8_t packet[PAYLOAD_LENGTH];
    static uint16_t seqNumber;
    
    /***** Function definitions *****/
    
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        GPIO_setConfig(CONFIG_GPIO_GLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
    
        GPIO_write(CONFIG_GPIO_GLED, CONFIG_GPIO_LED_OFF);
    
        RF_cmdPropTxAdv.pktLen = PAYLOAD_LENGTH;
        RF_cmdPropTxAdv.pPkt = packet;
        RF_cmdPropTxAdv.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)
        {
            uint8_t i;
    
            // Create the packet content (same packet for every iteration)
            // For the advanced TX command the length must manually be written to the packet
    
            packet[0] = PAYLOAD_LENGTH;
            packet[1] = 0x18; // Whitening and 2 bytes CRC enabled
                                // (default in SmartRF Studio for 802.15.4g mode)
    
            packet[2] = lsbFirst((uint8_t)(seqNumber >> 8));
            packet[3] = lsbFirst((uint8_t)(seqNumber++));
    
            for(i = 4; i < PAYLOAD_LENGTH; i++)
            {
                // For the payload, SmartRF Studio uses LSbit first by default for
                // 802.15.4g mode
                packet[i] = lsbFirst(i-3);
             }
    
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);
    
            GPIO_toggle(CONFIG_GPIO_GLED);
    
            /* Power down the radio */
            RF_yield(rfHandle);
    
            /* Sleep for PACKET_INTERVAL us */
            usleep(PACKET_INTERVAL);
        }
    }
    
    uint8_t lsbFirst(uint8_t b)
    {
        b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
        b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
        b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
        return b;
    }

    Siri

  • Thank you, this resolved my issue. So, as you said the advanced packet format doesn't add the packet length by default. Thus, it was using the first byte of my sequence number i.e. {0x00} as the packet length. Thus, we would see the radio ramp up on the energy trace while no signal was observed on the spectrum analyzer.