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.

CCSv4 for Stellaris questions



Hi,

I originally posted this question to Luminary Micro Forum, but nobody was able to answer it.

http://www.luminarymicro.com/component/option,com_joomlaboard/Itemid,92/func,view/id,10232/catid,5/

I'm trying to have a basic understanding of CCSv4 for Stellaris. My very basic questions are:
- where to find the documentation for code generation tools? There is some documentation for MSP430 tools, but not for Stellaris
- how the C runtime environment is setup, copying initialized data, zeroing of unitialized data? I don't see any crt0.s file or similar
- memory sections?

Regards

Jan

  • Jan:

    CCS v 4,1 is quite straightforward to use. It is Eclipse-based and somewhat similar to using CodeRed version 1.x on previous versions of the various LMI boards that used that compiler. After installing CCS v 4.1, several directories will be created. The two key ones are:

        - arm   - this has the various lmxxxx.cmd files used internally by the compiler.

        - tools/compiler/tms470  -  this compiler works for both LMI Cortex and the TI 470 ARM

    You also have to install the standard "Stellarisware" driver/firmware library, as is normal for any of the LMI boards. Inside the Stellarisware/driverlib directory is a sample CCS project, and many of the associated Stellarisware/boards examples also have sample CCS projects that are ready to go. The various Stellarisware/boards examples also contain an associated  xxx.ld file, that contains the various memory section definitions.

    The manual describing how to use CCS with LMI is actually included as part of the LMI EvalKit downloads, not as part of CCS. If you select the "EKS" flavor of the software for a specific board from the LMI site (for example the LM3S9B92 Eval Kit at URL http://www.luminarymicro.com/products/eks-lm3s9b92.html ) you can download the "Quickstart-Eval-Kit-CCS-1.1" document, which walks you through how to import and build an existing sample project, and also how to create a new project using CCS. That same URL also has the links to download the Stellarisware library, e.g. "SW-EK-LM3S9B92-5821" firware, although I usually download the whole CD-ROM image, since it contains various and sundry useful utilities in addition to the Stellarisware library,

    The LMI Cortex-M3 class devices are designed to be run using C, so there is no need to have a crt0.s file as is the case for ARM7 type devices.  Instead there is a startup_ccs.c module that performs all chip startup and C initialization. (well, OK, they cheat a little bit and have a handful of _asm() statements embedded inside startup_ccs.c).   

    In general. I am very pleased with the CCS v4.1 support for the LMI boards. I had previously been using CodeRed, but the learning curve for CCS v4.1 was very quick, and it works reliably, and debugging is well integrated.

  • Wayne,

    Thank you for your response. I have the LM3S9B96 kit and CCS installed and I already played with it.

    However, I still have doubts. The file startup_ccs.c has the following

     

     

     

     

    void

     

     

    {

     

     

    //

     

     

    // Jump to the CCS C Initialization Routine.

     

     

    //

    __asm(

     

    " .global _c_int00\n"

     

     

    " b.w _c_int00"

    );

    I am not able to find the c_int00() sources, so don't know what is done there. Is this entry in library or

    is there a source for it. If yes, where?

    Thanks again

    Regards

    Jan

    ResetISR(void)

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    the example startup from LPCxpresso is:

    void

    //ResetISR(void)

    Reset_Handler

     

    (void

    )

    {

     

     

    unsigned long

    *pulSrc, *pulDest;

     

     

     

    //

     

     

    // Copy the data segment initializers from flash to SRAM.

     

     

    //

    pulSrc = &_etext;

     

     

    for

    (pulDest = &_data; pulDest < &_edata; )

    {

    *pulDest++ = *pulSrc++;

    }

     

     

     

    //

     

     

    // Zero fill the bss segment. This is done with inline assembly since this

     

     

    // will clear the value of pulDest if it is not kept in a register.

     

     

    //

     

     

    __asm(

    " ldr r0, =_bss\n"

     

     

    " ldr r1, =_ebss\n"

     

     

    " mov r2, #0\n"

     

     

    " .thumb_func\n"

     

     

    "zero_loop:\n"

     

     

    " cmp r0, r1\n"

     

     

    " it lt\n"

     

     

    " strlt r2, [r0], #4\n"

     

     

    " blt zero_loop"

    );

     

     

     

    //

     

     

    // Call C++ library initilisation, if present

     

     

    //

     

     

    if

    (__libc_init_array)

    __libc_init_array() ;

     

    #ifdef

     

     

    __USE_CMSIS

    SystemInit();

    #endif

     

     

     

    //

     

     

    // Call the application's entry point.

     

     

    // __main() is the entry point for redlib based applications (which calls main())

     

     

    // main() is the entry point for newlib based applications

     

     

    //

     

     

    if

    (__main)

    __main() ;

     

     

    else

    main() ;

     

     

     

    //

     

     

    // main() shouldn't return, but if it does, we'll just enter an infinite loop

     

     

    //

     

     

    while

    (1) {

  • Jan Szymanski said:

    I am not able to find the c_int00() sources, so don't know what is done there. Is this entry in library or

    is there a source for it. If yes, where?

    That should be defined in the runtime library. CCS should automatically pull in the correct library.

  • You can find the code for c_int00 within the file boot.asm which is part of the runtime library sources. To extract the runtime library sources, unzip the file rtssrc.zip in C:\Program Files\Texas Instruments\ccsv4\tools\compiler\tms470\lib

  • Thank you.

    Now I have a better picture of what is really happening.

    Best

    Jan