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.

CC2652P: Freescale MC13213 to CC2652

Part Number: CC2652P
Other Parts Discussed in Thread: SIMPLELINK-CC13X2-26X2-SDK, SYSCONFIG, Z-STACK, CC1352P, CC2652R, CC2531

Hello,

We are actually using Freescale-NXP MC13213 (MC13192 MC13202) with the SMAC stack 

(this is the simplest stack from Freescale-NXP build over 802.15.4)

This chipset will be NLA end of this year and we want to replace it with CC2652P.

 I've installe all the SimpleLink440 suite and I'm abble to compile, run, debug on CC2652

(Module Eebyte E72 2G4M20S1E) but I'm unable toestablish Rf communication with Freescale.

This is not realy Zigbee . We wort at 2.4 GHz My questions are 100

1) Which project to you suggest to start with ?

I use rfEasyLinkRx for CC1352P2 with ti rtos for instance but which is the better choice ?

2) Which Rf configuration to use for all the rf parameters ?

There are a lot of things to configure, if someone have the correct configuration, I'll be very happy

(The best should be to have a wide open rf ant then to reduce acceptance)

3) Which is the configuration for the antenna switch as I have100

TX = DIO5 set to 1

RX = DIO6 set to 1

I really appreciate help to establish rf communication, after it'll be more easy ...

Best regards

