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.

Moving/MODIFYING SYSBIOS files INTO PROJECT

Other Parts Discussed in Thread: SYSBIOS, TMS320F28335

I have a need to modify boot.s28. I made a copy and moved it to the src directory of the project modified and rebuilt it.

My changes are not in executeable and the build process didnt catch the changes leading me to suspect a precedence issue in my build settings.

 

what needs to be changed to allow the src directory to be looked in first for this file and I would like to eventually move all SYSBIOS .c files into my project directory as well

 

 

 

  • here are my build settings from the XDC tab

     

    --xdcpath="C:/ti/bios_6_33_05_46/packages;C:/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.C28_float -p ti.platforms.tms320x28:TMS320F28335 -r release -c "C:/ti/ccsv5/tools/compiler/c2000_6.1.0" --compileOptions "-g --optimize_with_debug"

     

    XDCPATH is not set in Windows in the Systems variables

    XDCROOT is set  in Windows in the Systems variables to

    C:/Program Files (x86)/Texas Instruments/xdctools_3_20_03_63

    Hardcoding a system variable to add searching  build source dir like C:\28335_Experimenter_kit\task\src  before s probally not a good approach for

     

    I tried adding C:\28335_Experimenter_kit\task\src;C:/Program Files (x86)/Texas Instruments/xdctools_3_20_03_63 to XDCROOT that did NOT work

     

  • Hello Mark,

    I am going to move this thread to the BIOS forum to see if they have some advice for you.

    Links to this post will continue to work after the move.

    Regards

    Lori

  • Mark,
    have you added your copy of bios.s28 to the project? You do that by right-click on Project->Add Files... and then select boot.s28 and copy it or link it to the project. If the extension is not recognized as an assembly file, you may need to go to Windows->Preferences->C/C++->File Types, and add *.s28 as a pattern for assembly files. Then, when you build a project you should see a command line in the console window when boot.s28 is assembled.
    Adding that file to a project should also take care of a precedence of that file over any other version of boot.s28 that could exist in the linked libraries.

  • Yes and I modified the start.s to halt by modifying it. I placed a copy in the project as you suggested. it  builds OK but when I run in the debugger after  unchecking run to main the default file from the boot package is run without my changes in it. its like the sysbios boot package has precedence. I experimented with XDC_PATH,XDC_ROOT in enviroment to no avail.

     

    If what you suggested is possible can I take it one step further and pull all the c files that are built to form BIOS.lib  local to my project(ie sysbios source code)??? we may want to make it obvious to v&V what code exactly is being used in the system so they can test it.

     If so I am guessing they would have to use the ti c source code in the sysbios package  as template of what code is placed into the library BIOS.lib and to test it(call the library) using an externed function interface with the appropriate name mangling. I am asking if this is possible

     

    for example

    from the xdc generated code in main_238f.c I see below

    xdc_Ptr ti_sysbios_knl_Queue_Object__next__S( xdc_Ptr obj )
    {
        xdc_runtime_Types_InstHdr *iHdr = ((xdc_runtime_Types_InstHdr *)obj) - 1;

        if (iHdr->link.next != (xdc_runtime_Types_Link *)&ti_sysbios_knl_Queue_Module__root__V.link) {
            return (xdc_runtime_Types_InstHdr *)(iHdr->link.next) + 1;
        }
        else {
            return NULL;
        }
    }

     How can I call the kernel sysbios_knl_Queue_Object  SYSBIOS API to functional test or LINE code coverage test  SYSBIOS?

  • mark lazarewicz1 said:

    Yes and I modified the start.s to halt by modifying it. I placed a copy in the project as you suggested. it  builds OK but when I run in the debugger after  unchecking run to main the default file from the boot package is run without my changes in it. its like the sysbios boot package has precedence. I experimented with XDC_PATH,XDC_ROOT in enviroment to no avail.

     

    Can you post the complete console window output? I would like to see the order of the files on the linker command line and the flags passed to the linker. If your boot object file is first on the command line, I would expect that it's _c_int00 symbol would be used as the entry point. You can always try renaming _c_int00 in your version of boot.obj to something else, _c_int99 for example and then pass --entry_point=_c_int99 on the linker command line. That could work around any ordering problems.

    mark lazarewicz1 said:

    If what you suggested is possible can I take it one step further and pull all the c files that are built to form BIOS.lib  local to my project(ie sysbios source code)??? we may want to make it obvious to v&V what code exactly is being used in the system so they can test it.

     If so I am guessing they would have to use the ti c source code in the sysbios package  as template of what code is placed into the library BIOS.lib and to test it(call the library) using an externed function interface with the appropriate name mangling. I am asking if this is possible

     

    SYS/BIOS has a parameter that allows you to copy SYS/BIOS sources to your project and then compile them. These files get removed when you clean, but nothing stops you from copying these files to some other location. Look into SYS/BIOS User Guide (SPRUEX3), Section 2.3.5 Compiler and Linker Optimization. There is a couple of paragraph on custom SYS/BIOS build. If you use that option, you can inspect these sources and there won't be any other SYS/BIOS libraries linked into your app.
    Now, I am not sure I understand your testing setup. Are you planning to create a CCS project and then call each SYS/BIOS function that you find in SYS/BIOS sources? I think it is possible.
    The last part of your question is about the generated C file. That file is generated by XDCtools, and it is not a part of SYS/BIOS libraries. But, you can call these functions too. You wouldn't call them directly, you would use API defined here:
    http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/IModule.html#xdoc-sect-3

    For example, to exercise the code you copied, you would call ti_sysbios_knl_Queue_next(obj). Not all modules would have all functions listed in the linked page, but since you are already inspecting the generated C file, you can find which functions are generated for which module. The name mangling should be easy to figure out. For each function defined in the linked page, there is one function in the generated C file, Queue_next->Queue_Object__next__S, etc.

  • First question reply:

     

     for CCS5 the boot.s28 shows up automatically in the project when droppped into the project dir it appears to not compile after being modified

    so we moved it to another directory and used the add files options same results it doesnt assemble the file I had another engineer verify this as well

    The modified file with today date


    02/20/2013  02:40 PM            13,286 boot.asm
    02/15/2013  09:55 AM            28,744 DeviceInit.c
    02/15/2013  10:01 AM            17,018 DSP2833x_SysCtrl.c

    I retried it today and it found the file and  assembled it when I changed its name to boot.asm from boot.s28 but know its multiplicated errors

    **** Build of configuration Debug for project main ****

    C:\ti\ccsv5\utils\bin\gmake -k all
    making ../src/sysbios/sysbios.lib ...
    cl28FP C:/ti/bios_6_33_05_46/packages/ti/sysbios/BIOS.c ...
    asm28FP C:/ti/bios_6_33_05_46/packages/ti/sysbios/family/c28/Clobber_asm.s28 ...
    asm28FP C:/ti/bios_6_33_05_46/packages/ti/sysbios/family/c28/Hwi_asm.s28 ...
    asm28FP C:/ti/bios_6_33_05_46/packages/ti/sysbios/family/c28/Hwi_disp.s28 ...
    asm28FP C:/ti/bios_6_33_05_46/packages/ti/sysbios/family/c28/IntrinsicsSupport_asm.s28 ...
    asm28FP C:/ti/bios_6_33_05_46/packages/ti/sysbios/family/c28/TaskSupport_asm.s28 ...
    ar28FP BIOS.obj c28_Clobber_asm.obj c28_Hwi_asm.obj c28_Hwi_disp.obj c28_IntrinsicsSupport_asm.obj c28_TaskSupport_asm.obj ...
    'Building file: ../main.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_23_03_53/xs" --xdcpath="C:/ti/bios_6_33_05_46/packages;C:/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.C28_float -p ti.platforms.tms320x28:TMS320F28335 -r release -c "C:/ti/ccsv5/tools/compiler/c2000_6.1.0" --compileOptions "-g --optimize_with_debug" "../main.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring main.x28FP from package/cfg/main_p28FP.cfg ...
    generating custom ti.sysbios library makefile ...
    Starting build of library sources ...
    making C:/Monitor_Iteration1/main/src/sysbios/sysbios.lib ...
    Build of libraries done.
    cl28FP package/cfg/main_p28FP.c ...
    'Finished building: ../main.cfg'
    ' '
    'Building file: ../DSP2833x_GlobalVariableDefs.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="DSP2833x_GlobalVariableDefs.pp" --cmd_file="./configPkg/compiler.opt"  "../DSP2833x_GlobalVariableDefs.c"
    'Finished building: ../DSP2833x_GlobalVariableDefs.c'
    ' '
    'Building file: ../Task_Diag.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Task_Diag.pp" --cmd_file="./configPkg/compiler.opt"  "../Task_Diag.c"
    'Finished building: ../Task_Diag.c'
    ' '
    'Building file: ../Task_Fault.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Task_Fault.pp" --cmd_file="./configPkg/compiler.opt"  "../Task_Fault.c"
    'Finished building: ../Task_Fault.c'
    ' '
    'Building file: C:/Monitor_Iteration1/main/Init/boot.asm'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="boot.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Monitor_Iteration1/main/Init/boot.asm"
    'Finished building: C:/Monitor_Iteration1/main/Init/boot.asm'
    ' '
    'Building file: ../main.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp" --cmd_file="./configPkg/compiler.opt"  "../main.c"
    "../main.c", line 109: warning #225-D: function declared implicitly
    'Finished building: ../main.c'
    ' '
    'Building file: ../Init/DSP2833x_SysCtrl.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Init/DSP2833x_SysCtrl.pp" --obj_directory="Init" --cmd_file="./configPkg/compiler.opt"  "../Init/DSP2833x_SysCtrl.c"
    'Finished building: ../Init/DSP2833x_SysCtrl.c'
    ' '
    'Building file: ../Init/DeviceInit.c'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Init/DeviceInit.pp" --obj_directory="Init" --cmd_file="./configPkg/compiler.opt"  "../Init/DeviceInit.c"
    "../Init/DeviceInit.c", line 113: warning #225-D: function declared implicitly
    'Finished building: ../Init/DeviceInit.c'
    ' '
    'Building file: ../Init/boot.asm'
    'Invoking: C2000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="../inc" --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Init/boot.pp" --obj_directory="Init" --cmd_file="./configPkg/compiler.opt"  "../Init/boot.asm"
    'Finished building: ../Init/boot.asm'
    ' '
    'Building target: main.out'
    'Invoking: C2000 Linker'
    "C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --define=RELEASE --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=0x300 -m"main.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.1.0/lib" -i"C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --reread_libs --display_error_number --diag_wrap=off --rom_model -o "main.out" -l"./configPkg/linker.cmd"  "./Init/boot.obj" "./Init/DeviceInit.obj" "./Init/DSP2833x_SysCtrl.obj" "./main.obj" "./boot.obj" "./Task_Fault.obj" "./Task_Diag.obj" "./DSP2833x_GlobalVariableDefs.obj" -l"libc.a" "../DSP2833x_Headers_BIOS.cmd" "../TMS320F28335.cmd"
    <Linking>
    error #10056: symbol "_c_int00" redefined: first defined in "./Init/boot.obj"; redefined in "./boot.obj"

    error #10056: symbol "__stack" redefined: first defined in "./Init/boot.obj"; redefined in "./boot.obj"
    >> Compilation failure
    error #10056: symbol "__stack" redefined: first defined in "./Init/boot.obj"; redefined in "C:\ti\xdctools_3_23_03_53\packages\ti\targets\rts2800\lib\boot.a28FP<boot_cg.o28FP>"
    error #10056: symbol "_c_int00" redefined: first defined in "./Init/boot.obj"; redefined in "C:\ti\xdctools_3_23_03_53\packages\ti\targets\rts2800\lib\boot.a28FP<boot_cg.o28FP>"
    warning #10247-D: creating output section ".reset" without a SECTIONS specification
    error #10010: errors encountered during linking; "main.out" not built
    gmake: *** [main.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

     

     

  • Ok I fixed the mutiple include now I get

     

    <Linking>
    error #10056: symbol "__stack" redefined: first defined in "./Init/boot.obj"; redefined in "C:\ti\xdctools_3_23_03_53\packages\ti\targets\rts2800\lib\boot.a28FP<boot_cg.o28FP>"

    error #10056: symbol "_c_int00" redefined: first defined in "./Init/boot.obj"; redefined in "C:\ti\xdctools_3_23_03_53\packages\ti\targets\rts2800\lib\boot.a28FP<boot_cg.o28FP>"
    >> Compilation failure
    warning #10247-D: creating output section ".reset" without a SECTIONS specification
    error #10010: errors encountered during linking; "main.out" not built
    gmake: *** [main.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

     

     

  • The first problem is that you still have boot.obj in the top directory of your project. If you decided to keep boot.asm in the directory 'init', then you have to delete boot.obj from the top directory of your project.

    [Edit: I see you already fixed the first problem]

    The second problem is that your init/boot.obj file is showing up too late on the command line. You can control the order if you go to Properties->CCS Build->Link Order. Click on Add ... and selected both init/boot.asm and Generated Linker Command file and then ensure that init/boot.asm is listed before Generated Linker Command file.

  • Ok I solved this issue now I would like to ask one last question on the other part of the question about rebuilding the source code of SYSBIOS

    I realize the manual has a section about reducing the footprint of SYSBIOS but I think this is may not help us for my concern

    we cannot have any unused code if possible in our system. looking at the file Task.c i see the function below which is not bracketed by conditional compiles

    This leads me to worry this code can not be removed and we don't need this functionality in our system. If it can't be removed by following the smaller footprint instructions ??? could it be deleted in Task.c assuming we moved Task.c to our local build directory essentially building a custom SYSBIOS lib

     

    Void Task_deleteTerminatedTasksFunc()
    {
        UInt key;
        Task_Handle tsk;

        key = Hwi_disable();

        if (!Queue_empty(Task_Module_State_terminatedQ())) {
            tsk = Queue_head(Task_Module_State_terminatedQ());
            Hwi_restore(key);
            Task_delete(&tsk);
        }
        else {
            Hwi_restore(key);
        }
    }

     

  • Mark,
    all functions in SYSBIOS are conditionally linked, therefore if there is no reference to a function, it will not be in the executable. Just check the MAP file for your executable and you should be able to see that not all functions from source files are linked. 

  • QUESTION: What multiple includes did you have that you fixed to eliminate the redefines of _cint00 and __stack
  • Donna,
    The first problem was that there were two boot files on the linker command line: boot.obj and Init/boot.obj. The first one was a leftover from one of the earlier builds. The second problem was that the runtime library ended up being on the command line before boot.obj, so _cint00 and __stack were resolved there, so when the same symbols came from Init/boot.obj, the link step failed. When Init/boot.obj is moved forward, the symbols from the library are never brough in.