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/66AK2H14: errors for pthread creation and pthread attributes

Part Number: 66AK2H14
Other Parts Discussed in Thread: SYSBIOS, 66AK2H12

Tool/software: Code Composer Studio

Hi,

We are using 66AK2H14 processor and CCSV7 IDE with TI-RTOS.

I have written source code for creating a thread using pthread_create() function and varialbles of type pthread_t. I have also included pthread.h headerfile. But still when i build the source code in CCV7 tool, i get the following error

''unknown type name 'pthread_t' " and "implicit declaration of pthread_create".

So should I include any libraries or did i miss anything?

Please help me to solve this error as soon as possible.

  • You need to include the following in the .cfg file.

    var Settings = xdc.useModule('ti.sysbios.posix.Settings');

    Todd
  • Hi,

        Thanks for your reply.

       In which .cfg file I have to include those changes? Can you share the exact path where I should include the above line?

  • There should just be one .cfg file in your project. When you do a rebuild, it's the first thing that gets built.
  • Hi,

       Thanks for your reply.

    In my project I am not getting any .cfg file. For reference i have attached the screenshot of my project name called "emif_cpld.c"

    I followed the following steps while creating a new project:

    • File->New->CCS PROJECT->Target(66AK2H12)
    • Then selected CORTEX-A[ARM] and gave project name.
    • I selected the Compiler version GNU v6.3.1(Linaro) 

    Since am not geeting .cfg file as you said, I wanna know whether I have done any mistakes while creating a new project.

  • Hi Aishwarya,

    To get a .cfg file, you need to start with one of the SYS/BIOS projects.  You can import a SYS/BIOS project using the Resource Explorer in CCS (View -> Resource Explorer or Resource Explorer Classic.  I like the use the 'Classic', since it seems a bit faster).  Then rename the project to whatever you want.

    You say you are using "TI-RTOS".  Do you mean SYS/BIOS?  TI-RTOS does not support K2H, but SYS/BIOS does.  What version are you using?

    Best regards,

    Janet

  • Hi Janet,

              Thanks for your suggestion.

           I am using bios version-bios_6_46_05_55 and pdk version-pdk_k2hk_4_0_6.

    •     As you said I imported hello example program and that contains .cfg file. But when I compile that hello program I got some errors.

    • One more doubt is - How to add our own created projects to sys/bios? Please suggest me the procedure for importing our own created source code to Sys/bios.

  • Hi Aishwarya,

    I can't tell what the error is, since it is not expanded in the image you posted.  Maybe you are building with an XDC tools version that is incompatible with the BIOS version you are using.  Can you open the project properties for the hello example you are trying to build, and under "General", select the "Products" tab.  Check the XDC tools and SYS/BIOS versions and post them here.

    Best regards,

    Janet

  • Hi Janet,

       Thanks for your reply.

       As you said XDCTools version and SYS/BIOS Version which i am using is  not compatible for CCSV7.2.0 . So I have downloaded Standalone sys/bios version 6.52.00.12 and XDCTools -XDCTools 3.50.00.10. But i am not getting how to add these newly downloaded tools to my project. I have saved these downloaded tools inside ti folder. When i tried to add downloaded files, in XDCTools list, 3.50.00.10 version xdctool was not coming in drop down menu under XDC TOOLS and in SYS/BIOS checkbox also 6.52.00.12 version sysbios was not there in the list . So i request you to tell the steps to add those tools to my project.

  • Hi Aishwarya,
    Did you restart CCS after you installed the new products? You will not see them listed in the products lists before you restart CCS.
    Best regards,
    Janet
  • Hi Janet,

    Yes I restarted. I got downloaded xdc tool version in the list. But I am not getting downloaded sysbios  products in the list.

    Newly installed sys/bios version is 6.52.00.12.

    I have also posted explanded error list which I got while compiling imported hello project.

    • Then while selecting the platform which platform we have to select.?

  • Hi Janet,
    I have one more doubt

    • How to add our own created projects to sys/bios? Please suggest me the procedure for importing our own created source code to Sys/bios.

  • Hi Aishwarya,

    When you restart CCS, you should see a dialog window that shows newly installed products with check boxes that you can check to install.  So I'm surprised you didn't see your new BIOS version show up when you restarted CCS.  Can you check your CCS preferences (Window -> Preferences -> Code Composer Studio -> Products) and make sure you search for new products each time CCS starts up?  You should have something similar to this:

    Best regards,

    Janet

  • Hi Aishwarya,

    I'm not sure what you mean by adding your project to SYS/BIOS.  You cannot add to SYS/BIOS.  Did you mean add SYS/BIOS to your project?  If so, you can add SYS/BIOS and XDC tools to your project (which I think you have done already).  Then copy one of the SYS/BIOS example .cfg files to your project (e.g., hello.cfg).  You may still need to the BIOS package repository to your project:

    You can look at any by example properties, and copy to your project.  You can try this out first using the Empty Project (with main.c) (Project -> New CCS Project), and make sure that builds and runs, before trying this out on your own project.

    Best regards,

    Janet

  • Hi,

    Thanks for you reply.

    Yeah while i was restarting ccs it was not asking for sys/bios new version to installed. Later I installed it through CCS preferences (Window -> Preferences -> Code Composer Studio -> Products).

    Thanks a lot for your suggestion.

  • Hi,

    Thanks for your reply.

    As you said I tried with empty project by adding sysbios and xdctools to this project, But when I compiled i got following errors.

    Since those errors are from makefile , I am not getting how to solve those errors. So I request you to help me for solving these errors as soon as possible.

    ara15fg arm_IntrinsicsSupport_asm_gnu.o arm_TaskSupport_asm_gnu.o gic_Hwi_asm_gnu.o exc_Exception_asm_gnu.o a15_Cache_asm_gnu.o a15_Mmu_asm_gnu.o a15_TimestampProvider_asm_gnu.o systimer_Timer_asm_gnu.o _BIOS.o arm_IntrinsicsSupport.o arm_TaskSupport.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o hal_Cache.o hal_Core.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o heaps_HeapMem.o gates_GateHwi.o gates_GateMutex.o gic_Hwi.o exc_Exception.o gnu_ReentSupport.o a15_Core.o a15_Cache.o a15_Mmu.o a15_TimestampProvider.o systimer_Timer.o ...
    gmake[1]: Leaving directory `C:/Aishwarya/EMENI/workspace_v7/empty_project/src/sysbios'
    Build of libraries done.
    cla15fg package/cfg/empty_project_pa15fg.c ...
    'Finished building: ../empty_project.cfg'
    ' '
    gmake[1]: Leaving directory 'C:/Aishwarya/EMENI/workspace_v7/empty_project/Debug'
    'Building file: ../main.c'
    'Invoking: GNU Compiler'
    "C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -I"C:/Aishwarya/EMENI/workspace_v7/empty_project" -I"C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"main.d" -MT"main.o" -o"main.o" @"configPkg/compiler.opt" "../main.c"
    'Finished building: ../main.c'
    ' '
    'Building target: empty_project.out'
    'Invoking: GNU Linker'
    "C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a15 -marm -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mfloat-abi=hard -Wl,-Map,"empty_project.map" -o"empty_project.out" "./main.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lc -Wl,--end-group
    makefile:142: recipe for target 'empty_project.out' failed
    C:\ti\bios_6_46_05_55\packages\gnu\targets\arm\rtsv7A\lib\boot.aa15fg(startup.oa15fg): In function `_fini':
    /db/ztree/library/trees/xdctargets/xdctargets-l07/src/gnu/targets/arm/rtsv7A/startup.c:98: multiple definition of `_fini'
    c:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/hard/crti.o:(.fini+0x0): first defined here
    C:\ti\bios_6_46_05_55\packages\gnu\targets\arm\rtsv7A\lib\boot.aa15fg(startup.oa15fg): In function `gnu_targets_arm_rtsv7A_startupC':
    /db/ztree/library/trees/xdctargets/xdctargets-l07/src/gnu/targets/arm/rtsv7A/startup.c:52: multiple definition of `__dso_handle'
    c:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/hard/crtbegin.o:(.data+0x0): first defined here
    C:\Aishwarya\EMENI\workspace_v7\empty_project\src\sysbios\sysbios.aa15fg(gnu_ReentSupport.o): In function `ti_sysbios_rts_gnu_ReentSupport_Module_startup__E':
    C:/ti/bios_6_46_05_55/packages/ti/sysbios/rts/gnu/ReentSupport.c:83: undefined reference to `ti_sysbios_rts_gnu_ReentSupport_checkIfCorrectLibrary'
    collect2.exe: error: ld returned 1 exit status
    gmake[1]: *** [empty_project.out] Error 1
    gmake: *** [all] Error 2
    makefile:138: recipe for target 'all' failed

    **** Build Finished ****"

     

     

     


  • Hi Aishwarya,

    I dug into the code in ti/sysbios/rts/gnu/ReentSupport.c, and according to a comment there, it looks like you are linking with the wrong gcc library.  Here is the comment:

        /*
         * Make a call to a special stub function in the Newlib BSP library.
         * If the application is not linking with the correct BSP library
         * (i.e. it is not linking with the Newlib BSP library shipped
         * with SYS/BIOS), the function symbol will not be found and the
         * link will fail, thereby indicating to the user that the wrong
         * library was being linked with the application. (see FAQ section of
         * processors.wiki.ti.com/.../BIOS_with_GCC_(CortexA)
         * wiki page for more info).
         */
        if (ReentSupport_enableReentSupport) {
            ti_sysbios_rts_gnu_ReentSupport_checkIfCorrectLibrary();
        }

    You can edit the project linker options, and under libraries, add the SYS/BIOS NewLib library.  Here is a screen shot of my linker libraries (which I copied from a BIOS hello K2G example):

    Other things I had to modify to get my project to build:

    GNU Compiler -> Runtime -> Specify if floating point hardware should be used: hard

    GNU Linker -> Miscellaneous: --specs=nano.specs

    Add BIOS newlib to the GNU Compiler -> Directories.  Here is a screen shot:

    I eventually got my project to build.  In retrospect, it may be easier to start with a BIOS project, and replace the .c file with your project's source code.

    Best regards,

    Janet

  • Hi Janet,

    Thanks for your reply.

    You said to add new library rite?("add the SYS/BIOS NewLib library") But I did not get which library I have to add.

    I have added C:\ti\bios_6_52_00_12\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\lib\hard. But I am not sure that we have to add only that. For reference I have attached the screenshot of libraries present in my empty_project.

    And also you mentioned "Here is a screen shot of my linker libraries (which I copied from a BIOS hello K2G example", how did you copy library from K2G example. So that I can refer my hello example for K2H12.

    Then in my empty project under libraries section, I have already BIOS_LIBRARIES and BIOS_LIBRARY_PATH as you shown in the screenshot.

    So I am confused about whether I have to add any extra libraries path, if so which library I have to add and from where I have to add.?

    Please help me to solve this doubt as soon as possible.

  • Hi Aishwarya,

    I copied the project options by clicking on the option in the SYS/BIOS hello example, selecting the 'edit' button, then control-C to copy.  Then I opened the empty A15 example, and added the option with the "Add option" button, and pasting the option from the hello example.  Here is a screen shot from the BIOS hello example:

    You could also start with the BIOS hello example for K2H, and replace hello.c with your own source code.  That may be easier then trying to copy all the hello project options to your empty example.

    Best regards,

    Janet

  • Hi,

    Thanks for your reply.

    I have tried the same method what you have told earlier.Still I am getting the same errors. For reference I have attached screenshots.

    And one more thing is : My hello program was building successfully at the beginning, But now even in  hello program I am getting same makefile errors. Seriously I am not getting what is happening. Please help me to resolve these errors as soon as possible.

  • Hi Aishwarya,

    I'm attaching my hello project for K2H A15, that successfully built.  It looks like you added some C66 libraries to your project.  I thought you were building for A15.

    hello_66AK2H12_CortexA.zip.txt

    Best regards,

    Janet

  • Hi Janet,
    Thanks a lot for your reply.
    But I wasn't building for C66 , I was building for A15 only. Still i was getting errors.
    So later i reinstalled again and tried, now it is working without any errors.
    So thanks a lot for you support till now.