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-CC1352R1: Adding new Sensor Support to 15.4 Sensor and Collector

Part Number: LAUNCHXL-CC1352R1

Hello,

I am using CC1352R- REV E boards, SDK 3.20.

I followed this link - http://processors.wiki.ti.com/index.php/Adding_New_Sensor_Support_To_Sub1GHz_Sensor_To_Cloud_Linux_Gateway to add a new Sensor Support.

Setup 1 - 15.4 Collector and Sensor

 I tested it with 15.4 Collector and Sensor (basic - i.e NON_OAD) and it worked as expected. I checked it by sending random data from the Sensor and was able to see that in the newly added Generic variable.

Setup 2 - 15.4 Collector and Sensor_OAD

 I followed all the steps as described in the link in Sensor_oad as well but after building it I am getting the following Linking error -

So to figure out where I went wrong I started again with a fresh project and decided to Clean-Build after every step.

On the 2nd step(from the link) which says -

"Define the command ID values for Smsgs_cmdIds_genericReq and Smsgs_cmdIds_genericRsp. These values are 12 and 13 so they do not conflict with other commands defined in the Sensor To Cloud Application."


As described I added the new command ID values after Commission enums. Like this -

/*! SM Commissioning start command sent from collector to the sensor */
Smgs_cmdIds_CommissionStart = 14,
/*! SM Commissioning message sent bi-directionally between the collector and sensor */
Smgs_cmdIds_CommissionMsg = 15,
/* Generic message*/
Smsgs_cmdIds_genericReq = 16,
/*Generic message response*/
Smsgs_cmdIds_genericRsp = 17                (just to be sure I also added a comma after 17 but it still gave the same error)

 

As soon as I add a new enum I am getting an error(described in the screenshot above).
Things I tried (all of which gave me the same error)- 
1) I thought the values assigned might be conflicting so I tried with various values.
2) I even commented the commisionStart and CommissionMsg enums (from above) and in their place added those generic enums with the ID 14 and 15.
3) Thinking the names might be conflicting I also changed their names to something random like "abc" and "xyz".
4) I tried to add an enum without assigning it a value.
So, can anyone help me in knowing where am I going wrong with this, is there something obvious that I am missing out on?
Is this an expected behavior, if so, is there any workaround for this?
Any help is appreciated.
Thanks and Regards,
Yash.
  • Hello Ryan,

    I think my question was misinterpreted. I will try to explain it once again. 

    I aim to add the generic sensor support to my Sensor_oad project. For which I am supposed to add the following

    /*!
    Message IDs for Sensor data messages. When sent over-the-air in a message,
    this field is one byte.
    */
    typedef enum
    {
    /*! Configuration message, sent from the collector to the sensor */
    Smsgs_cmdIds_configReq = 1,
    /*! Configuration Response message, sent from the sensor to the collector */
    Smsgs_cmdIds_configRsp = 2,
    /*! Tracking request message, sent from the the collector to the sensor */
    Smsgs_cmdIds_trackingReq = 3,
    /*! Tracking response message, sent from the sensor to the collector */
    Smsgs_cmdIds_trackingRsp = 4,
    /*! Sensor data message, sent from the sensor to the collector */
    Smsgs_cmdIds_sensorData = 5,
    /* Toggle LED message, sent from the collector to the sensor */
    Smsgs_cmdIds_toggleLedReq = 6,
    /* Toggle LED response msg, sent from the sensor to the collector */
    Smsgs_cmdIds_toggleLedRsp = 7,
    /* new data type for ramp data */
    Smsgs_cmdIds_rampdata = 8,
    /*! OAD mesages, sent/received from both collector and sensor */
    Smsgs_cmdIds_oad = 9,
    /* Broadcast control msg, sent from the collector to the sensor */
    Smgs_cmdIds_broadcastCtrlMsg = 10,
    /* KEY Exchange msg, between collector and the sensor */
    Smgs_cmdIds_KeyExchangeMsg = 11,
    /* Identify LED request msg */
    Smsgs_cmdIds_IdentifyLedReq = 12,
    /* Identify LED response msg */
    Smsgs_cmdIds_IdentifyLedRsp = 13,
    /*! SM Commissioning start command sent from collector to the sensor */
    Smgs_cmdIds_CommissionStart = 14,
    /*! SM Commissioning message sent bi-directionally between the collector and sensor */
    Smgs_cmdIds_CommissionMsg = 15,

    /* Generic message*/
    Smsgs_cmdIds_genericReq = 16,      //added by user
    /*Generic message response*/
    Smsgs_cmdIds_genericRsp = 17      //added by user

    } Smsgs_cmdIds_t;

    (Brown indicates - Original enum  ||  Red indicates  - Added part)

    to Smsgs_cmdIds_t enum, which is in smsgs.h file.

    But when I try to add the above-listed enumerators/members the project is throwing me an error. (Screenshot for the error is attached in the previous question) 

    In fact, it's not about the link I am following. This is what I tried -

    I took Sensor_oad project straight from the Resource Explorer, opened smsgs.h file and tried adding an enumerator/member in the enum (quoted above) but it is giving an error. In my question above I have explained the same with a screenshot and the things that I tried.

    Note - I have tried the same thing(adding extra enumerators) in the basic Sensor code and it worked. 

    I hope I was able to explain myself this time.

    So my question is, is there any specific reason on why I am not able to add any extra enumerators to that specific enum?

    Thanks and Regards,

    Yash.

  • Hi Yash,

    The OAD projects appear to be referencing the smsgs.h from source\ti\ti154stack\common\inc when handling Sensor_sendMsg, you can modify the Smsgs_cmdIds_t enumeration of this file accordingly to resolve the linker error.

    Regards,
    Ryan

  • Hi Ryan,

    What you suggested resolved my issue. But I still have a couple of questions-

    1) How can I make the OAD refer to the local smsgs.h instead of the library one? 

    2) Just out of curiosity - Why is only one enum affected by the OAD referencing, why don't the others give an error when changes are made to them?

    Thanks and Regards,

    Yash.

  • Hi Yash,

    It has something to do with a conflict between the common (COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR) and local (PROJECT_ROOT) include options and the structure of source\ti\ti154stack\apps.  I believe it is still referencing the local since the compile succeeds but then the build fails due to a conflict during linking.  Some changes can be made to the project options in order to resolve the issue but I do not recommend this course of action.  I will follow up with the Software Development Team so that this can be corrected in future SDKs.

    Regards,
    Ryan