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.

How to create library files on TMS570?

Guru 10235 points

Hello, Sir

Could you explain how to create library files on TMS570.

We've successed to build on TMS570LS31USB by generated library files from the code which doesn't include ".sect" statements.

We refered the website as below.

http://processors.wiki.ti.com/index.php/Creating_Library_for_MSP430_Project_using_CCS_v5?keyMatch=ccs%20library&tisearch=Search-JP

BUT We've failed to build by generated library files including "sys_intvecs.asm" which include ".sect" statement.

We cannot find "intvecs" in  xxxx.map file after build completion as below.

 <FAIL case>

SEGMENT ALLOCATION MAP

run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
00000020 00000020 0000626c 0000626c r-x
00000020 00000020 000060f0 000060f0 r-x .text

<Succeed case>   

SEGMENT ALLOCATION MAP

run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
00000000 00000000 0000639c 0000639c r-x
00000000 00000000 00000020 00000020 r-x .intvecs
00000020 00000020 000061d8 000061d8 r-x .text

I'd appreciate if you explain how to create library files on TMS570.

Best regards

  • I did give it a try with a sample project, but do not see any issue that you are trying to report.

    Do you have the following line in your sys_link.cmd ?

    --retain="*(.intvecs)"

    I'm still not very sure if this is the issue, but pls give it a try.

  • Hello, Sir

    Thank you for your quick answer.

    Yes. we found "--retain="*(.intvecs)" in sys_link.cmd file.

    We'd appriciate if you check our project.

    I attatched files below. (including compile log "log.txt")

    1830.CCS_Proj.zip

    For making library:  TMS570LS31USB_Lab0_make_LIB

    For executing program with the generated library: TMS570LS31USB_Lab0_exec_LIB

    We tried to change CCS version from 5.5 to 6.0, the situation don't change.

    We were wondering if you could tell us the difference from your successful case.

    Best regards

  • HI Matusan,

    I downloaded your lib project, and built/compiled on my CCS (6.0). I don't see any error. My compiler is TI 5.1.6

    Regards,

    QJ

  • Hello,Sir

    Thank you for your quick action.

    I understand any error is occured on your CCS.

    We identified the fail by checking  "intvecs" word in the xxx.map file.  

    Could you send us "TMS570LS31USB_Lab0_exec_LIB.map" file after built on your CCS environment? 

    We'd like to know the  "intvecs" word on the file.

    Best regards

  • Hi Matusan,

    For Library project, it does not generate memory map file. 

    Regards,

    QJ

  • Hello, Sir

    Thank you for your quick reply.

    I understand what you mean.

    Actually, for Library project, it does not generate memory map file.

    Could you send us "TMS570LS31USB_Lab0_exec_LIB.map" file generated on the execution project as below.

    Project name is "TMS570LS31USB_Lab0_exec_LIB"

    My attached zip file contains two projects.  (For making library & For executing application by using generated lib )

    If you execute to build on the "TMS570LS31USB_Lab0_exec_LIB project, TMS570LS31USB_Lab0_exec_LIB.map file is generated in "Debug" directory under the  "TMS570LS31USB_Lab0_exec_LIB project workspace.

    Best regards

  • Hello,Sir

    Thank you for your help.

    Now, our customer is waiting the answer.

    I would appreciate it if you could inform us about the current status.

    Sincerely

  • Hi Matusan,

    To map interrupt routines to interrupt vectors you need to include a intvecs.asm file. This file will contain
    assembly language directives that can be used to set up the ARM's interrupt vectors with branches to your
    interrupt routines. 

    The linker will use intvecs.asm with the compiler's linker control file (*.cmd). The control file contains a SECTIONS directive that maps the .intvecs section into the memory locations 0x00-0x20.

    In Project Property -- General, select "TMS570LS31xFlashLnk.cmd" in "Linker Command File:". This will generate a map file for you after "Build Project"

    Regards,

    QJ

  • Can you pls confirm if this issue is sorted out, if yes pls close this thread. Thanks.

  • Dear QJ Wang

    i have the same problem.

    There are 2 ccs project, one produces the library (lib) and another to produce executable (out/bin) including library.

    We already know that if you include asm file in the ccs project that produces the executable, all is okay (intvecs present in the map file at 0x00-0x20). Okay. 

    Next step is to put the asm file in a ccs library project (lib). Than include the library (lib) in the executable ccs project (out/bin). In this case, the linker had not put the intvect in the expected place (0x00-0x020). I think it is mapped in the library code.

    Then, how we can make visible the intvecs section to the linker in the ccs exe project

    Note that in all the cases the link.cmd file has your suggested informations as following

    ---------------------------------------

    --retain="*(.intvecs)"


    MEMORY
    {
    VECTORS (X) : origin=0x00020000 length=0x00000020
    //FLASH_API (RX) : origin=0x00020020 length=0x000014E0
    FLASH0 (RX) : origin=0x00020020 length=0x002FEB00 //LS31x and RM48 Flash size is 0x300000
    SRAM (RW) : origin=0x08002000 length=0x0002D000
    STACK (RW) : origin=0x08000000 length=0x00002000
    }
    SECTIONS
    {
    .intvecs : {} > VECTORS

    .text > FLASH0
    .const > FLASH0
    .cinit > FLASH0
    .pinit > FLASH0
    .data > SRAM
    .bss > SRAM
    }

    -----------------------------------

  • The section allocation in the linker command file is ignored when you are creating a library. These individual sections then need to be allocated to the desired memory in the "final" code project that uses the created library.

    See the below example:

    Allocate a Single Input Section from a Library

    Consider this example:

       IQmathTables3 : > IQTABLES3
       {
           IQmath.lib<IQNasinTable.obj> (IQmathTablesRam)
       }
    

    This forms an output section named IQmathTables3. It contains one input section named IQmathTablesRam. That input section comes from the object file IQNasinTable.obj, which is a member of the library IQmath.lib. This output section is allocated to the IQTABLES3 memory range.

    The above example is available at this wiki page:

    http://processors.wiki.ti.com/index.php/Linker_Command_File_Primer

    Regards, Sunil

  • I started this E2E thread.

    And our problem has been solved.

    Maybe I can show some clue for you. 

    In our case, the point is "need two retain statements" as shown blow.

    --retain="*(.intvecs)"

    --retain=TMS570LS31USB_Lab0_make_LIB.lib<sys_intvecs.obj>(.intvecs) 

    Please refer the bottom of page 197 in ARM Assembly Language Tools v5.1 User's Guide

    http://www.tij.co.jp/jp/lit/ug/spnu118l/spnu118l.pdf

    I hope that this information(our case) will be of help to you.

    Best regards

  • Dear all 

    tank you so much.

    I ported your both suggested changes in link.cmd file of my existing project, but the intvecs section and/or sys_intvecs.obj didn't appeared in the map file. Besides, the memory range 0-20 is not present in map file.

    I created a new project, make the same settings (vars, includes, libraries etc.) and the same link.cmd file as previous project and magically the intvecs appeared in the map file.

    I have the impression that, sometimes, code composer acts on a project configuration different than that show me.

    Thanks

    Paolo