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.

CCS/LAUNCHXL-CC2640R2: Unable to Compile Project_Zero due to unresolved symbol sleep

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: SYSBIOS, CC2640

Tool/software: Code Composer Studio

Hi,

I am trying to compile Project_Zero by making some modifications to it i.e.: like adding functions as sleep to test the standby mode functionality. However, I am getting the error below. I tried to solve it by including path to posix library, but the error still keeps appearing. Kindly suggest a solution.

Description Resource Path Location Type
#10010 null: errors encountered during linking; "project_zero_cc2640r2lp_app.out" not built project_zero_cc2640r2lp_app C/C++ Problem
<a href="processors.wiki.ti.com/.../10234"> null: unresolved symbols remain project_zero_cc2640r2lp_app C/C++ Problem
gmake: *** [all] Error 2 project_zero_cc2640r2lp_app C/C++ Problem
gmake[1]: *** [project_zero_cc2640r2lp_app.out] Error 1 project_zero_cc2640r2lp_app C/C++ Problem
unresolved symbol sleep, first referenced in <whole-program> project_zero_cc2640r2lp_app C/C++ Problem

Best Regards,
--Zain Kabir

  • Hi Zain,

    Can you inform me of the steps you took to include POSIX? Also can you inform me of the modifications you made such as direct POSIX calls etc.

    Also please explain what you mean by adding sleep. Typically TI-RTOS automatically handles whether to allow the device to sleep or not.
  • Zain,

    You may want to check these steps for adding posix to your project:
    e2e.ti.com/.../2543887

    There is more to it than including the POSIX include path as POSIX needs to be built and referenced within the .cfg kernel of TIRTOS.
  • Hello Evan, I went to the include option and added path to C:/ti/...../ti/sysbios/posix.

    Here is what I have done I am trying to merge Project Zero and Standby Examples. So I have merged main() code and example code of both examples respectively. But I keep getting the error (unresolved symbol sleep, first referenced in <whole-program>).

    If it helps I can paste the error details below. Kinldy suggest a solution.

    #10010 null: errors encountered during linking; "project_zero_cc2640r2lp_app.out" not built
    <a href="processors.wiki.ti.com/.../10234"> null: unresolved symbols remain
    gmake: *** [all] Error 2
    gmake[1]: *** [project_zero_cc2640r2lp_app.out] Error 1
    unresolved symbol sleep, first referenced in <whole-program>


    --Zain
  • Zain,

    Can you inform me of the following?

    1) What specific example in the sdk are you referring to when you say "Standby Examples"

    2) Can you provide me the code that you have now in your main.c?

    3) If you are using POSIX pthread calls, did you adjust the .cfg file in the TOOLS folder?
  • Hey Evan,

    1) I am just using the standby code for CC2640 provided as an example. Sorry for writing "standyby examples" and creating a confusion.

    2) I have attached the main.c code below, which is effectively just a merger of project_zero & standby example's main.c()

    3) Not sure about this. Can you please provide the steps necessary to do that?

    /******************************************************************************
    
     @file  main.c
    
     @brief main entry of the BLE stack sample application.
    
     Group: CMCU, SCS
     Target Device: CC2640R2
    
     ******************************************************************************
    
     Copyright (c) 2013-2017, Texas Instruments Incorporated
     All rights reserved.
    
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
    
     *  Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
    
     *  Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
    
     *  Neither the name of Texas Instruments Incorporated nor the names of
        its contributors may be used to endorse or promote products derived
        from this software without specific prior written permission.
    
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
     ******************************************************************************
     Release Name: simplelink_cc2640r2_sdk_1_30_00_08_eng
     Release Date: 2017-02-10 20:58:47
     *****************************************************************************/
    
    /*******************************************************************************
     * INCLUDES
     */
    #include <stdint.h>
    #include <xdc/runtime/Error.h>
    #include <pthread.h>
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    #include <ti/sysbios/family/arm/m3/Hwi.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Clock.h>
    #include <ti/display/Display.h>
    
    #include <icall.h>
    #include "hal_assert.h"
    #include "bcomdef.h"
    #include "peripheral.h"
    #include "project_zero.h"
    #include "Board.h"
    
    #include <ti/drivers/UART.h>
    #include <UartLog.h>
    
    #ifndef USE_DEFAULT_USER_CFG
    // BLE user defined configuration
    #  include "ble_user_config.h"
    #  ifdef ICALL_JT
    icall_userCfg_t user0Cfg = BLE_USER_CFG;
    #  else  /* ! ICALL_JT */
    bleUserCfg_t user0Cfg = BLE_USER_CFG;
    #  endif /* ICALL_JT */
    #endif // USE_DEFAULT_USER_CFG
    
    
    /*******************************************************************************
     * MACROS
     */
    
    /*******************************************************************************
     * CONSTANTS
     */
    
    /*******************************************************************************
     * TYPEDEFS
     */
    
    /*******************************************************************************
     * LOCAL VARIABLES
     */
    
    /*******************************************************************************
     * GLOBAL VARIABLES
     */
    
    void execHandlerHook(Hwi_ExcContext *ctx)
    {
      for(;;);
    }
    
    /*******************************************************************************
     * EXTERNS
     */
    
    extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
    
    extern Display_Handle dispHandle;
    
    /*******************************************************************************
     * @fn          Main
     *
     * @brief       Application Main
     *
     * input parameters
     *
     * @param       None.
     *
     * output parameters
     *
     * @param       None.
     *
     * @return      None.
     */
    int main()
    {
    
         /* Register Application callback to trap asserts raised in the Stack */
      RegisterAssertCback(AssertHandler);
    
      PIN_init(BoardGpioInitTable);
    
      Board_initGeneral();
    
    #if !defined( POWER_SAVING )
      /* Set constraints for Standby, powerdown and idle mode */
      // PowerCC26XX_SB_DISALLOW may be redundant
      Power_setConstraint(PowerCC26XX_SB_DISALLOW);
      Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
    #endif // POWER_SAVING | USE_FPGA
    
    #ifdef ICALL_JT
      /* Update User Configuration of the stack */
      user0Cfg.appServiceInfo->timerTickPeriod = Clock_tickPeriod;
      user0Cfg.appServiceInfo->timerMaxMillisecond  = ICall_getMaxMSecs();
    #endif  /* ICALL_JT */
    
      /* Initialize the RTOS Log formatting and output to UART in Idle thread.
       * Note: Define xdc_runtime_Log_DISABLE_ALL to remove all impact of Log.
       * Note: NULL as Params gives 115200,8,N,1 and Blocking mode */
      UART_init();
      UartLog_init(UART_open(Board_UART0, NULL));
    
      /* Initialize ICall module */
      ICall_init();
    
      /* Start tasks of external images - Priority 5 */
      ICall_createRemoteTasks();
    
      /* Kick off profile - Priority 3 */
      GAPRole_createTask();
      Log_info0("This is from main() function");
      ProjectZero_createTask();
    
      /* enable interrupts and start SYS/BIOS */
      BIOS_start();
    
      return 0;
    }
    
    
    /*******************************************************************************
     * @fn          AssertHandler
     *
     * @brief       This is the Application's callback handler for asserts raised
     *              in the stack.  When EXT_HAL_ASSERT is defined in the Stack
     *              project this function will be called when an assert is raised,
     *              and can be used to observe or trap a violation from expected
     *              behavior.
     *
     *              As an example, for Heap allocation failures the Stack will raise
     *              HAL_ASSERT_CAUSE_OUT_OF_MEMORY as the assertCause and
     *              HAL_ASSERT_SUBCAUSE_NONE as the assertSubcause.  An application
     *              developer could trap any malloc failure on the stack by calling
     *              HAL_ASSERT_SPINLOCK under the matching case.
     *
     *              An application developer is encouraged to extend this function
     *              for use by their own application.  To do this, add hal_assert.c
     *              to your project workspace, the path to hal_assert.h (this can
     *              be found on the stack side). Asserts are raised by including
     *              hal_assert.h and using macro HAL_ASSERT(cause) to raise an
     *              assert with argument assertCause.  the assertSubcause may be
     *              optionally set by macro HAL_ASSERT_SET_SUBCAUSE(subCause) prior
     *              to asserting the cause it describes. More information is
     *              available in hal_assert.h.
     *
     * input parameters
     *
     * @param       assertCause    - Assert cause as defined in hal_assert.h.
     * @param       assertSubcause - Optional assert subcause (see hal_assert.h).
     *
     * output parameters
     *
     * @param       None.
     *
     * @return      None.
     */
    void AssertHandler(uint8 assertCause, uint8 assertSubcause)
    {
      // Open the display if the app has not already done so
      // if ( !dispHandle )
      // {
      //   dispHandle = Display_open(Display_Type_LCD, NULL);
      // }
    
      Log_error0(">>>STACK ASSERT");
    
      // check the assert cause
      switch (assertCause)
      {
        case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
          Log_error0("***ERROR***");
          Log_error0(">> OUT OF MEMORY!");
          break;
    
        case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
          // check the subcause
          if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
          {
            Log_error0("***ERROR***");
            Log_error0(">> INTERNAL FW ERROR!");
          }
          else
          {
            Log_error0("***ERROR***");
            Log_error0(">> INTERNAL ERROR!");
          }
          break;
    
        case HAL_ASSERT_CAUSE_ICALL_ABORT:
          Log_error0("***ERROR***");
          Log_error0(">> ICALL ABORT!");
          HAL_ASSERT_SPINLOCK;
          break;
    
        case HAL_ASSERT_CAUSE_ICALL_TIMEOUT:
          Log_error0("***ERROR***");
          Log_error0(">> ICALL TIMEOUT!");
          HAL_ASSERT_SPINLOCK;
          break;
    
        case HAL_ASSERT_CAUSE_WRONG_API_CALL:
          Log_error0("***ERROR***");
          Log_error0(">> WRONG API CALL!");
          HAL_ASSERT_SPINLOCK;
          break;
    
      default:
          Log_error0("***ERROR***");
          Log_error0(">> DEFAULT SPINLOCK!");
          HAL_ASSERT_SPINLOCK;
      }
    
      return;
    }
    
    
    /*******************************************************************************
     * @fn          smallErrorHook
     *
     * @brief       Error handler to be hooked into TI-RTOS.
     *
     * input parameters
     *
     * @param       eb - Pointer to Error Block.
     *
     * output parameters
     *
     * @param       None.
     *
     * @return      None.
     */
    void smallErrorHook(Error_Block *eb)
    {
      for (;;);
    }
    
    
    /*******************************************************************************
     */
    

  • Reply please..!!!!
  • Zain,

    Sorry for the delay. This week has been very full for me and I haven't had a chance to reply. My apologies and thanks for the patience.

    I addressed the POSIX stuff in this thread: e2e.ti.com/.../2543887

    Can you just share with me your project?

    Your main.c doesn't look any thing abnormal, but I'd like to see what is in your ProjectZero_createTask etc as I think there may be more in there. I'd also like to review your project/linker settings which is why grabbing a zip of your project (both app and stack projects) would be helpful. From there, I can make many more suggestions.
  • Due to inactivity, I'm going to close this post. To reopen, just reply. After 30-days of inactivity, the thread will lock.