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.

Compiler/LPSTK-CC1352R: LPSTK-CC1352R

Part Number: LPSTK-CC1352R
Other Parts Discussed in Thread: SYSBIOS, CC1352R, SYSCONFIG

Tool/software: TI C/C++ Compiler

Hi,

  1. Processor: CC1352
  2. TIRTOS simplelink_cc13x2_26x2_sdk_4_10_00_78
  3. xdctools_3_61_00_16_core

Objective:

I am trying to develop a BLE application that aims to configure/update a device transmitting data over sub-1GHz proprietary protocol.

Step1: BLE application

I adapted the BLE simple peripheral example, in order to expose different service and characteristic.

I also created one Makefile in order to ease the automatic build (without ccs).

Step2:  sub-1GHz proprietary protocol.

I adapted the <rfEasyLinkTx> example to develop my own protocol.

Step3: Merging the sub-1GHz proprietary protocol project into the BLE application project

I am trying to add the dependency required by the sub-1GHz support into my BLE Makefile.

However, the <rfEasyLinkTx> depends on :

-l"tirtos_builds_CC1352R1_LAUNCHXL_release_ccs\Debug\configPkg\package\cfg\release_pem4f.oem4f"
-l"\tirtos_builds_CC1352R1_LAUNCHXL_release_ccs\src\sysbios\rom_sysbios.aem4f"
-l"C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\boot.aem4f"
-l"C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\auto_init.aem4f"
-l"C:\ti\ccs1000\xdctools_3_61_00_16_core\packages\xdc\rov\runtime\lib\xdc.rov.runtime.aem4f"

and the build of the TI-RTOS kernel

whereas the BLE peripheral depends on:

-l"build\simple_peripheral\package\cfg\simple_peripheral_app_pem4f.oem4f"
-l"build\simple_peripheral\package\cfg\simple_peripheral_app_pem4f.src\sysbios\rom_sysbios.aem4f"
-l"C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\boot.aem4f"
-l"C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\auto_init.aem4f"
-l"C:\ti\xdctools_3_61_00_16_core\packages\xdc\rov\runtime\lib\xdc.rov.runtime.aem4f"

Some symbol are defined by both *.oem4f and *.aem4f files. Which one could I used, what's the method?

I took a look to <DMM WSN Node + BLE Peripheral>  example, and it mentions that:

 This example uses the tasks from the Wireless Sensor Network Node example and the BLE simple_peripheral example along with TI's DMM (Dynamic Multi-protocol Manager) to demonstrate the multi-protocol and dual band features of the CC1352R.

without explaining how to "merge" both stack...?

