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/TMS320F280049: CCS C language problems

Part Number: TMS320F280049

Tool/software: Code Composer Studio

Hi, I have some questions and your help:

I' m using a TMS320F280049 in my own board, I'm writing the FW using the C language and the CCS9.3.

- in what way can I configure the memory areas (data size, code size,...) ? <---- LINKER

- when I try to declare an array of more than 512 integers,  the FW crashes; if I declare 2 array of 512 the FW works good

int             sig_buf[512],sig_buf2[512];     FW works

int             sig_buf[1024];                          FW fails

What is wrong ?

Thanks and best regards

Luigi

  • You can create a section in linker command file and place them to RAM area where it has enough space and then use #pragma  data_section() to place them in the section you created.

    If your data is 16bit, then try to declare it as int16_t. That way you only need 2kB.

  • https://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking

    is good reference material. Take a look and see if it is helpful.

  • Santosh Jha said:
    You can create a section in linker command file

    Why would that be necessary as all C+ array are SRAM storage class and not flash expandable / writable. The C array build object is located (c.lib) high level thumb instructions best I can tell. There is not much discussion how or if a C+ interpreter was embedded into the MCU. Older Intel 16 bit MCU had to provide EPROMS interpreters for high level compiled object (hex) languages such as C.

     You can modify any of the c library files if they are bugged and recompile via Cygwin calls loaded on windows OS. Perhaps array.c has issues that have not been corrected for C2000 MCU class?

  • What do you know it appears there is an interpreter after all. Don't fell bad since multidimensional array's don't work at all in TI ARM Cortex CPU's, compilers seem to omit or ignore columns >0 in the multi array[n],[n+1]. 

    /******************************************************************************/
    /* This file was taken from STLport <www.stlport.org> and modified by         */
    /* Texas Instruments.                                                         */
    /******************************************************************************/
    
    /*
     * Copyright (c) 2005
     * Francois Dumont
     *
     * Copyright (c) 2014-2014 Texas Instruments Incorporated
     *
     * This material is provided "as is", with absolutely no warranty expressed
     * or implied. Any use is at your own risk.
     *
     * Permission to use or copy this software for any purpose is hereby granted
     * without fee, provided the above notices are retained on all copies.
     * Permission to modify the code and to distribute modified code is granted,
     * provided the above notices are retained, and a notice that the code was
     * modified is included with the above copyright notice.
     *
     */
    
    /* NOTE: This is an internal header file, included by other STL headers.
     *   You should not attempt to use it directly.
     */
    
    #ifndef _STLP_CARRAY_H
    #define _STLP_CARRAY_H
    
    /* Purpose: Mimic a pur C array with the additionnal feature of
     * being able to be used with type not default constructible.
     */
    
    #ifndef _STLP_INTERNAL_CONSTRUCT_H
    #  include <s__construct.h>
    #endif
    
    _STLP_BEGIN_NAMESPACE
    
    _STLP_MOVE_TO_PRIV_NAMESPACE
    
    template <class _Tp, size_t _Nb>
    struct _CArray {
      _CArray (const _Tp& __val) {
        for (size_t __i = 0; __i < _Nb; ++__i) {
          _Copy_Construct(__REINTERPRET_CAST(_Tp*, _M_data + __i * sizeof(_Tp)), __val);
        }
      }
    
      ~_CArray() {
        _Destroy_Range(__REINTERPRET_CAST(_Tp*, _M_data + 0),
                       __REINTERPRET_CAST(_Tp*, _M_data + _Nb * sizeof(_Tp)));
      }
    
      _Tp& operator [] (size_t __i) {
        _STLP_ASSERT(__i < _Nb)
        return *__REINTERPRET_CAST(_Tp*, _M_data + __i * sizeof(_Tp));
      }
    
    private:
        char _M_data[sizeof(_Tp) * _Nb] __attribute__((aligned(__ALIGNOF__(_Nb))));
    };
    
    _STLP_MOVE_TO_STD_NAMESPACE
    
    _STLP_END_NAMESPACE
    
    #endif //_STLP_CARRAY_H

  • Other TI CPU compilers use eabi.lib to hold the compiled C lib functions, Cygwin compiles as the eabi.lib found project properties, CCS general, runtime support library (automatic). Oddly there are several to choose from other than (automatic) and no real help how they differ. Checking the compile manifest and other IDE help documents are vague what automatic does for specific functions. 

    What if automatic picks the first eabi library with a bug and skips others that might work better? We set the ARM Cortex projects to match the MCU class (rtsv7M4_T_le_v4SPD16_eabi.lib). Even that is no guarantee a bug does not exists in a function that has not been debugged since 2005 - that is all...

  • Assigning the thread to the compiler team.

  • Luigi,

    Can you share your linker command file and the small test code?

  • Are you able to resolve the issue? Any update?

  • Closing as there is no activity on the thread.