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.

CC2652R: Linking errors for simple peripheral when using posix semaphore

Part Number: CC2652R
Other Parts Discussed in Thread: SYSCONFIG

I am using simplelink_cc13x2_26x2_sdk_4_20_00_35 on CCS 10.1.0.00010 with the simple_peripheral code example. When I try to use a POSIX semaphore from semaphore.h the code compiles correctly, however fails with the linker error:

"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/bin/armcl" --cmd_file="C:/Users/a0273777/workspace_v10/spi_expander_ble_peripheral/Debug/syscfg/ti_ble_app_config.opt" --cmd_file="C:/Users/a0273777/workspace_v10/spi_expander_ble_peripheral/Debug/syscfg/ti_build_config.opt" --cmd_file="C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/ble5stack/config/build_components.opt" --cmd_file="C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/ble5stack/config/factory_config.opt"  -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -O4 --opt_for_speed=0 --define=DeviceFamily_CC26X2 --define=FLASH_ROM_BUILD --define=NVOCMP_NWSAMEITEM=1 -g --c99 --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"spi_expander_ble_peripheral.map" -i"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/lib" --reread_libs --define=FLASH_ROM_BUILD=2 --diag_suppress=16002-D --diag_suppress=10247-D --diag_suppress=10325-D --diag_suppress=10229-D --diag_suppress=16032-D --diag_wrap=off --display_error_number --warn_sections --xml_link_info="spi_expander_ble_peripheral_linkInfo.xml" --rom_model -o "spi_expander_ble_peripheral.out" "./syscfg/ti_ble_config.obj" "./syscfg/ti_devices_config.obj" "./syscfg/ti_radio_config.obj" "./syscfg/ti_drivers_config.obj" "./Application/spi_expander.obj" "./Application/util.obj" "./Drivers/NV/crc.obj" "./Drivers/NV/nvocmp.obj" "./NPI/npi_frame_hci.obj" "./NPI/npi_rxbuf.obj" "./NPI/npi_task.obj" "./NPI/npi_tl.obj" "./NPI/npi_tl_uart.obj" "./Profiles/devinfoservice.obj" "./Profiles/gatt_uuid.obj" "./Profiles/gattservapp_util.obj" "./Profiles/spi_expander_profile.obj" "./Startup/CC26X2R1_LAUNCHXL_fxns.obj" "./Startup/ble_user_config_stack.obj" "./Startup/main.obj" "./Startup/osal_icall_ble.obj" "./Startup/rom_init.obj" "./iCall/icall.obj" "./iCall/icall_cc2650.obj" "./iCall/icall_user_config.obj" "./iCallBLE/ble_user_config.obj" "./iCallBLE/icall_api_lite.obj" "./iCallBLE/icall_hci_tl.obj" "../cc13x2_cc26x2_app.cmd" -l"configPkg/linker.cmd"  -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/ble5stack/libraries/cc26x2r1/OneLib.a" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/ble5stack/libraries/cc26x2r1/StackWrapper.a" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/ble5stack/libraries/cc26x2r1/ble_r2.symbols" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/display/lib/display.aem4f" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/grlib/lib/ccs/m4f/grlib.a" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/drivers/rf/lib/rf_multiMode_cc26x2.aem4f" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/source/ti/drivers/lib/drivers_cc26x2.aem4f" -l"C:/ti/simplelink_cc13x2_26x2_sdk_4_20_00_35/kernel/tirtos/packages/ti/dpl/lib/dpl_cc26x2.aem4f" -l"ti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib" -llibc.a 
<Linking>
 
 undefined first referenced
  symbol       in file     
 --------- ----------------
 sem_init  <whole-program> 
 sem_post  <whole-program> 
 sem_wait  <whole-program> 
 
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "spi_expander_ble_peripheral.out" not built


(I renamed my project to spi_expander_ble_peripheral)

It seems like the POSIX library isn't linked correctly in the project settings with simple_peripheral. I try searching for the library in the SDK directory to link it to- but it seems like it is hidden in some cryptic XDCTools configuration script. Is there an easy way to add POSIX support to an existing project without manually chopping up an XDCTools script? Maybe in SysConfig or in the CCS project settings?

  • Hi Timothy,

    I tried recreating this issue you are seeing and to resolve it I took the following steps:

    • Within the file you are utilizing the POSIX semaphore functions, use the following include path
    #include <semaphore.h>
    • Add the following line to simple_peripheral_app.cfg:
    /* ================ POSIX configuration ================ */
    var Settings = xdc.useModule('ti.posix.tirtos.Settings');

    I hope this helps, please let me know if there are additional issues.

    Best Regards,

    Jenny

  • Thanks! I was hoping I could do this in SysConfig or in the project settings without delving into the XDCScript, however this resolved my issue. 

  • Hi Timothy,

    No problem! At the moment I don't believe SysConfig can configure the project to use the POSIX sem functions. It seems like the only method to use TI-POSIX with TI-RTOS, at least for this example project, is to add that following line in the configuration script. However, if I discover another method such as modifying the project settings that doesn't involve modifying the config script, I will update you through this thread.

    Best Regards,
    Jenny