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.

Problem getting Hello World to run on TMS570 eval board

Other Parts Discussed in Thread: HALCOGEN

Hello everyone,

I just received the TMS570 Microcontroller Development Kit, installed the environment, and verified that the safety MCU demos were running OK on the board.

I then tried to follow the Hello World step by step tutorial, leaving everything at its default value. I created a target config file, choosing "Texas Instruments XDS100v2 USB emulator", and device TMS570LS20216SZWT.

When I launch the debug session, somehow I get stuck before reaching the main() entry point.

Console output is:

CortexR4: GEL Output: Memory Map Setup for Flash @ Address 0x0

Debugger shows the main thread running, in function : "0_c_int00() at boot.asm:80 0x00002280"

I am using CCS version 4.1.3.00038

I am obviously doing something wrong/silly for such a basic test to fail, but I can't figure out what is is (and it doesn't help that I am a beginner regarding CCS and TI microcontrollers...).

Any advice?

Thanks,

Julien

 

 

 

 

  • Julien,

     

    Please send me your source files and linker command file so I can have a look.

    Regards,

     

    Jean-Marc

  • Julien,


    The purpose of this post is to provide a basic CCSv4 example.
    The test code is using PRINTF function from the RTS library.

    HalCoGen is used to generate the project. All driver generation have been disabled in this example.

    The main() is as simple as:

    void main(void)
    {
    /* USER CODE BEGIN (3) */

    printf("Hello World\n");

    /* USER CODE END */
    }

    /* USER CODE BEGIN (4) */
    /* USER CODE END */

    HalCoGen generates the backbone of the main routine. The following statement has been added afterwords.
    printf("Hello World\n");

    Any statement added in the USER CODE BEGIN/USER CODE END are protected, even if HalCoGen is re-invoked to generate a new version of the code.

    When printf routine (or other routine of the kind) are used, a specific section named .sysmem is created. This section has to be mapped in RAM.
    To do so, the default linker command file (sys_link.cmd) has to be modified as following:

    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* (c) Texas Instruments 2009, All rights reserved.                           */
    /*                                                                            */

    /* USER CODE BEGIN (0) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */

    --retain="*(.intvecs)"

    /* USER CODE BEGIN (1) */
    /* USER CODE END */

    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */

    MEMORY
    {
        VECTORS (X)  : origin=0x00000000 length=0x00000020
        FLASH0  (RX) : origin=0x00000020 length=0x0007FFE0
        FLASH1  (RX) : origin=0x00080000 length=0x00080000
        FLASH2  (RX) : origin=0x00100000 length=0x00080000
        FLASH3  (RX) : origin=0x00180000 length=0x00080000
        STACKS  (RW) : origin=0x08000000 length=0x00001300
        RAM     (RW) : origin=0x08001300 length=0x00026D00

    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (3) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text    : {} > FLASH0 | FLASH1 | FLASH2 | FLASH3
        .const   : {} > FLASH0 | FLASH1 | FLASH2 | FLASH3
        .cinit   : {} > FLASH0 | FLASH1 | FLASH2 | FLASH3
        .pinit   : {} > FLASH0 | FLASH1 | FLASH2 | FLASH3
        .bss     : {} > RAM
        .data    : {} > RAM

    /* USER CODE BEGIN (4) */
        .sysmem  : {} > RAM
    /* USER CODE END */
    }

    /* USER CODE BEGIN (5) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */

    /* USER CODE BEGIN (6) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/

    The     .sysmem  : {} > RAM directs the linker to map the .sysmem section in RAM.

    Once the code is compiled and linked, it can be download on the board (Flash memory will be programmed) and than you can execute the code.
    The message "Hello World" will be displayed in the console windows.

    Please have a try and let me know your feedback.


    Best Regards,

    Jean-Marc Mifsud

    0842.Hello_World.zip

     

     


  • Thank you Jean-Marc, it works fine, and clarified for me what is going on under the hood at program startup.

     

    Regards,

    Julien

  • Hi Jean_Marc

     

    i'm trying to use your example Hello World project to demonstrate printf i/o capabilities on the TMS570LS31x Hercules USB Development Stick .  Is there a way to just unzip the project you attached (0842.Hello_5F00_World.zip) and open that project in CCS v4?  ... as opposed to having to use Halcogen to regenerate the project and import into CCS. Seems as though the only option available in CCS is to create a new project, but when i name it the same as your sample project that i've unzipped in my workspace, it obviously complains that the project already exists.

     

    thanks

    rmb

  • Hi rmb,

     

    you can import the extracted project by clicking on the file tab=> import=>Existing CCS/CCE Eclipse Projects, then browse to your project folder. Under discovered projects the hello world project should appear, click finish and you are good to go. Please note that you eventually have to connect the hello world project to a target configuration file. 

     

    rmb_vector said:

    Hi Jean_Marc

     

    i'm trying to use your example Hello World project to demonstrate printf i/o capabilities on the TMS570LS31x Hercules USB Development Stick .  Is there a way to just unzip the project you attached (0842.Hello_5F00_World.zip) and open that project in CCS v4?  ... as opposed to having to use Halcogen to regenerate the project and import into CCS. Seems as though the only option available in CCS is to create a new project, but when i name it the same as your sample project that i've unzipped in my workspace, it obviously complains that the project already exists.

     

    thanks

    rmb