Thanks by advance.

  • Hi Jo,

    You seem to be on the right track, you just seem to have had a minor hick-up on the kernel part of the merging.

    Consider both projects stand-alone. Each project depend on TI-RTOS and thus generate a kernel using the XDC tools and the .cfg file. (In the EasyLink case there is likely an external project for TI-RTOS while the BLE project does not split like this). When the kernel is build, the packets you list above is generated which is then later linked with the application.

    When you merge two TI-RTOS projects you don't merge the TI-RTOS generated files as well. Typically you never move files found in the "Debug" folder as these are generated files. A project should/need to only have one .cfg file which is the same as saying that it only contain one TI-RTOS setup. This means that you should choose one set of TI-RTOS files (in this case, i recommend going with the BLE) and make sure that this .cfg file used to generate these aligns with that of the other project.

    Best regards,

    Max

  • Hi Max,

    Thank you for your quick response. I get it! Both projects configure TI_RTOS thanks to their *.cfg file

    So I compared both *.cfg file and below are the main difference:

    /* ================ Program configuration ================ */
    /*
    * Program.stack must be set to 0 to allow the setting
    * of the system stack size to be determined in the example's
    * linker command file.
    */
    Program.stack = 0; //for <rfEasyLinkTx>
    
    Program.stack = 1024; //for <BLE simplePerihperal>
    
    /*
    * Minimize exit handler array in the System module. The System module includes
    * an array of functions that are registered with System_atexit() which is
    * called by System_exit(). The default value is 8.
    */
    System.maxAtexitHandlers = 2; // for <rfEasyLinkTx>
    
    System.maxAtexitHandlers = 0; //for <BLE simplePerihperal>
    /*
    * If Task.enableIdleTask is set to true, this option sets the idle task's
    * stack size.
    *
    * Reducing the idle stack size yields greater memory savings.
    */
    Task.idleTaskStackSize = 512;  //for <rfEasyLinkTx>
    
    Task.idleTaskStackSize = 768; //for <BLE simplePerihperal>
    
    /* ================ Mailbox configuration ================ */
    var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox'); //for <rfEasyLinkTx>
    no mailbox //for <BLE simplePeripheral>

    I tried different *.cfg combination and make sure to use similar *syscfg (enable Sub-1GHz in the RFDesign) file but for a spurious reason, in the BLE project, my RF module hangs when calling the function:

    RF_EventMask RF_runCmd(RF_Handle h, RF_Op* pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent)

    in the rfEasyLinkTx, this function is defined in C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\source\ti\drivers\rf\RFCC26X2_multiMode.c 

    whereas in the BLE simple peripheral this function is implemented within this library:

    -l$(SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR)/source/ti/drivers/rf/lib/rf_multiMode_cc13x2.aem4f

    Questions:

    1. Does this library contain a specific RF_*  implementation which could lead to an incompatibility with the sub-1GHz?
    2. For the BLE project, is there any limitation to build C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\source\ti\drivers\rf\RFCC26X2_multiMode.c instead of tlink with he library rf_multiMode_cc13x2.aem4f?
    3. If yes, how to rebuild/configure this library in order to be compatible with the sub-1GHz interface?
    4. Finally, where could I get precise information related to this build process?

    Sincerely

  • In the BLE simplePeripheral project, I removed the dependency with the library rf_multiMode_cc13x2.aem4f, and then build the source file C:\ti\simplelink_cc13x2_26x2_sdk_4_10_00_78\source\ti\drivers\rf\RFCC26X2_multiMode.c (like within the rfEasyLinkTx)

    The interesting things is that the linker complains that some function are not implemented:

      symbol                        in file                          
     ---------                  ----------------                     
     NOROM_RFCAnaDivTxOverride  ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCCpeIntGetAndClear ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCCpePatchReset     ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCDoorbellSendTo    ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCHwIntGetAndClear  ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCOverrideSearch    ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCOverrideUpdate    ./obj/debug/RFCC26X2_multiMode.o     
     NOROM_RFCSynthPowerDown    ./obj/debug/RFCC26X2_multiMode.o     
     rf_patch_cpe_bt5           ./obj/debug/ti_radio_config.o        
     rf_patch_mce_iqdump        ./app/../lib/libmioty_1.0.0.a<rfDl.o>

    Basically, the BLE simple peripheral uses a dedicated and patched RFCC26X2_multiMode.c module which prevents me to add/use sub-1GHz functionality.

    1- Please advise how to merge both projects if TI developer patched some SDK common file/function within the BLE simple peripheral?

    2- Is there any reference/documentation which could help me to understand this opaque build process?

    Sincerely,

  • Hi Jo,

    I would recommend to always go with the "BLE" value when you have to choose (in terms of stack sizes etc). As for your application "hanging", RF_runCmd() is not a DMM supported API and this is likely your issue. It should mean you have not turned on "Multi-Client Mode" for Easylink, you can do this in SysConfig under the Easylink->Advanced view.

    The solution in your case is not removing the RF library, it would more likely just cause you more issues. If you really want to overwrite the library version you are better of just adding the source file to your project as the linker will choose this version of the library if possible. The missing symbols is likely due to you missing certain parts of the DriverLib in your projects which means the linker does not find these symbols to link against. Do you have a "driverlib" library added in your project linker settings? 

    As your end goal seems to be Easylink + BLE using DMM I would actually recommend that you take the "dmm_wsnnode_ble_sp_app" example and simply replace the EasyLink and BLE application files in this project as it means you do not need to manually setup it all from the beginning. If you prefer to stick with merging yourself, this example should still serve as an example on how the project settings need to be setup in your case.

  • Hi,

    Thank you for your response.

    "As your end goal seems to be Easylink + BLE using DMM I would actually recommend that you take the "dmm_wsnnode_ble_sp_app" example and simply replace the EasyLink and BLE application files in this project as it means you do not need to manually setup it all from the beginning. If you prefer to stick with merging yourself, this example should still serve as an example on how the project settings need to be setup in your case."

    My initial objective is just to received BLE write request/command in order to configure the device and adds Over The Air Update.

    Basically, when the BLE is ON, Sub-1GHz is OFF.

    When the Sub-1Gh is ON, the BLE is OFF (a button pressed will start the BLE advertising and shutdown the Sub-1GHz Tx)

    So BLE and Sub-1GHz are not running concurrently but sequentially!

    "I would recommend to always go with the "BLE" value when you have to choose (in terms of stack sizes etc)."

     

    Actually I probably  narrow done the issue

    1. I kept the BLE *.cfg and adds the mailbox support required for the Sub-1Ghz application.
    2. Within the BLE simple peripheral example, I added the <RfEasyTx> source file.
    3. Each protocol runs on its own thread.
    4. For testing purpose, I don't initialize the BLE application and stack (no ICall_createRemoteTasks call)
    5. sub-1GHz can transmit without any issue!
    6. Then in the main.c, I initialized the BLE5-Stack by calling ICall_createRemoteTasks
    7. Sub-1GHz does not transmit anymore.... the system hangs on the RF_runCmd
    8. I comment ICall_createRemoteTasks
    9. sub-1GHz can transmit without any issue

    So from my basic understanding, as soon as the thread related to the BLE5-stack is initialized, I can't use the RF_runCmd API.

    1. Is there any restriction?
    2. Is the DMM interface required even if we don't plan to use both stacks simultaneously?

    Sincerely

  • Hi Jo,

    What DMM solves is easy sharing of the radio, it enables "concurrent" operation but it does not enforce it, you could still do "single stack" only of you want to. What it gives you is an additional toolbox in terms of controlling the scheduling happening in the RF Driver (and in case of DMM, in the DMM scheduler which is basically an extension to the driver). 

    DMM or not, you need to make sure to use the correct APIs for the situation, Take "RF_runCmd" as an example, this command assumes a single driver user, in the case you have where there is two driver users (Easylink and BLE) you need to use the "scheduling" versions of the commands . This is for example RF_runScheduleCmd() instead of RF_runCmd(). This is also what Easylink does when you enable the "multi-client mode", it uses the APIs that is suitable for to use when the driver is shared with someone else (you should be able to see that there is an if statement in the Easylink TX/RX functions where it uses one or the other depending on a "multiClientMode" flag..

    Flipping this checkbox would likely give you some progress and I recommend you start by doing this. 

  • Hi M-W,

    I made some progress by enabling the DMM, and editing the radio policy.

    However, how could I run an immediate command like CMD_GET_FW_INFO with the Rf_scheduler (when BLE stack is already initialized)?

    Am I doing something wrong?

        RF_open() 
    
        rfc_CMD_GET_FW_INFO_t cmdInfo;
    
        cmdInfo.commandNo = CMD_GET_FW_INFO;
    
        RF_ScheduleCmdParams sched_params;
        RF_ScheduleCmdParams_init(&sched_params);
    
        sched_params.endTime = 0;
        sched_params.allowDelay = RF_AllowDelayAny;
    
    
        RF_CmdHandle  cmdHdl = RF_scheduleCmd(handle, (RF_Op*)&cmdInfo, &sched_params, 0, 0);
    
        Rf_close()
    

    Sincerely,

  • Hi Jo,

    Have you tried the "run immediate" API?

    RF_runImmediateCmd();