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.

LPSTK-CC1352R: Port AoA example rtls_slave to LPSTK-CC1352R [Updated for SDK 5.20]

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

Hi,

This thread explains how to run the rtls_slave project on a LPSTK_CC1352R. Similar steps could be used to port almost all the projects from LAUNCHXL-CC26X2R1 to LPSTK_CC1352R.

Prepare the files

  1. In your SDK, copy-paste the folder <SDK>\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\rtls_slave to <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_slave
  2. In the file <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_slave\Tools\Defines\rtls_slave_app.opt, replace "-DDeviceFamily_CCCC26X2" by "-DDeviceFamily_CC13X2"
  3. In <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_slave\tirtos\ccs rename the file rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs.projectspec into rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec
  4. Modify the file rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec.
    The goal is to replace all the references to CC26x2 files by references to CC13x2 files
    1. Find all the occurrences of  "CC26X2R1_LAUNCHXL", replace by "CC1352R1_LAUNCHXL"
    2. Find all the occurrences of  "/cc26x2r1/", replace by "/cc13x2r1/"
    3. Find all the occurrences of  "_cc26x2.a", replace by "_cc13x2.a"
    4. Find "-DDeviceFamily_CC26X2", replace by "-DDeviceFamily_CC13X2"

Here is the diff file I get for SDK 4.40: 

rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec.diff
diff --git "a/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC26X2R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs.projectspec" "b/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC1352R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec"
index e3e4032..c004ad9 100644
--- "a/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC26X2R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs.projectspec"
+++ "b/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC1352R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec"
@@ -11,7 +11,7 @@
 
     <project
         title="rtls_slave app"
-        name="rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs"
+        name="rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs"
         configurations="Release, Debug"
         toolChain="TI"
         connection="TIXDS110_Connection.xml"
@@ -22,10 +22,10 @@
         compilerBuildOptions="
             -I${PROJECT_ROOT}
             -I${PROJECT_ROOT}/${ConfigName}
-            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC26X2R1_LAUNCHXL/ble5stack/rtls_slave/Tools/Defines/rtls_slave_app.opt
+            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC1352R1_LAUNCHXL/ble5stack/rtls_slave/Tools/Defines/rtls_slave_app.opt
             --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/config/build_components.opt
             --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/config/factory_config.opt
-            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC26X2R1_LAUNCHXL/ble5stack/rtls_slave/build_config.opt
+            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC1352R1_LAUNCHXL/ble5stack/rtls_slave/build_config.opt
             -I${PROJECT_LOC}/Application
             -I${PROJECT_LOC}/RTLSCtrl
             -I${PROJECT_LOC}/Drivers/AOA
@@ -43,7 +43,7 @@
             --gen_func_subsections=on
             --display_error_number
             --diag_wrap=off
