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/LAUNCHXL-CC26X2R1: unresolved symbol sem_init, first referenced in <whole-program>

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSBIOS, CC2650

Tool/software: TI C/C++ Compiler

I have included 

${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/kernel/tirtos/packages/ti/sysbios/posix

${COM_TI_SIMPLELINK_CC13X2_26X2_SDK_INSTALL_DIR}/source/ti/posix/ccs

in the include options of ARM compiler.

Why is 

  • Please add more details about your issue.

    - Do you use an example and modify it? If so, which example and which modifications

    - Please include the full error message

  • Example is multirole

    Sdk version in 3.10.11

    Chipset 2652r1

    The error message I get is unresolved symbol sem_init, first referenced in <whole program>

  • Meaning that you only get one line error message when you try to compile the unmodified multirole example? 

    I assume you are using a rev E of CC2652R1 (Use SmartRF Studio or Flash Programmer 2 to check) 

  • No I have modified the example-I tried to add spi code to access an mpu sensor along with the multirole example. For the implementation of spi I need to use a semaphore, as used in the spimaster example. While adding this code I am getting this error message. Sorry I did not explain in detail the first time.
  • Since you are adding a semaphore, which header files have you included? 

  • - Could you show the delta between the original example and your code?

    - Could you post the full error message? 

  • <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    pthread_attr_init <whole-program>
    pthread_attr_setdetachstate <whole-program>
    pthread_attr_setschedparam <whole-program>
    pthread_attr_setstacksize <whole-program>
    pthread_create <whole-program>
    sem_init <whole-program>
    sem_wait <whole-program>

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out" not built

    >> Compilation failure
    makefile:186: recipe for target 'multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out' failed
    gmake[1]: *** [multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out] Error 1
    makefile:182: recipe for target 'all' failed
    gmake: *** [all] Error 2

    This is the error message i get.

    The only difference in code is that i added a pthread and semaphore as in the spimaster example.

  • If you need to add a spi into the project, I would recommend you to take a look at this example and replace the UART with SPI.

    https://github.com/ti-simplelink/ble_examples/tree/simplelink_cc13x2_26x2_sdk-2.40/examples/rtos/CC26X2R1_LAUNCHXL/ble5apps/simple_serial_socket_server

  • I am not able to build this project, when extracting the project- it shows some error

  • Please attach the error log and make sure you have downloaded the corresponding SDK(simplelink_cc13x2_26x2_sdk-2.40). 

    You can take a look at the this post regarding how to post the build error information to e2e so we can better assist you.

    https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/770557

    10: I’m still getting build errors of some kind.

    A: Please use the E2E "Insert Code, Attach Files and more" option and attach your IAR or CCS build log (paperclip icon). Note that for IAR, you must enable the build log: Tools -> Options -> Messages -> Log build messages to file. Please compress the file as needed. Attaching the build file, and not just the snippet showing the error, is critical to determine the build environment and other factors needed to diagnose your build error.


  • **** Build of configuration Debug for project multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs ****

    "C:\\ti\\ccs901\\ccs\\utils\\bin\\gmake" -k -j 4 all -O

    making ../src/sysbios/rom_sysbios.aem4f ...
    gmake[1]: Nothing to be done for 'all'.
    making ../src/sysbios/rom_sysbios.aem4f ...
    gmake[2]: Nothing to be done for 'all'.
    Building target: "multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out"
    Invoking: ARM Linker
    "C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" --cmd_file="C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/examples/rtos/CC26X2R1_LAUNCHXL/ble5stack/multi_role/Tools/Defines/multi_role_app.opt" --cmd_file="C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/ble5stack/config/build_components.opt" --cmd_file="C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/ble5stack/config/factory_config.opt" --cmd_file="C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/examples/rtos/CC26X2R1_LAUNCHXL/ble5stack/multi_role/build_config.opt" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -O4 --opt_for_speed=0 --define=DeviceFamily_CC26X2 -g --c99 --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.map" -i"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/kernel/tirtos/packages" -i"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source" -i"C:/ti/ccs901/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/lib" --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="multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs_linkInfo.xml" --rom_model -o "multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out" "./Application/board_key.obj" "./Application/multi_role.obj" "./Application/multi_role_menu.obj" "./Application/two_btn_menu.obj" "./Application/util.obj" "./Drivers/NV/crc.obj" "./Drivers/NV/nvoctp.obj" "./Profiles/devinfoservice.obj" "./Profiles/gatt_uuid.obj" "./Profiles/gattservapp_util.obj" "./Profiles/simple_gatt_profile.obj" "./Startup/ble_user_config_stack.obj" "./Startup/board.obj" "./Startup/ccfg_app_ble.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" "../CC26X2R1_LAUNCHXL_TIRTOS.cmd" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/ble5stack/libraries/cc26x2r1/OneLib.a" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/ble5stack/libraries/cc26x2r1/StackWrapper.a" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/ble5stack/libraries/cc26x2r1/ble_r2.symbols" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/display/lib/display.aem4f" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/grlib/lib/ccs/m4f/grlib.a" -l"configPkg/linker.cmd" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/drivers/rf/lib/rf_multiMode_cc26x2.aem4f" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/devices/cc13x2_cc26x2/driverlib/bin/ccs/driverlib.lib" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/source/ti/drivers/lib/drivers_cc26x2.aem4f" -l"C:/ti/simplelink_cc13x2_26x2_sdk_3_10_01_11/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
    --------- ----------------
    pthread_attr_init <whole-program>
    pthread_attr_setdetachstate <whole-program>
    pthread_attr_setschedparam <whole-program>
    pthread_attr_setstacksize <whole-program>
    pthread_create <whole-program>
    sem_init <whole-program>
    sem_wait <whole-program>

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out" not built

    >> Compilation failure
    makefile:186: recipe for target 'multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out' failed
    gmake[1]: *** [multi_role_app_CC26X2R1_LAUNCHXL_tirtos_ccs.out] Error 1
    makefile:182: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

  • Hi, 

    Sorry for not being clear, I was asking for the build log for out of box github example which I refer you to take a look at for implementing serial communication on the BLE examples.

    In the standard BLE examples, we are not using semaphore but event instead.

    Please take a look at the example I attached in my previous comment and change it to SPI.

  • Hi,

    Are you able to follow up my suggestion? 

    If not, can you provide a reason?