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.

RM57L843: __TI_decompress_lzss and __TI_decompress_none functions

Part Number: RM57L843
Other Parts Discussed in Thread: HALCOGEN

Hi,

When below two options are removed from CCS linker options,
"libc.a"
"rtsv7R4_T_be_v3D16_eabi.lib"
below two function cannot be found and error occurs.
__TI_decompress_lzss
__TI_decompress_none

Customer wants to remove these two functions.

FYI, customer used RM46x before, and at that time removing "libc.a" automatically removed above two functions.
But it does not work for RM57Lx.

Thanks and regards,
Koichiro Tashiro

  • You can remove __TI_decompress_lzss by adding the build option --cinit_compression=off.  I'm not aware of any method for removing __TI_decompress_none.  I'd like to know how you did it on the previous project.  There has to be more to it than ...

    removing "libc.a" automatically removed above two functions

    After making that change, what is the entry point to the program?  How does control go from that entry point to main?  How is the system initialized?  How are the global variables initialized?

    Thanks and regards,

    -George

  • FYI, customer used RM46x before, and at that time removing "libc.a" automatically removed above two functions.
    But it does not work for RM57Lx.

    Is the customer using HALCoGen?

    In a HALCoGen project for the TI compiler in the _c_int00 entry point there will be code of the form:

        /* initialize copy table */
        __TI_auto_init();
    /* USER CODE BEGIN (75) */
    /* USER CODE END */
        
        /* call the application */
    /*SAFETYMCUSW 296 S MR:8.6 <APPROVED> "Startup code(library functions at block scope)" */
    /*SAFETYMCUSW 326 S MR:8.2 <APPROVED> "Startup code(Declaration for main in library)" */
    /*SAFETYMCUSW 60 D MR:8.8 <APPROVED> "Startup code(Declaration for main in library;Only doing an extern for the same)" */
        main();
    
    /* USER CODE BEGIN (76) */
    /* USER CODE END */
    /*SAFETYMCUSW 122 S MR:20.11 <APPROVED> "Startup code(exit and abort need to be present)" */
        exit(0);

    The above example was from the HALCoGen generated sys_startup.c source file in a RM46 project.

  • Hi,

    Thanks for your replies.

    After making that change, what is the entry point to the program?  How does control go from that entry point to main?  How is the system initialized?  How are the global variables initialized?

    The entry point is main().
    The initialization was done by below code in RM46x.

        if (__TI_PINIT_Base < __TI_PINIT_Limit)
        {
            void (**p0)(void) = (void *)__TI_PINIT_Base;
    
            while ((uint32)p0 < __TI_PINIT_Limit)
            {
                void (*p)(void) = *p0++;
                p();
            }
        }
    

    Customer is thinking to use the same code in RM57Lx. Is this OK?
    If not, could you tell me how to do the same in RM57Lx?

    Thanks and regards,
    Koichiro Tashiro

  • I know what that code does.  The startup code in the runtime support library supplied with the compiler does the same thing.  Though it is coded differently.  I have never seen this particular implementation.

    That is only 1 part of the initialization performed by the startup code in the runtime support library supplied with the compiler.  The RM46x system must perform the other parts, though I suspect it is implemented differently.  It is likely that startup code will work on the RM57Lx system.  To know more, you need to find the team that implemented the startup code used on the RM46x system, and work with them on it.

    Did the startup code used on the RM46x system come from TI?  Or from somewhere outside of TI?

    Thanks and regards,

    -George

  • Hi George,

    You can remove __TI_decompress_lzss by adding the build option --cinit_compression=off.  I'm not aware of any method for removing __TI_decompress_none.  I'd like to know how you did it on the previous project.  There has to be more to it than ...

    Customer insists just removing "libc.a" from link was enough in RM46x to remove both "__TI_decompress_lzss" and "__TI_decompress_none"
    And he wants to know why it does not work for RM57Lx.

    Thanks and regards,
    Koichiro Tashiro

  • Customer insists just removing "libc.a" from link was enough in RM46x to remove both "__TI_decompress_lzss" and "__TI_decompress_none"

    Unfortunately, I don't know how that was done.  Was this implemented using a software package, or other assistance, from TI?  If so, we need to find that team and ask them for help.

    Thanks and regards,

    -George

  • Hi George,

    The old discussion was done in 2013 and the person who handled it no longer in TI, but I managed to find customer Q&A record.
    According to the record;
    - Customer did not want to use standard Runtime support library(rtsv7R4_T_le_v3D16_eabi.lib) as it was a black box for them.
    - They just wanted to use below five files and remove the library.
    copy_zero_init.c
    cpy_tbl.c
    cpy_tbl.h
    memcpy32.asm
    u_div32.asm
    - There were three functions (__TI_zero_init, __TI_decompress_none, __TI_decompress_rle) used implicitly. Customer wanted to remove them as well.
    - Customer added below initialization codes.

        /* initialize the C global variables */
        if (&__TI_Handler_Table_Base < &__TI_Handler_Table_Limit)
        {
            uint8 **tablePtr   = (uint8 **)&__TI_CINIT_Base;
            uint8 **tableLimit = (uint8 **)&__TI_CINIT_Limit;
    
            while (tablePtr < tableLimit)
            {
                uint8 * loadAdr = *tablePtr++;
                uint8 * runAdr  = *tablePtr++;
                uint8  idx     = *loadAdr++;
                handler_fptr   handler = (handler_fptr)(&__TI_Handler_Table_Base)[idx];
    
                (*handler)((const uint8 *)loadAdr, runAdr);
            }
        }
    
        /* initialize constructors */
        if (__TI_PINIT_Base < __TI_PINIT_Limit)
        {
            void (**p0)(void) = (void *)__TI_PINIT_Base;
    
            while ((uint32)p0 < __TI_PINIT_Limit)
            {
                void (*p)(void) = *p0++;
                p();
            }
        }
    

    Then
    - “libc.a” was removed from “Include library file or command file as input (--library, -l)” list in “CCS Build” => “ARM Linker” => “File Search Path” window.
    - All linker options for RM46x are below. Build is OK with CCS10.3.0. 
    -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -me -g --display_error_number --diag_wrap=off --diag_warning=225 --enum_type=packed -z -m"xxx.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccs1030/ccs/tools/compiler/ti-cgt-arm_20.2.4.LTS/lib" -i"C:/ti/ccs1030/ccs/tools/compiler/ti-cgt-arm_20.2.4.LTS/include" --reread_libs --display_error_number --diag_wrap=off --warn_sections --xml_link_info="xxx_linkInfo.xml" --rom_model

    Do you have any idea why the similar approach does not work for RM57Lx?

    Can you tell me what is the purpose of below functions and who calls them?
    "__TI_decompress_lzss", "__TI_decompress_none"

    Thanks and regards,
    Koichiro Tashiro

  • I'll contact you privately.  -George

  • This solution resolved the problem.

    Perform these two steps.

    1. Add the linker build option --cinit_compression=off
    2. Add the RTS source file copy_decompress_none.c

    Step 1 fixes the error diagnostic about __TI_decompress_lzss.  Step 2 fixes the error diagnostic about __TI_decompress_none.  Get the RTS source file from the directory compiler_install_root\lib\src.

    Thanks and regards,

    -George