-            -DDeviceFamily_CC26X2
+            -DDeviceFamily_CC13X2
             -DFLASH_ROM_BUILD
             -DNVOCMP_NWSAMEITEM=1
             -I${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source
@@ -76,9 +76,9 @@
         linkerBuildOptions="
             -x
             --define=FLASH_ROM_BUILD=2
-            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc26x2r1/OneLib.a
-            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc26x2r1/StackWrapper.a
-            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc26x2r1/ble_r2.symbols
+            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc13x2r1/OneLib.a
+            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc13x2r1/StackWrapper.a
+            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc13x2r1/ble_r2.symbols
             --diag_suppress=16002-D
             --diag_suppress=10247-D
             --diag_suppress=10325-D
@@ -87,11 +87,11 @@
             -i${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source
             -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/display/lib/ccs/m4f/display.a
             -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/grlib/lib/ccs/m4f/grlib.a
-            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/rf/lib/rf_multiMode_cc26x2.aem4f
+            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/rf/lib/rf_multiMode_cc13x2.aem4f
             -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib
-            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/lib/ccs/m4f/drivers_cc26x2.a
+            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/lib/ccs/m4f/drivers_cc13x2.a
             -i${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/kernel/tirtos/packages
-            -lti/dpl/lib/ccs/m4f/dpl_cc26x2.a
+            -lti/dpl/lib/ccs/m4f/dpl_cc13x2.a
             -i${PROJECT_BUILD_DIR}/syscfg
             -lti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib
             --warn_sections
@@ -222,7 +222,7 @@
         </file>
         <file path="../../Startup/main.c" openOnCreation="false" excludeFromBuild="false" action="copy" targetDirectory="Startup">
         </file>
-        <file path="${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/boards/CC26X2R1_LAUNCHXL/Board.html" openOnCreation="false" excludeFromBuild="false" action="link">
+        <file path="${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/boards/LPSTK_CC1352R/Board.html" openOnCreation="false" excludeFromBuild="false" action="link">
         </file>
         <file path="../../tirtos/ccs/cc13x2_cc26x2_app.cmd" openOnCreation="false" excludeFromBuild="false" action="copy">
         </file>

Import the project

  1. Open CCS (the technique described here won't directly work for IAR)
  2. Import the rtls_slave project from  <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_slave
  3. Open the file rtls_slave.syscfg (using SysConfig)
  4. In SysConfig, open the "device view".
  5. Click on the button "Switch (BETA)". A new window will appear. Select the board you are using (LPSTK-CC1352R Sensors).
  6. Confirm your choice and let SysConfig running.
  7. Review the eventual errors raised by SysConfig.
  8. Here the error is due to an error in the device selection (here again it should be "LPSTK-CC1352R1"). Modify this!
  9. When all the errors are cleared, save and close the file.
  10. Build the project. The project should build without any warning or error.
  11. Now, connect your LPSTK-CC1352R and flash the device. More guidance on the way to do this is provided here.

I hope this will help,

  • Clément,

    Thanks for posting this. It will prove useful for developers.

    Regards,

    Rafael

  • Hi,

    Her is an update for SDK 5.20. The rtls_slave example has been renamed into rtls_responder and an extra step is required for this SDK version.

    Prepare the files

    1. In your SDK, copy-paste the folder <SDK>\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\rtls_responder to <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_responder
    2. In the file <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_responder\Tools\Defines\rtls_responder_app.opt, replace "-DDeviceFamily_CCCC26X2" by "-DDeviceFamily_CC13X2"
    3. In <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_responder\tirtos\ccs rename the file rtls_responder_CC26X2R1_LAUNCHXL_tirtos_ccs.projectspec into rtls_responder_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec
    4. Modify the file rtls_responder_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec.
      The goal is to replace all the references to CC26x2 files by references to CC13x2 files
      1. Find all the occurrences of  "CC26X2R1_LAUNCHXL", replace by "CC1352R1_LAUNCHXL"
      2. Find all the occurrences of  "/cc26x2r1/", replace by "/cc13x2r1/"
      3. Find all the occurrences of  "_cc26x2.a", replace by "_cc13x2.a"
      4. Find "-DDeviceFamily_CC26X2", replace by "-DDeviceFamily_CC13X2"

    Here is the diff file I get for SDK 4.40: 

    rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec.diff
    diff --git "a/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC26X2R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs.projectspec" "b/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC1352R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec"
    index e3e4032..c004ad9 100644
    --- "a/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC26X2R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs.projectspec"
    +++ "b/C:\\ti\\simplelink_cc13x2_26x2_sdk_4_40_00_44\\examples\\rtos\\CC1352R1_LAUNCHXL\\ble5stack\\rtls_slave\\tirtos\\ccs\\rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs.projectspec"
    @@ -11,7 +11,7 @@
     
         <project
             title="rtls_slave app"
    -        name="rtls_slave_CC26X2R1_LAUNCHXL_tirtos_ccs"
    +        name="rtls_slave_CC1352R1_LAUNCHXL_tirtos_ccs"
             configurations="Release, Debug"
             toolChain="TI"
             connection="TIXDS110_Connection.xml"
    @@ -22,10 +22,10 @@
             compilerBuildOptions="
                 -I${PROJECT_ROOT}
                 -I${PROJECT_ROOT}/${ConfigName}
    -            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC26X2R1_LAUNCHXL/ble5stack/rtls_slave/Tools/Defines/rtls_slave_app.opt
    +            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC1352R1_LAUNCHXL/ble5stack/rtls_slave/Tools/Defines/rtls_slave_app.opt
                 --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/config/build_components.opt
                 --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/config/factory_config.opt
    -            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC26X2R1_LAUNCHXL/ble5stack/rtls_slave/build_config.opt
    +            --cmd_file=${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/examples/rtos/CC1352R1_LAUNCHXL/ble5stack/rtls_slave/build_config.opt
                 -I${PROJECT_LOC}/Application
                 -I${PROJECT_LOC}/RTLSCtrl
                 -I${PROJECT_LOC}/Drivers/AOA
    @@ -43,7 +43,7 @@
                 --gen_func_subsections=on
                 --display_error_number
                 --diag_wrap=off
    -            -DDeviceFamily_CC26X2
    +            -DDeviceFamily_CC13X2
                 -DFLASH_ROM_BUILD
                 -DNVOCMP_NWSAMEITEM=1
                 -I${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source
    @@ -76,9 +76,9 @@
             linkerBuildOptions="
                 -x
                 --define=FLASH_ROM_BUILD=2
    -            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc26x2r1/OneLib.a
    -            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc26x2r1/StackWrapper.a
    -            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc26x2r1/ble_r2.symbols
    +            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc13x2r1/OneLib.a
    +            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc13x2r1/StackWrapper.a
    +            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/ble5stack/libraries/cc13x2r1/ble_r2.symbols
                 --diag_suppress=16002-D
                 --diag_suppress=10247-D
                 --diag_suppress=10325-D
    @@ -87,11 +87,11 @@
                 -i${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source
                 -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/display/lib/ccs/m4f/display.a
                 -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/grlib/lib/ccs/m4f/grlib.a
    -            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/rf/lib/rf_multiMode_cc26x2.aem4f
    +            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/rf/lib/rf_multiMode_cc13x2.aem4f
                 -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib
    -            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/lib/ccs/m4f/drivers_cc26x2.a
    +            -l${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/drivers/lib/ccs/m4f/drivers_cc13x2.a
                 -i${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/kernel/tirtos/packages
    -            -lti/dpl/lib/ccs/m4f/dpl_cc26x2.a
    +            -lti/dpl/lib/ccs/m4f/dpl_cc13x2.a
                 -i${PROJECT_BUILD_DIR}/syscfg
                 -lti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib
                 --warn_sections
    @@ -222,7 +222,7 @@
             </file>
             <file path="../../Startup/main.c" openOnCreation="false" excludeFromBuild="false" action="copy" targetDirectory="Startup">
             </file>
    -        <file path="${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/boards/CC26X2R1_LAUNCHXL/Board.html" openOnCreation="false" excludeFromBuild="false" action="link">
    +        <file path="${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/boards/LPSTK_CC1352R/Board.html" openOnCreation="false" excludeFromBuild="false" action="link">
             </file>
             <file path="../../tirtos/ccs/cc13x2_cc26x2_app.cmd" openOnCreation="false" excludeFromBuild="false" action="copy">
             </file>
    

    Import the project

    1. Open CCS (the technique described here won't directly work for IAR)
    2. Import the rtls_responder project from  <SDK>\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\rtls_responder. Select the project using CCS compiler (the version for TI CLANG has not been modified, hence will not work).
    3. Open the file rtls_responder.syscfg (using SysConfig)
    4. In SysConfig, open the "device view".
    5. Click on the button "Switch (BETA)". A new window will appear. Select the board you are using (LPSTK-CC1352R Sensors).
    6. Confirm your choice and let SysConfig running.
    7. Review the eventual errors raised by SysConfig.
    8. Here the error is due to an error in the device selection (here again it should be "LPSTK-CC1352R1"). Modify this!
    9. When all the errors are cleared, save and close the file.
    10. Right click on the project > Show Build Settings. In the pre-defined symbols, remove "DeviceFamily_CC26X2". This symbols does not need to be replaced.
    11. Build the project. The project should build without any warning or error.
    12. Now, connect your LPSTK-CC1352R and flash the device. More guidance on the way to do this is provided here.

    I hope this will help,