francois

  • Hello francois,

    I don't know anything about the previous hardware platform or software solution, but it sounds like you need an IEEE 802.15.4-based stack.  I recommend looking into the SIMPLELINK-CC13X2-26X2-SDK 15.4-Stack resources.  You can refer to the collector_2_4g, sensor_2_4g, and coprocessor examples based on your project's needs.  Your development should be based off of the LAUNCHXL-CC1352P-2 EVM, where SysConfig -> Show Board View -> Use Custom Board is selected (Lock PinMux unchecked) and TI Drivers -> RF is modified for 2 Antenna Switch Control Pins: DIO5/TX for CONFIG_RF_HIGH_PA and DIO6/RX for CONFIG_RF_24GHz.  You will need to know more about the Channel Mask and mode used by the Freescale device and modify TI 15.4 Stack SysConfig settings accordingly.  Several instructions can be found in the TI 15.4-Stack User's Guide.  If you really need Zigbee then the same instructions apply but for Z-Stack.

    You can also try to use Smart RF Studio to capture packets from the Freescale device using IEEE 802.15.4 mode and customize the Target Configuration for your specific board layout.

    Regards,
    Ryan

  • Hello Ryan,

    Thank you very much for your help and for the links you've indicated me. Here is what I've found : 

    1) I've installed, configured for DIO5 DIO6 and test with SmartRfStudio and found the following : 

    My protocol is 802.15.4 250 kbps OQPSK and I'm able to receive correct packets from the Freescale-NXP

    There are 2 choices : IEEE 802.15.4 and IEEE 802.15.4 10dBm : I don't know exactly the difference ?

    2) I don't think TI 15.4 stack could fit because I've no role of PAN-Coordinator or network devices.

    In my case, we only use the Rf layer without any stack on it and all devices act as master or slave.

    3) Now I want to move to a CCS project, I've loaded the RfPacketRx project and modified the syscfg properties : 

    RF STACK Custom IEEE 802.15.4 OQPSK at 2.4 GHz with High PA, Custom symbol Name, no PA table.

    When I compile, I have the RF_cmdPropRadioDivSetup and RF_cmdPropRx which are undefined.

    At this step, I don't know what to do?

    Do I have selected the good starting project for my application ?

    Do I have to declare or write my own functions ? (for antenna switching, it'll not be a big issue afterwards)

    Do I have to include somewhere the code generated by SmartRfStudio ?

    If you can give me some small guidance I'll be very very interested But you've put me on the right way Slight smile

    Best regards

    francois

  • Hi francois,

    1. I don't know exactly what you are looking at inside Smart RF Studio, but "10 dBm" implies hardware which is optimized for a maximum 10 dBm TX output like the LAUNCHXL-CC1352P-4 as compared to the LAUNCHXL-CC1352P-2 which utilizes a matching network to allow for the maximum 20 dBm output.

    2. You can consider any Proprietary RF solution, like rfPacketRxrfEasyLinkRx or rfWsnNode, depending on your application needs.  Please reference the Proprietary RF documentation and SimpleLink Academy Labs as well.

    3. You will need to change the RF_* definitions to those which are generated by the SysConfig output files based on the IEEE PHY selection. You should not need to create your own functions for antenna switching so long as you are using LAUNCHXL-CC1352P-2/4 examples. Please see the aforementioned documentation for more information.

    Regards,
    Ryan

  • Hello Ryan,

    Thank you for your help and for the samples of project you indicate.

    1) For the 10 dBm, I talk about the choice in syscfg, RF_STACKS, Custom, IEEE 802.15.4

    There are 2 choices, I've selected the 1st one (without 10 dBm)

    2) I've installed the projects you've indicated to me, modified RF_* declarations, modified to custom stack IEEE 802.15.4

    with 2,4 GHz parameters change slightly the fields in RF_cmdPropRx and RF_cmdPropTx, now I'm able to compile, load and run it

    The issue I've now is that I can't send several commands : 

    RF_open( 

    then RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, 

    then RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx

    The Rf engine stucks and I've to restart the debugger to unock it (waiting for semaphore unlock ???)

    Restart of program in debugger do not release the Rf engine

    Do I have to acknowledge each function after completion ? or do I wait for a flag before sending a new command ?

    I'll continue tomorrow

    Best regards

    francois

  • Hey francois,

    Thanks for clarifying, maximum TX output power options are dependent on hardware selected.  I think this similar E2E thread is relevant to your RF command issues.

    Regards,
    Ryan

  • Ok thanks Ryan, I'll test tomorrow but this afternoon, I was able to catch one 

    frame send from my old Freescale/NXP interface Relaxed

    francois

  • Hello Ryan,

    Further to the indications and example you indicate me,

    I've now used only cmdPost (cmdRun for RF_cmdFs) and it sounds working 100

    I'm able to send a frame from old Freescale/NXP, perfectly receive it on the cc2652,

    when replying to the frame (other direction TI -> NXP) I've still some miss/errors and have to investigate further.

    I'll keep you in touch

     francois

  • Hi Ryan,

    It's 2 days that I work on the zigbee module.

    With SmartRF Studio, it works perfectly in both directions at the first attempt

    With a CCS project based on RfEchoRX nonrtos, it works perfectly for receiving.

    I've added some code to transmit a frame but without any success for now.

    The configurations generated by SmartRF Studio and syscfg are the same except in

    RF_cmdPropRadioDivSetup

    In SmartRF Studio tx power = 0xA73F; and in syscfg tx_power = 0xFFFF

    I was wondering if I have to configure the output amplifiers and where ?

    In the first step can I start without PA (and not having to switch the output pins) ?

    I'll continue next week

    Best regards

    francois

  • Hi francois,

    You will need to change the SysConfig Custom -> IEEE 802.15.4 -> High PA radio box depending on whether or not you are attempting to use the internal power amplifier and corresponding output RF pins. The default rfEchoRx example already has receive and transmit procedure, please try to get this and rfEchoTx working as explained in the README.  You can also reference the original settings with Proprietary PHYs to determine whether the issue is the PHY setup or HW configuration.  How do you determine whether frame transmission is not successful?

    Regards,
    Ryan

  • Hi Ryan,

    I've worked on our Ieee 802.15.4 communication and here are my up yo now results.

    For testing if I receive frames successfully, I use NXP debugger on a MC13213 test PCB and it stops at each received frame.  

    1) For the output PA and Rf mux with DIO5 DIO6 configuration is correct > I've measured with spectrum analyser and have the same

    level while emitting at 2405 MHz with Smart Rf studio7 and with my project.

    2) For Tx and Rx commands, I use definitively  RF_runScheduleCmd  which is better particulary for TX commands

    3) For Rx, each frame emitted from the old NXP design is catched each time correctly by the CC2652P

    4) For Tx, not all frames are correctly catched by the old NXP design, when sending several frames, I can catch it but not at the first attempt.

    (When testing, each frame send by Smart Rf studio7 (packet count =  1) is correctly catched by the old NXP design but not all frames from rfEchoTx)

    Can we have more informations about the exact configuration of Smart Rf studio7 configured in OQPSK particulary for transmitting packets ?

    (Configuration used, command used, perhaps pre-command send to the rf core, etc ...Because it works each time)

    Regards

    francois

  • Hi Francois,

    Thank you for providing the detailed update.  Seeing as how the PHY should be identical in both instances, I recommend that you compare the SmartRF Studio register settings against the SysConfig ti_radio_config.c/h and determine what changes could be causing the misalignment observed.  You may even consider exporting the Smart RF code and using that in your project to see if it makes any difference.

    Regards,
    Ryan

  • Hi Ryan,

    I've compared the code configurations generated by Sysconfig and SmartRfStudio and have the same for all commands.

    (I hope the patch rf_patch_cpe_ieee_802_15_4 is the same ?)

    I have 1 question, in SmartRfStudio, in IEE 802.15.4 Packet TX, there is : 

    - preamble 32 bits (01010101 ...)

    - SFD 8 bits (0xA7)

    - Length

    Do I have to include it in the frame or to set parameters somewhere in the commands to indicate the rf core to send these bytes ?

    Nest week, I'll do the following :

    1) Test at another frequency

    2) include the smartRfSettings.c and .h generated by SmartRfStudio directly in my code

    Regards

    Francois

  • Preamble and SFD are static for the IEEE 802.15.4 PHY and do not need to be included in the packet data of your SDK project, but length can vary based on the information you need transmitted.

    Regards,
    Ryan

  • Hi Ryan,

    OK for preamble, it's clear.

    Something else : 

    In the map file, I can see that my project is linked with : 

    /kernel/nortos/lib/ccs/m4f/nortos_cc13x2.a

    /source/ti/drivers/lib/ccs/m4f/drivers_cc13x2.a

    /source/ti/drivers/rf/lib/rf_multiMode_cc13x2.aem4f

    I think this is the wrong device, mine is CC2652P

    If I go in syscfg to switch the device, I've indicated : 

    Board : none

    In the Devices choices, I've selected CC1352P1F3RGZ but I have no choice available for CC2652P

    Which one should I select ? (CC2652R1FRGZ, CC2652R1FSIP, CC2652RB1FRGZ)

    (Normaly 2652 is identical to 1352 but I see that the linked libraries are different)

    Regards

    francois

  • Per the Proprietary RF Migration Guide -> Running Software Examples on CC2652P, you can use CC1352P-2/4 projects/settings without concern.  The CC2652P is more similar to the CC1352P than CC2652R due to the internal power amplifier.

    Regards,
    Ryan

  • Hello Ryan,

    OK for CC1252P, I've chosen this configuration

    I've made additional tests but I've the same effect, I've put a 802.15.4 Sniffer in parallel.

    Frame 2, send from my code, not detected by old NXP device.

    Frame 3, send from SmartRfStudio, detected at the first attempt (1 frame send)  by the old NXP device.

    I've compared the commands generated by SmartRfStudio and the ones I use it's the same.

    Is it possible to know the exact commands of SmartRfStudio and the sequence they are send ?

    Are there special initializations or calibrations of the system ?

    Couldn't it come from the preamble (don't know exactly the old NXP preamble, Manchester coding) ?

    Is there a possibility to monitor the signal on both cases with scope at lower frequency ?

    I don't know why, with the same hardware and seeing the same frames, it works perfectly with SmartRfStudio and  not with my code in CCS.

    What to do more .... 

    Regards

    francois

  • Hello francois,

    Are you able to send packets from your code and have them received in Smart RF Studio?  I assume similar hardware is used to transmit Frames 2 & 3 at approximately the same distance?  The only differences appear to be the Time and RSSI/LQI.  I recommend using Packet Sniffer 2 and Wireshark as a more advanced sniffing parser.

    Regards,
    Ryan

  • Hi Ryan,

    Here are more informations :

    1) Are you able to send packets from your code and have them received in Smart RF Studio ?  

    I can not tell you, because I've only one Ebyte module used either with SmartRfStudio or my code.

    With my code, I send without any error, frames to PackeSniffer (EByte E18 2G44U04B CC2531)

    and sometimes (less less than 1 over 100) a frame to my old NXP.

    2)  assume similar hardware is used to transmit Frames 2 & 3 at approximately the same distance?

    Exactly same hardware same conditions

    3 )  The only differences appear to be the Time and RSSI/LQI. 

    I've tried o modify 20, 14, 5 dBm but excly same effect

    I recommend using Packet Sniffer 2 and Wireshark as a more advanced sniffing parser.

    Thank you, I'll try with that tomorrow ... The most frustrating is that it works perfecly with SmartRfStudio

    If you could have more informations about what's inside (initialization, commands, timmings etc ...)

    It could be very helpful

    francois

  • Hi,

    4) For Tx, not all frames are correctly catched by the old NXP design, when sending several frames, I can catch it but not at the first attempt.

    (When testing, each frame send by Smart Rf studio7 (packet count =  1) is correctly catched by the old NXP design but not all frames from rfEchoTx)

    Does this mean that you are only able to receive 1 packet on the NXP side?

    When you perform the TX on the CCS code, do you make sure to have a CMD_IEEE_RX running?
    In general, you should have a background IEEE command running before performing CMD_IEEE_TX.

    More details on this can be found in the TRM (25.5.4 Radio Operation Commands).

    (Please continue using RF_scheduleCmd for CMD_IEEE_RX and CMD_IEEE_TX).

    Thanks,
    Toby

  • Hi Toby,

    Thanks for your help.

    On the NXP I sometimes receive a correct frame ( 1 over 100 or 1 over 200) but no more

    (With SmartRfStudio at the first attempt the frame is received by the NXP)

    Actually, at init, I send RF_cmdFs then RF_cmdRX.

    in the Rfreceive callback function, when I receive a frame, I cancel the function (RF_cancelCmd(rfHandle, ch, 0);)

    then send the new frame  CMD_IEEE_TX.

    I've tried to put the CMD_IEEE_TX in the main loop (outside the callback function) and tried with CmdRun, CmdPost, CmdRunScheduled 

    but same result -> seen on correctly on PacketSniffer but not detected by the NXP.

    I think I miss an initialization or something else which is included in SmartRfStudio but what ???

      Best egards

    francois

  • Just to summarize and make sure I understand:

    • TI(SmartRF) <--> NXP is OK
    • TI(CCS) <-- NXP is OK
    • TI(CCS) --> NXP is not OK (e.g. 1 of 100 attempts it works?)

    in the Rfreceive callback function, when I receive a frame, I cancel the function (RF_cancelCmd(rfHandle, ch, 0);)

    then send the new frame  CMD_IEEE_TX.

    The CMD_IEEE_TX should be performed after there is a running background command (e.g. CMD_IEEE_RX). This is what I've tried on my side, and I am able to receive all these packets in SmartRF Studio (packet RX).

    Can you share some code snippets?
    Such as the CMD_IEEE_TX, CMD_IEEE_RX structures, and how you are using them in your application.

  • Hello Toby,

    Here are my tests 100

    TI(SmartRF) <--> NXP is OK
    TI(CCS) <-- NXP is OK
    TI(CCS) --> NXP is not OK (e.g. 1 of 100 attempts it works?)

    Exactly (perhaps more than 100 attempts)

    This is what I've tried on my side, and I am able to receive all these packets in SmartRF Studio (packet RX).

    Yes, same for me, I receive it pertfectly with PacketSniffer but not by NXP ...

    I've made a sample project based on rfEchoRx and joined it :100

    smartrf_settings are the files generated by SmartRFSudio (which works with NXP, I've renamed the files *SR)

    The use of RfRx and RfTx are in NXP.c

    I've used RF_postCmd because I think in callback, RF_runCmd and RF_pendCmd are not allowed.

    If you need further informations, let me know

    Best regards

    francois

    static void echoCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    static uint8_t txPacket[5] = {0x00, 0x01, 0x02, 0x03, 0x04,};
    if (e & RF_EventRxEntryDone)
      {
      /* Successful RX */
      currentDataEntry = RFQueue_getDataEntry();      /* Get current unhandled data entry */
      packetLength      = *(uint8_t *)(&(currentDataEntry->data));
      packetDataPointer = (uint8_t *)(&(currentDataEntry->data) + 1);
      RFQueue_nextEntry();
      /* Command Tx */
      RF_cmdIeeeTxSR.startTrigger.triggerType = TRIG_REL_PREVEND; //TRIG_NOW;
      RF_cmdIeeeTxSR.pPayload = &txPacket[0];
      RF_cmdIeeeTxSR.payloadLen = 5;
      /* Command Rx */
      RF_cancelCmd(rfHandle, ch, 1);
      RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTxSR, RF_PriorityNormal, &echoCallback, (RF_EventRxEntryDone | RF_EventTxEntryDone |RF_EventLastCmdDone | RF_EventLastFGCmdDone | RF_EventFGCmdDone));
      }
    else if (e & RF_EventTxEntryDone)
      {
      }
    else if (e & RF_EventLastCmdDone)
      {
      }
    else
      {
      RF_cmdIeeeRxSR.pRxQ = &dataQueue;
      RF_cmdIeeeRxSR.startTrigger.triggerType = TRIG_REL_PREVEND;
      RF_cmdIeeeRxSR.pOutput = &rxStatistics;
      RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdIeeeRxSR, RF_PriorityNormal, &echoCallback, (RF_EventRxEntryDone | RF_EventTxEntryDone |RF_EventLastCmdDone | RF_EventLastFGCmdDone | RF_EventFGCmdDone));
      }
    }
    
    void *mainThread(void *arg0)
    {
    RF_Params rfParams;
    RF_Params_init(&rfParams);
    initAntennaSwitch();
    if (RFQueue_defineQueue(&dataQueue, rxDataEntryBuffer, sizeof(rxDataEntryBuffer), NUM_DATA_ENTRIES, PAYLOAD_LENGTH + NUM_APPENDED_BYTES))
      {
      while(1);
      }
      rfHandle = RF_open(&rfObject, &RF_propSR, (RF_RadioSetup*)&RF_cmdRadioSetupSR, &rfParams);
      RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
      while(1)
        {
        RF_cmdIeeeRxSR.pRxQ = &dataQueue;
        RF_cmdIeeeRxSR.pOutput = &rxStatistics;
        RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdIeeeRxSR, RF_PriorityNormal, &echoCallback, (RF_EventRxEntryDone | RF_EventLastCmdDone));
        switch(terminationReason)
          {
          case RF_EventLastCmdDone:
          break;
          case RF_EventCmdCancelled:
          break;
          case RF_EventCmdAborted:
          break;
          case RF_EventCmdStopped:
          break;
          default:
          break;
          }
        uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdIeeeRxSR)->status;
        switch(cmdStatus)
          {
          case PROP_DONE_OK:
          break;
          case PROP_DONE_RXERR:
          break;
          case PROP_DONE_RXTIMEOUT:
          break;
          case PROP_DONE_BREAK:
          break;
          case PROP_DONE_ENDED:
          break;
          case PROP_DONE_STOPPED:
          break;
          case PROP_DONE_ABORT:
          break;
          case PROP_ERROR_RXBUF:
          break;
          case PROP_ERROR_RXFULL:
          break;
          case PROP_ERROR_PAR:
          break;
          case PROP_ERROR_NO_SETUP:
          break;
          case PROP_ERROR_NO_FS:
          break;
          case PROP_ERROR_RXOVF:
          break;
          default:
            while(1);
          break;
          }
       }
    }
    
    //*********************************************************************************
    // Generated by SmartRF Studio version 2.20.1 (build#277)
    // The applied template is compatible with cc13x2_26x2 SDK version 2.10.xx.xx or newer.
    // Device: CC2652P Rev. E (2.1). Only supported by CC26x2 SDK version 3.30.xx.xx or newer
    //
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // IEEE Channel: 11 
    // Frequency: 2405 MHz
    // SFD: 0 
    // Packet Data: 255 
    // Preamble		 (32 bit): 01010101... 
    // TX Power: 14 dBm 
    // Enable high output power PA: true 
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)
    #include "smartrf_settings.h"
    
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_propSR =
    {
        .rfMode = RF_MODE_AUTO,
        .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4,
        .mcePatchFxn = 0,
        .rfePatchFxn = 0
    };
    
    
    // Overrides for CMD_RADIO_SETUP_PA
    uint32_t pOverridesSR[] =
    {
        // override_ieee_802_15_4.xml
        // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0)
        (uint32_t)0x000F8883,
        // Tx: Set DCDC settings IPEAK=3, dither = off
        (uint32_t)0x00F388D3,
        (uint32_t)0xFFFFFFFF
    };
    
    
    // CMD_RADIO_SETUP_PA
    // Radio Setup Command for Pre-Defined Schemes
    rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetupSR =
    {
        .commandNo = 0x0802,
        .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,
        .mode = 0x01,
        .loDivider = 0x00,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x0,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0xA73F,
        .pRegOverride = pOverridesSR,
        .pRegOverrideTxStd = 0,
        .pRegOverrideTx20 = 0
    };
    
    
    // CMD_FS
    // Frequency Synthesizer Programming Command
    rfc_CMD_FS_t RF_cmdFsSR =
    {
        .commandNo = 0x0803,
        .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,
        .frequency = 0x0965,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 0x1,
        .synthConf.refFreq = 0x0,
        .__dummy0 = 0x00,
        .__dummy1 = 0x00,
        .__dummy2 = 0x00,
        .__dummy3 = 0x0000
    };
    
    
    // CMD_IEEE_TX
    // IEEE 802.15.4 Transmit Command
    rfc_CMD_IEEE_TX_t RF_cmdIeeeTxSR =
    {
        .commandNo = 0x2C01,
        .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,
        .txOpt.bIncludePhyHdr = 0x0,
        .txOpt.bIncludeCrc = 0x0,
        .txOpt.payloadLenMsb = 0x0,
        .payloadLen = 0x05,
        .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .timeStamp = 0x00000000
    };
    
    
    // CMD_IEEE_RX
    // IEEE 802.15.4 Receive Command
    rfc_CMD_IEEE_RX_t RF_cmdIeeeRxSR =
    {
        .commandNo = 0x2801,
        .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,
        .channel = 0x00,
        .rxConfig.bAutoFlushCrc = 0x0,
        .rxConfig.bAutoFlushIgn = 0x0,
        .rxConfig.bIncludePhyHdr = 0x0,
        .rxConfig.bIncludeCrc = 0x0,
        .rxConfig.bAppendRssi = 0x1,
        .rxConfig.bAppendCorrCrc = 0x1,
        .rxConfig.bAppendSrcInd = 0x0,
        .rxConfig.bAppendTimestamp = 0x0,
        .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
        .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .frameFiltOpt.frameFiltEn = 0x0,
        .frameFiltOpt.frameFiltStop = 0x0,
        .frameFiltOpt.autoAckEn = 0x0,
        .frameFiltOpt.slottedAckEn = 0x0,
        .frameFiltOpt.autoPendEn = 0x0,
        .frameFiltOpt.defaultPend = 0x0,
        .frameFiltOpt.bPendDataReqOnly = 0x0,
        .frameFiltOpt.bPanCoord = 0x0,
        .frameFiltOpt.maxFrameVersion = 0x3,
        .frameFiltOpt.fcfReservedMask = 0x0,
        .frameFiltOpt.modifyFtFilter = 0x0,
        .frameFiltOpt.bStrictLenFilter = 0x0,
        .frameTypes.bAcceptFt0Beacon = 0x1,
        .frameTypes.bAcceptFt1Data = 0x1,
        .frameTypes.bAcceptFt2Ack = 0x1,
        .frameTypes.bAcceptFt3MacCmd = 0x1,
        .frameTypes.bAcceptFt4Reserved = 0x1,
        .frameTypes.bAcceptFt5Reserved = 0x1,
        .frameTypes.bAcceptFt6Reserved = 0x1,
        .frameTypes.bAcceptFt7Reserved = 0x1,
        .ccaOpt.ccaEnEnergy = 0x0,
        .ccaOpt.ccaEnCorr = 0x0,
        .ccaOpt.ccaEnSync = 0x0,
        .ccaOpt.ccaCorrOp = 0x1,
        .ccaOpt.ccaSyncOp = 0x1,
        .ccaOpt.ccaCorrThr = 0x0,
        .ccaRssiThr = 0x64,
        .__dummy0 = 0x00,
        .numExtEntries = 0x00,
        .numShortEntries = 0x00,
        .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx
        .pShortEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx
        .localExtAddr = 0x0000000012345678,
        .localShortAddr = 0xABBA,
        .localPanID = 0x0000,
        .__dummy1 = 0x000000,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000
    };
    
    
    
    

  • Hello,

    I've recorded a NXP frame with PacketSniffer2 but unable to open it.

    If you could see something inside ....

    How can I send the pcap file (2 ko) ?

    Best regards

    francois

  • Thanks for sharing the code snippet, I'll look through to see if the issue could be there.

    For attaching files in E2E, try : 
    Insert --> Image/video/file --> Upload

    Then you can select the file.

    You can also attach screenshot.

  • After looking through your code, it looks like you have something like this:

    1. Post (RF_postCmd) RX
    2. In RX callback (echoCallback), cancel (RF_cancelCmd) RX command, then post (RF_postCmd) TX

    At this point you don't have a background RX running.

    Can you try something simple like this:

    1. Schedule (RF_scheduleCmd) RX
    2. Schedule (RF_scheduleCmd) TX
    3. Wait for TX to finish (RF_pendCmd)
    4. Verify that the NXP device RX is ok, then go to step 2.

    Once we have standalone TX, then we can look into combining it with RX in a single example.

  • Hi Toby,

    Here are some more precisions :

    After looking through your code, it looks like you have something like this:

    1. Post (RF_postCmd) RX
    2. In RX callback (echoCallback), cancel (RF_cancelCmd) RX command, then post (RF_postCmd) TX

    At this point you don't have a background RX running.

    Exactly

    It doesn't  send any frame : 

    - if I remove RF_cancelCmd

    - if changed RF_postCmd by Rf_runscheduleCmd (with or without RF_cancelCmd)

    Can you try something simple like this:

    1. Schedule (RF_scheduleCmd) RX
    2. Schedule (RF_scheduleCmd) TX
    3. Wait for TX to finish (RF_pendCmd)
    4. Verify that the NXP device RX is ok, then go to step 2.

    If I change RF_postCmd by Rf_runscheduleCmd it doent's send any frame

    I've recorded and analysed the frame send by NXP, here is the result : 

    Top :recorded with wireshark

    Bot : same recorded with packet sniffer (you can see same payload at the end)

    I think RF_post Cmd is OK but there is something wrong in the preamble or synchronisation of the frame going to NXP

    Could it be a problem of Manchester encoding, how to change it ?

    Why do, on SmartRfStudio, when we send a Rf command, we have only these 3 commands send

    >CMD_RADIO_SETUP_PA executed
    > Status: 0x400 DONE_OK
    >CMD_FS executed
    > Status: 0x400 DONE_OK
    >CMD_ABORT executed
    > Status: 0x1 DONE_OK

    Is it possible for you to know the exact command of SmartRfStudio ?

    francois

  • Hi,

    I've recorded the frames send by different devices with wireshark, here is the result : 

    Frame send by NXP
    Freescale (72 bytes)

    0000 45 00 00 48 00 00 00 00 80 11 b7 4e c0 a8 01 03 E..H.......N....
    0010 c0 a8 01 03 45 5a 45 5a 00 34 3f db 45 58 02 01 ....EZEZ.4?.EX..
    0020 0b 45 27 00 7f 00 00 00 00 00 00 00 00 00 00 00 .E'.............
    0030 04 00 00 00 00 00 00 00 00 00 00 0c 61 00 18 00 ............a...
    0040 00 06 0b 02 01 00 2f ec ....../.

    Send by our TI software (not received by NXP)
    TI (70 bytes)
    0000 45 00 00 46 00 00 00 00 80 11 b7 50 c0 a8 01 03 E..F.......P....
    0010 c0 a8 01 03 45 5a 45 5a 00 32 c7 df 45 58 02 01 ....EZEZ.2..EX..
    0020 0b 45 27 00 7f 00 00 00 00 00 00 00 00 00 00 00 .E'.............
    0030 02 00 00 00 00 00 00 00 00 00 00 0a 04 06 00 01 ................
    0040 02 03 00 00 28 ec ....(.

    Send by SmartRfStudio (perfectly received by NXP)
    SmartRf (70 bytes)

    0000 45 00 00 46 00 00 00 00 80 11 b7 50 c0 a8 01 03 E..F.......P....
    0010 c0 a8 01 03 45 5a 45 5a 00 32 e2 d9 45 58 02 01 ....EZEZ.2..EX..
    0020 0b 45 27 00 7f 00 00 00 00 00 00 00 00 00 00 00 .E'.............
    0030 03 00 00 00 00 00 00 00 00 00 00 0a 00 01 02 03 ................
    0040 04 05 06 07 06 ec ......

    It's roughly the same, the different may be the chip address.

    Is there any possibility that the synchronisation and preamble could be different ?

    How to modify it ?

    Is the patch OK ? Is there no update  ?

    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)

    Best regards

    francois

  • Thanks for the further details!

    Based on our discussion so far, it does appear that their could be some difference in what the NXP RX is expecting over-the-air (SmartRF Studio sends data as expected, but the modified CCS example does not).

    I've looked through and compared from the past SDKs' file for rf_patch_cpe_ieee_802_15_4.h (from 2.40 til 5.10)

    Attached are the ones in which the patches differ.
    Can you try these on the CCS example (you may need to change the name of the patch array, e.g. rf_patch_cpe_ieee_802_15_4() --> rf_patch_cpe_ieee_802_15_4__SDK_2_40()) ?

    Additionally, can you check which version of the 802.15.4 spec that the NXP device uses ?
    Is there an NXP tool comparable to SmartRF Studio that you can use to control the NXP device ?


    2.40.00.81 SDK:

    /cfs-file/__key/communityserver-discussions-components-files/158/2746.simplelink_5F00_cc13x2_5F00_26x2_5F00_sdk_5F00_2_5F00_40_5F00_00_5F00_81_5F00_source_5F00_ti_5F00_devices_5F00_cc13x2_5F00_cc26x2_5F00_rf_5F00_patches_5F00_rf_5F00_patch_5F00_cpe_5F00_ieee_5F00_802_5F00_15_5F00_4.h

    3.10.00.54 SDK:

    /cfs-file/__key/communityserver-discussions-components-files/158/4382.simplelink_5F00_cc13x2_5F00_26x2_5F00_sdk_5F00_3_5F00_10_5F00_00_5F00_54_5F00_source_5F00_ti_5F00_devices_5F00_cc13x2_5F00_cc26x2_5F00_rf_5F00_patches_5F00_rf_5F00_patch_5F00_cpe_5F00_ieee_5F00_802_5F00_15_5F00_4.h

    4.10.00.78 SDK:

    /cfs-file/__key/communityserver-discussions-components-files/158/2555.simplelink_5F00_cc13x2_5F00_26x2_5F00_sdk_5F00_4_5F00_10_5F00_00_5F00_78_5F00_source_5F00_ti_5F00_devices_5F00_cc13x2_5F00_cc26x2_5F00_rf_5F00_patches_5F00_rf_5F00_patch_5F00_cpe_5F00_ieee_5F00_802_5F00_15_5F00_4.c

    4.20.00.35 SDK:

    /cfs-file/__key/communityserver-discussions-components-files/158/0728.simplelink_5F00_cc13x2_5F00_26x2_5F00_sdk_5F00_4_5F00_20_5F00_00_5F00_35_5F00_source_5F00_ti_5F00_devices_5F00_cc13x2_5F00_cc26x2_5F00_rf_5F00_patches_5F00_rf_5F00_patch_5F00_cpe_5F00_ieee_5F00_802_5F00_15_5F00_4.c

  • Hi Toby,

    Thanks for the patches, I've tested it without success.

    V4.10 and V4.20 seems to be the same as my original patch.

    V2.40 and V3.10 generates a different size .out file, frames are correctly sent to TI PacketSniffer but always not detected by 

    NXP. 

    I start working on MC13192 in 2008, I think NXP used an earlier version of 802.15.4. I have no real description of the 802.15.4 they use.

    In a lot of TI documents, they mentioned 802.15.4-2006 which, I assume, is not the same.

    For Sniffing frames we used the NXP Ide, pehaps there was a tool but we never used it (14 years ago ......)

    Could you more investigate how and with which tools SmartRfStudio has been built, because it works ?

    Regards

    francois

  • I integrated your code into rfPacketTx example for CC1352P.

    With another device running SmartRF Studio Packet RX, I found that the code could only transmit 1-2 frames each reset. (I believe this is due to using RF_postCmd).

    Attached is the same code you provided, with some modifications I made.

    With this modification, the CC1352P is able to TX packets every second (this can be adjusted to fit your use case). The modification assumes there is no TX activity from other devices (so the RX can continuously run as the background command), so that every time the CC1352P performs a TX (with RF_scheduleCmd), there is always that RX background command running.

    customer_code.c
    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    
    /* Application Header files */
    #include "RFQueue.h"
    #include "smartrf_settings/smartrf_settings.h"
    
    /* Packet RX Configuration */
    #define DATA_ENTRY_HEADER_SIZE 8  /* Constant header size of a Generic Data Entry */
    //#define MAX_LENGTH             30 /* Max length byte the radio will accept */ // original
    #define MAX_LENGTH             128 /* Max length byte the radio will accept */ // toby added
    #define NUM_DATA_ENTRIES       2  /* NOTE: Only two data entries supported at the moment */
    #define NUM_APPENDED_BYTES     2  /* The Data Entries data field will contain:
                                       * 1 Header byte (RF_cmdPropRx.rxConf.bIncludeHdr = 0x1)
                                       * Max 30 payload bytes
                                       * 1 status byte (RF_cmdPropRx.rxConf.bAppendStatus = 0x1) */
    
    /* Buffer which contains all Data Entries for receiving data.
     * Pragmas are needed to make sure this buffer is 4 byte aligned (requirement from the RF Core) */
    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_ALIGN (rxDataEntryBuffer, 4);
    static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(
            NUM_DATA_ENTRIES, MAX_LENGTH, NUM_APPENDED_BYTES)];
    #elif defined(__IAR_SYSTEMS_ICC__)
    #pragma data_alignment = 4
    static uint8_t
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      MAX_LENGTH,
                                                      NUM_APPENDED_BYTES)];
    #elif defined(__GNUC__)
    static uint8_t
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      MAX_LENGTH,
                                                      NUM_APPENDED_BYTES)]
                                                      __attribute__((aligned(4)));
    #else
    #error This compiler is not supported.
    #endif
    
    /* Receive dataQueue for RF Core to fill in data */
    static dataQueue_t dataQueue;
    static rfc_dataEntryGeneral_t *currentDataEntry;
    static uint8_t packetLength;
    static uint8_t *packetDataPointer;
    
    static RF_Handle rfHandle;
    static RF_Object rfObject;
    static rfc_ieeeRxOutput_t rxStatistics;
    
    //*********************************************************************************
    // Generated by SmartRF Studio version 2.20.1 (build#277)
    // The applied template is compatible with cc13x2_26x2 SDK version 2.10.xx.xx or newer.
    // Device: CC2652P Rev. E (2.1). Only supported by CC26x2 SDK version 3.30.xx.xx or newer
    //
    //*********************************************************************************
    
    //*********************************************************************************
    // Parameter summary
    // IEEE Channel: 11
    // Frequency: 2405 MHz
    // SFD: 0
    // Packet Data: 255
    // Preamble      (32 bit): 01010101...
    // TX Power: 14 dBm
    // Enable high output power PA: true
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)
    #include "smartrf_settings/smartrf_settings.h"
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_propSR = { .rfMode = RF_MODE_AUTO,
    .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4,
    .mcePatchFxn = 0,
    .rfePatchFxn = 0 };
    
    // Overrides for CMD_RADIO_SETUP_PA
    uint32_t pOverridesSR[] = {
    // override_ieee_802_15_4.xml
    // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0)
    (uint32_t)0x000F8883,
    // Tx: Set DCDC settings IPEAK=3, dither = off
    (uint32_t)0x00F388D3,
    (uint32_t)0xFFFFFFFF };
    
    // CMD_RADIO_SETUP_PA
    // Radio Setup Command for Pre-Defined Schemes
    rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetupSR = { .commandNo = 0x0802,
    .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,
    .mode = 0x01,
    .loDivider = 0x00,
    .config.frontEndMode = 0x0,
    .config.biasMode = 0x0,
    .config.analogCfgMode = 0x0,
    .config.bNoFsPowerUp = 0x0,
    .txPower = 0xA73F,
    .pRegOverride = pOverridesSR,
    .pRegOverrideTxStd = 0,
    .pRegOverrideTx20 = 0 };
    
    // CMD_FS
    // Frequency Synthesizer Programming Command
    rfc_CMD_FS_t RF_cmdFsSR = { .commandNo = 0x0803,
    .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,
    .frequency = 0x0965,
    .fractFreq = 0x0000,
    .synthConf.bTxMode = 0x1,
    .synthConf.refFreq = 0x0,
    .__dummy0 = 0x00,
    .__dummy1 = 0x00,
    .__dummy2 = 0x00,
    .__dummy3 = 0x0000 };
    
    // CMD_IEEE_TX
    // IEEE 802.15.4 Transmit Command
    rfc_CMD_IEEE_TX_t RF_cmdIeeeTxSR = { .commandNo = 0x2C01,
    .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,
    .txOpt.bIncludePhyHdr = 0x0,
    .txOpt.bIncludeCrc = 0x0,
    .txOpt.payloadLenMsb = 0x0,
    .payloadLen = 0x05,
    .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .timeStamp = 0x00000000 };
    
    // CMD_IEEE_RX
    // IEEE 802.15.4 Receive Command
    rfc_CMD_IEEE_RX_t RF_cmdIeeeRxSR = { .commandNo = 0x2801,
    .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,
    .channel = 0x00,
    .rxConfig.bAutoFlushCrc = 0x0,
    .rxConfig.bAutoFlushIgn = 0x0,
    .rxConfig.bIncludePhyHdr = 0x0,
    .rxConfig.bIncludeCrc = 0x0,
    .rxConfig.bAppendRssi = 0x1,
    .rxConfig.bAppendCorrCrc = 0x1,
    .rxConfig.bAppendSrcInd = 0x0,
    .rxConfig.bAppendTimestamp = 0x0,
    .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
    .pOutput = 0,// INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .frameFiltOpt.frameFiltEn = 0x0, .frameFiltOpt.frameFiltStop = 0x0,
    .frameFiltOpt.autoAckEn = 0x0, .frameFiltOpt.slottedAckEn = 0x0,
    .frameFiltOpt.autoPendEn = 0x0, .frameFiltOpt.defaultPend = 0x0,
    .frameFiltOpt.bPendDataReqOnly = 0x0, .frameFiltOpt.bPanCoord = 0x0,
    .frameFiltOpt.maxFrameVersion = 0x3, .frameFiltOpt.fcfReservedMask = 0x0,
    .frameFiltOpt.modifyFtFilter = 0x0, .frameFiltOpt.bStrictLenFilter = 0x0,
    .frameTypes.bAcceptFt0Beacon = 0x1, .frameTypes.bAcceptFt1Data = 0x1,
    .frameTypes.bAcceptFt2Ack = 0x1, .frameTypes.bAcceptFt3MacCmd = 0x1,
    .frameTypes.bAcceptFt4Reserved = 0x1, .frameTypes.bAcceptFt5Reserved = 0x1,
    .frameTypes.bAcceptFt6Reserved = 0x1, .frameTypes.bAcceptFt7Reserved = 0x1,
    .ccaOpt.ccaEnEnergy = 0x0, .ccaOpt.ccaEnCorr = 0x0, .ccaOpt.ccaEnSync = 0x0,
    .ccaOpt.ccaCorrOp = 0x1, .ccaOpt.ccaSyncOp = 0x1, .ccaOpt.ccaCorrThr = 0x0,
    .ccaRssiThr = 0x64, .__dummy0 = 0x00, .numExtEntries = 0x00,
    .numShortEntries = 0x00,
    .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx
    .pShortEntryList = 0,// INSERT APPLICABLE POINTER: (uint32_t*)&xxx
    .localExtAddr = 0x0000000012345678, .localShortAddr = 0xABBA, .localPanID =
            0x0000,
    .__dummy1 = 0x000000, .endTrigger.triggerType = 0x1, .endTrigger.bEnaCmd = 0x0,
    .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0
    ,.endTime = 0x00000000 };
    
    
    
    static void echoCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        static uint8_t txPacket[5] = { 0x00, 0x01, 0x02, 0x03, 0x04, };
        if (e & RF_EventRxEntryDone)
        {
            /* Successful RX */
            currentDataEntry = RFQueue_getDataEntry(); /* Get current unhandled data entry */
            packetLength = *(uint8_t*) (&(currentDataEntry->data));
            packetDataPointer = (uint8_t*) (&(currentDataEntry->data) + 1);
            RFQueue_nextEntry();
            /* Command Tx */
            RF_cmdIeeeTxSR.startTrigger.triggerType = TRIG_REL_PREVEND; //TRIG_NOW;
            RF_cmdIeeeTxSR.pPayload = &txPacket[0];
            RF_cmdIeeeTxSR.payloadLen = 5;
            /* Command Rx */
            RF_cancelCmd(rfHandle, ch, 1);
            RF_EventMask terminationReason = RF_postCmd(
                    rfHandle,
                    (RF_Op*) &RF_cmdIeeeTxSR,
                    RF_PriorityNormal,
                    &echoCallback,
                    (RF_EventRxEntryDone | RF_EventTxEntryDone | RF_EventLastCmdDone
                            | RF_EventLastFGCmdDone | RF_EventFGCmdDone));
        }
        else if (e & RF_EventTxEntryDone)
        {
        }
        else if (e & RF_EventLastCmdDone)
        {
        }
        else
        {
            RF_cmdIeeeRxSR.pRxQ = &dataQueue;
            RF_cmdIeeeRxSR.startTrigger.triggerType = TRIG_REL_PREVEND;
            RF_cmdIeeeRxSR.pOutput = &rxStatistics;
            RF_EventMask terminationReason = RF_postCmd(
                    rfHandle,
                    (RF_Op*) &RF_cmdIeeeRxSR,
                    RF_PriorityNormal,
                    &echoCallback,
                    (RF_EventRxEntryDone | RF_EventTxEntryDone | RF_EventLastCmdDone
                            | RF_EventLastFGCmdDone | RF_EventFGCmdDone));
        }
    }
    
    void* mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
        //initAntennaSwitch();
        if (RFQueue_defineQueue(&dataQueue, rxDataEntryBuffer,
                                sizeof(rxDataEntryBuffer), NUM_DATA_ENTRIES,
                                MAX_LENGTH + NUM_APPENDED_BYTES))
        {
            while (1)
                ;
        }
        rfHandle = RF_open(&rfObject, &RF_propSR,
                           (RF_RadioSetup*) &RF_cmdRadioSetupSR, &rfParams);
        RF_postCmd(rfHandle, (RF_Op*) &RF_cmdFsSR, RF_PriorityNormal, NULL, 0);
        while (1)
        {
            RF_cmdIeeeRxSR.pRxQ = &dataQueue;
            RF_cmdIeeeRxSR.pOutput = &rxStatistics;
            // original, toby commented
    //        RF_EventMask terminationReason = RF_postCmd(
    //                rfHandle, (RF_Op*) &RF_cmdIeeeRxSR, RF_PriorityNormal,
    //                &echoCallback, (RF_EventRxEntryDone | RF_EventLastCmdDone));
            // end original
    
    
            // toby added
            RF_EventMask terminationReason = 0; // not used
    
            RF_ScheduleCmdParams rfScheduleCmdParams_rx;
            RF_ScheduleCmdParams_init(&rfScheduleCmdParams_rx);
    
            RF_CmdHandle rxCmdHandle = RF_scheduleCmd(
                    rfHandle, (RF_Op*) &RF_cmdIeeeRxSR, &rfScheduleCmdParams_rx,
                    NULL, NULL);
            if (RF_ALLOC_ERROR == rxCmdHandle)
                while (1); // error in RF_postCmd
            static uint8_t txPacket[5] = { 0x00, 0x01, 0x02, 0x03, 0x04, };
            while (1)
            {
                RF_cmdIeeeTxSR.startTrigger.triggerType = TRIG_NOW;
                RF_cmdIeeeTxSR.pPayload = &txPacket[0];
                RF_cmdIeeeTxSR.payloadLen = 5;
    
                RF_ScheduleCmdParams rfScheduleCmdParams_tx;
                RF_ScheduleCmdParams_init(&rfScheduleCmdParams_tx);
    
                RF_CmdHandle txCmdHandle = RF_scheduleCmd(
                        rfHandle,
                        (RF_Op*) &RF_cmdIeeeTxSR,
                        &rfScheduleCmdParams_tx,
                        NULL,
                        NULL);
                if (RF_ALLOC_ERROR == txCmdHandle)
                    while (1); // error in RF_postCmd
                RF_pendCmd(rfHandle, txCmdHandle, NULL);
                sleep(1);
            }
            // end added
    
            switch (terminationReason)
            {
            case RF_EventLastCmdDone:
                break;
            case RF_EventCmdCancelled:
                break;
            case RF_EventCmdAborted:
                break;
            case RF_EventCmdStopped:
                break;
            default:
                break;
            }
            uint32_t cmdStatus = ((volatile RF_Op*) &RF_cmdIeeeRxSR)->status;
            switch (cmdStatus)
            {
            case PROP_DONE_OK:
                break;
            case PROP_DONE_RXERR:
                break;
            case PROP_DONE_RXTIMEOUT:
                break;
            case PROP_DONE_BREAK:
                break;
            case PROP_DONE_ENDED:
                break;
            case PROP_DONE_STOPPED:
                break;
            case PROP_DONE_ABORT:
                break;
            case PROP_ERROR_RXBUF:
                break;
            case PROP_ERROR_RXFULL:
                break;
            case PROP_ERROR_PAR:
                break;
            case PROP_ERROR_NO_SETUP:
                break;
            case PROP_ERROR_NO_FS:
                break;
            case PROP_ERROR_RXOVF:
                break;
            default:
                while (1);
                break;
            }
        }
    }
    
    

  • Hi Toby,

    Thank you for your piece of code, I've included it in my project, but always the same effect : 

    I see correctly the frame every second with PacketSniffer but 1 over 100 or more with NXP

    and always straightforward at 1 st attempt with SmartRfStudio7 ....

    francois

  • After discussing with my team, can you try the below TX code?

    The difference is that now we are incrementing the "sequence number" on the TX payload.

    SmartRF Studio is actually incrementing this automatically:

    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    
    /* Application Header files */
    #include "RFQueue.h"
    #include "smartrf_settings/smartrf_settings.h"
    
    /* Packet RX Configuration */
    #define DATA_ENTRY_HEADER_SIZE 8  /* Constant header size of a Generic Data Entry */
    //#define MAX_LENGTH             30 /* Max length byte the radio will accept */ // original
    #define MAX_LENGTH             128 /* Max length byte the radio will accept */ // toby added
    #define NUM_DATA_ENTRIES       2  /* NOTE: Only two data entries supported at the moment */
    #define NUM_APPENDED_BYTES     2  /* The Data Entries data field will contain:
                                       * 1 Header byte (RF_cmdPropRx.rxConf.bIncludeHdr = 0x1)
                                       * Max 30 payload bytes
                                       * 1 status byte (RF_cmdPropRx.rxConf.bAppendStatus = 0x1) */
    
    /* Buffer which contains all Data Entries for receiving data.
     * Pragmas are needed to make sure this buffer is 4 byte aligned (requirement from the RF Core) */
    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_ALIGN (rxDataEntryBuffer, 4);
    static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(
            NUM_DATA_ENTRIES, MAX_LENGTH, NUM_APPENDED_BYTES)];
    #elif defined(__IAR_SYSTEMS_ICC__)
    #pragma data_alignment = 4
    static uint8_t
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      MAX_LENGTH,
                                                      NUM_APPENDED_BYTES)];
    #elif defined(__GNUC__)
    static uint8_t
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      MAX_LENGTH,
                                                      NUM_APPENDED_BYTES)]
                                                      __attribute__((aligned(4)));
    #else
    #error This compiler is not supported.
    #endif
    
    /* Receive dataQueue for RF Core to fill in data */
    static dataQueue_t dataQueue;
    static rfc_dataEntryGeneral_t *currentDataEntry;
    static uint8_t packetLength;
    static uint8_t *packetDataPointer;
    
    static RF_Handle rfHandle;
    static RF_Object rfObject;
    static rfc_ieeeRxOutput_t rxStatistics;
    
    //*********************************************************************************
    // Generated by SmartRF Studio version 2.20.1 (build#277)
    // The applied template is compatible with cc13x2_26x2 SDK version 2.10.xx.xx or newer.
    // Device: CC2652P Rev. E (2.1). Only supported by CC26x2 SDK version 3.30.xx.xx or newer
    //
    //*********************************************************************************
    
    //*********************************************************************************
    // Parameter summary
    // IEEE Channel: 11
    // Frequency: 2405 MHz
    // SFD: 0
    // Packet Data: 255
    // Preamble      (32 bit): 01010101...
    // TX Power: 14 dBm
    // Enable high output power PA: true
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)
    #include "smartrf_settings/smartrf_settings.h"
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_propSR = { .rfMode = RF_MODE_AUTO,
    .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4,
    .mcePatchFxn = 0,
    .rfePatchFxn = 0 };
    
    // Overrides for CMD_RADIO_SETUP_PA
    uint32_t pOverridesSR[] = {
    // override_ieee_802_15_4.xml
    // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0)
    (uint32_t)0x000F8883,
    // Tx: Set DCDC settings IPEAK=3, dither = off
    (uint32_t)0x00F388D3,
    (uint32_t)0xFFFFFFFF };
    
    // CMD_RADIO_SETUP_PA
    // Radio Setup Command for Pre-Defined Schemes
    rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetupSR = { .commandNo = 0x0802,
    .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,
    .mode = 0x01,
    .loDivider = 0x00,
    .config.frontEndMode = 0x0,
    .config.biasMode = 0x0,
    .config.analogCfgMode = 0x0,
    .config.bNoFsPowerUp = 0x0,
    .txPower = 0xA73F,
    .pRegOverride = pOverridesSR,
    .pRegOverrideTxStd = 0,
    .pRegOverrideTx20 = 0 };
    
    // CMD_FS
    // Frequency Synthesizer Programming Command
    rfc_CMD_FS_t RF_cmdFsSR = { .commandNo = 0x0803,
    .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,
    .frequency = 0x0965,
    .fractFreq = 0x0000,
    .synthConf.bTxMode = 0x1,
    .synthConf.refFreq = 0x0,
    .__dummy0 = 0x00,
    .__dummy1 = 0x00,
    .__dummy2 = 0x00,
    .__dummy3 = 0x0000 };
    
    // CMD_IEEE_TX
    // IEEE 802.15.4 Transmit Command
    rfc_CMD_IEEE_TX_t RF_cmdIeeeTxSR = { .commandNo = 0x2C01,
    .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,
    .txOpt.bIncludePhyHdr = 0x0,
    .txOpt.bIncludeCrc = 0x0,
    .txOpt.payloadLenMsb = 0x0,
    .payloadLen = 0x05,
    .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .timeStamp = 0x00000000 };
    
    // CMD_IEEE_RX
    // IEEE 802.15.4 Receive Command
    rfc_CMD_IEEE_RX_t RF_cmdIeeeRxSR = { .commandNo = 0x2801,
    .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,
    .channel = 0x00,
    .rxConfig.bAutoFlushCrc = 0x0,
    .rxConfig.bAutoFlushIgn = 0x0,
    .rxConfig.bIncludePhyHdr = 0x0,
    .rxConfig.bIncludeCrc = 0x0,
    .rxConfig.bAppendRssi = 0x1,
    .rxConfig.bAppendCorrCrc = 0x1,
    .rxConfig.bAppendSrcInd = 0x0,
    .rxConfig.bAppendTimestamp = 0x0,
    .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
    .pOutput = 0,// INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .frameFiltOpt.frameFiltEn = 0x0, .frameFiltOpt.frameFiltStop = 0x0,
    .frameFiltOpt.autoAckEn = 0x0, .frameFiltOpt.slottedAckEn = 0x0,
    .frameFiltOpt.autoPendEn = 0x0, .frameFiltOpt.defaultPend = 0x0,
    .frameFiltOpt.bPendDataReqOnly = 0x0, .frameFiltOpt.bPanCoord = 0x0,
    .frameFiltOpt.maxFrameVersion = 0x3, .frameFiltOpt.fcfReservedMask = 0x0,
    .frameFiltOpt.modifyFtFilter = 0x0, .frameFiltOpt.bStrictLenFilter = 0x0,
    .frameTypes.bAcceptFt0Beacon = 0x1, .frameTypes.bAcceptFt1Data = 0x1,
    .frameTypes.bAcceptFt2Ack = 0x1, .frameTypes.bAcceptFt3MacCmd = 0x1,
    .frameTypes.bAcceptFt4Reserved = 0x1, .frameTypes.bAcceptFt5Reserved = 0x1,
    .frameTypes.bAcceptFt6Reserved = 0x1, .frameTypes.bAcceptFt7Reserved = 0x1,
    .ccaOpt.ccaEnEnergy = 0x0, .ccaOpt.ccaEnCorr = 0x0, .ccaOpt.ccaEnSync = 0x0,
    .ccaOpt.ccaCorrOp = 0x1, .ccaOpt.ccaSyncOp = 0x1, .ccaOpt.ccaCorrThr = 0x0,
    .ccaRssiThr = 0x64, .__dummy0 = 0x00, .numExtEntries = 0x00,
    .numShortEntries = 0x00,
    .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx
    .pShortEntryList = 0,// INSERT APPLICABLE POINTER: (uint32_t*)&xxx
    .localExtAddr = 0x0000000012345678, .localShortAddr = 0xABBA, .localPanID =
            0x0000,
    .__dummy1 = 0x000000, .endTrigger.triggerType = 0x1, .endTrigger.bEnaCmd = 0x0,
    .endTrigger.triggerNo = 0x0, .endTrigger.pastTrig = 0x0
    ,.endTime = 0x00000000 };
    
    
    
    static void echoCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        static uint8_t txPacket[5] = { 0x00, 0x01, 0x02, 0x03, 0x04, };
        if (e & RF_EventRxEntryDone)
        {
            /* Successful RX */
            currentDataEntry = RFQueue_getDataEntry(); /* Get current unhandled data entry */
            packetLength = *(uint8_t*) (&(currentDataEntry->data));
            packetDataPointer = (uint8_t*) (&(currentDataEntry->data) + 1);
            RFQueue_nextEntry();
            /* Command Tx */
            RF_cmdIeeeTxSR.startTrigger.triggerType = TRIG_REL_PREVEND; //TRIG_NOW;
            RF_cmdIeeeTxSR.pPayload = &txPacket[0];
            RF_cmdIeeeTxSR.payloadLen = 5;
            /* Command Rx */
            RF_cancelCmd(rfHandle, ch, 1);
            RF_EventMask terminationReason = RF_postCmd(
                    rfHandle,
                    (RF_Op*) &RF_cmdIeeeTxSR,
                    RF_PriorityNormal,
                    &echoCallback,
                    (RF_EventRxEntryDone | RF_EventTxEntryDone | RF_EventLastCmdDone
                            | RF_EventLastFGCmdDone | RF_EventFGCmdDone));
        }
        else if (e & RF_EventTxEntryDone)
        {
        }
        else if (e & RF_EventLastCmdDone)
        {
        }
        else
        {
            RF_cmdIeeeRxSR.pRxQ = &dataQueue;
            RF_cmdIeeeRxSR.startTrigger.triggerType = TRIG_REL_PREVEND;
            RF_cmdIeeeRxSR.pOutput = &rxStatistics;
            RF_EventMask terminationReason = RF_postCmd(
                    rfHandle,
                    (RF_Op*) &RF_cmdIeeeRxSR,
                    RF_PriorityNormal,
                    &echoCallback,
                    (RF_EventRxEntryDone | RF_EventTxEntryDone | RF_EventLastCmdDone
                            | RF_EventLastFGCmdDone | RF_EventFGCmdDone));
        }
    }
    
    void* mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
        //initAntennaSwitch();
        if (RFQueue_defineQueue(&dataQueue, rxDataEntryBuffer,
                                sizeof(rxDataEntryBuffer), NUM_DATA_ENTRIES,
                                MAX_LENGTH + NUM_APPENDED_BYTES))
        {
            while (1)
                ;
        }
        rfHandle = RF_open(&rfObject, &RF_propSR,
                           (RF_RadioSetup*) &RF_cmdRadioSetupSR, &rfParams);
        RF_postCmd(rfHandle, (RF_Op*) &RF_cmdFsSR, RF_PriorityNormal, NULL, 0);
        while (1)
        {
            RF_cmdIeeeRxSR.pRxQ = &dataQueue;
            RF_cmdIeeeRxSR.pOutput = &rxStatistics;
            // original, toby commented
    //        RF_EventMask terminationReason = RF_postCmd(
    //                rfHandle, (RF_Op*) &RF_cmdIeeeRxSR, RF_PriorityNormal,
    //                &echoCallback, (RF_EventRxEntryDone | RF_EventLastCmdDone));
            // end original
    
    
            // toby added
            RF_EventMask terminationReason = 0; // not used
    
            RF_ScheduleCmdParams rfScheduleCmdParams_rx;
            RF_ScheduleCmdParams_init(&rfScheduleCmdParams_rx);
    
            RF_CmdHandle rxCmdHandle = RF_scheduleCmd(
                    rfHandle, (RF_Op*) &RF_cmdIeeeRxSR, &rfScheduleCmdParams_rx,
                    NULL, NULL);
            if (RF_ALLOC_ERROR == rxCmdHandle)
                while (1); // error in RF_postCmd
            static uint8_t txPacket[5] = { 0x00, 0x01, 0x02, 0x03, 0x04, };
            while (1)
            {
                RF_cmdIeeeTxSR.startTrigger.triggerType = TRIG_NOW;
                RF_cmdIeeeTxSR.pPayload = &txPacket[0];
                RF_cmdIeeeTxSR.payloadLen = 5;
    
                RF_ScheduleCmdParams rfScheduleCmdParams_tx;
                RF_ScheduleCmdParams_init(&rfScheduleCmdParams_tx);
    
                RF_CmdHandle txCmdHandle = RF_scheduleCmd(
                        rfHandle,
                        (RF_Op*) &RF_cmdIeeeTxSR,
                        &rfScheduleCmdParams_tx,
                        NULL,
                        NULL);
                if (RF_ALLOC_ERROR == txCmdHandle)
                    while (1); // error in RF_postCmd
                RF_pendCmd(rfHandle, txCmdHandle, NULL);
                sleep(1);
                // increment sequence number
                txPacket[1] += 1;
            }
            // end added
    
            switch (terminationReason)
            {
            case RF_EventLastCmdDone:
                break;
            case RF_EventCmdCancelled:
                break;
            case RF_EventCmdAborted:
                break;
            case RF_EventCmdStopped:
                break;
            default:
                break;
            }
            uint32_t cmdStatus = ((volatile RF_Op*) &RF_cmdIeeeRxSR)->status;
            switch (cmdStatus)
            {
            case PROP_DONE_OK:
                break;
            case PROP_DONE_RXERR:
                break;
            case PROP_DONE_RXTIMEOUT:
                break;
            case PROP_DONE_BREAK:
                break;
            case PROP_DONE_ENDED:
                break;
            case PROP_DONE_STOPPED:
                break;
            case PROP_DONE_ABORT:
                break;
            case PROP_ERROR_RXBUF:
                break;
            case PROP_ERROR_RXFULL:
                break;
            case PROP_ERROR_PAR:
                break;
            case PROP_ERROR_NO_SETUP:
                break;
            case PROP_ERROR_NO_FS:
                break;
            case PROP_ERROR_RXOVF:
                break;
            default:
                while (1);
                break;
            }
        }
    }
    
    

  • Hi Toby,

    I've tried with the Sequence Number increasing, but no better results.

    On SmartRfStudio with or without Sequence Number the detection on NXP is always at the 1st frame sent.

    Best regards,

    francois

  • Hi Toby, hi Ryan,

    I've found the problem : 

    It comes from the sysconfig of the project, the parameter "XOSC Cap Array Modification" was checked

    and the value was 0xC1 (in a lot of project samples). I've unchecked it (or set to 0) and now it's fine

    I can send and receive 802.15.4 frames between NXP and TI.

    (It sounds that the NXP is more selective than the TI to this parameter)

    To summarize, for communication between NXP and TI, I've set :

    Select 802.15.4 OQPSK 250 kbps configuration

    Take exactly the function parameters generated by sysconfig

    Use RF_postCmd (possibe to use inside interrupt)

    Stop Rxcmd (RF_cancelCmd) before sending Tx command

    Thank you,

    francois