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.

getting started with TMDXRM48USB developer kit

Other Parts Discussed in Thread: HALCOGEN

Hi

I'm very new to the Hercules MCU stuff. I bought the TMDXRM48USB to check if this MCU may be suitable for a new project.

The ""Hercules Safety MCU Demos"" seem to work.

Now I want to write my own first code. But I have no clue where to start. There is no evaluation guide telling me what to do!

Am I missing something here?

I would like to see some documentation telling me how to write your own (minimal) program, compile it, and flash it into the MCU.

I can find some sources of the demo program. But it does not compile and it isnot clear which part for instance is for the led demo. It is a complex

program because it also contains host processor code and communication.

I hope there is some more documentation. Or a project file of a simple demo (e.g. the LED demo) that does compile and with information how

to load and/or flash it into the MCU. I want to start programing, but I have not enough information to do that.

I hope someone can help.

  • Cor,

    Thanks for using our forum.

    The best way to start is to use HalCogen.

    In the help menu you will find some code example and instruction to create your first program.
    Please have a try and let me know.

    By the way can you tell me which version of Code Composer, Halcogen and NowFlash you are using?

  • CCS = 4.2.4

    nowFlash updated to 3.42

    Halcogen updated to 3.01.01

    updated the demo software to version 2

    Problem is however that the demo does not work anymore after the updates.

    When starting the demo I get a message: Demo software not detected on microcontroller" and that I can flash it.

    When choosing Yes, I get the message that nowFlash can not be found.

  • I used Halcogen to generated a the .c and .h files. I used the same path as the CCS project, so the .h and .c files are included in the project.

    They are written to the source and include folders. But when compiling the .h files can not be found.

  • Cor,

    In CCS, right click on your project and select the properties for your project.
    You should see a tab for "CCS Build->Compiler->Include Options" From there, use "Add Include directory" and specify the path for your HalCogen include files"

    This will fix your problem.

  • Thanks. I added the include directory and now it can find them.

    I think it does compile now. But I get the following warning:

    --obj_directory="source"  "../source/lin.c"
    "C:\Users\GEBRUI~1\AppData\Local\Temp\0512810", WARNING! at line 1729:
     [W0000]
             Section .text:retain already has .RETAIN specified - ignoring .CLINK
               directive

            .clink

    "C:\Users\GEBRUI~1\AppData\Local\Temp\0512810", WARNING! at line 2150:
     [W0000]
             Section .text:retain already has .RETAIN specified - ignoring .CLINK
               directive

            .clink

    No Assembly Errors, 2 Assembly Warnings
    'Finished building: ../source/lin.c'

    I ussume I can ignore this.

    How can I download  the compiled program to the evaluation board and run it? Again I can not find any documentation about those steps.

    Do I need to make a new TargetConfiguraton in CCS? If so, do I need to select the ''Texas Instruments XDS100v2 USB Emulator'' as connection?

    To produce something meaningfull I added the famous line

    printf("Hello World!\n");

    in sys_main.c and added the line

    #include <stdio.h>

    I assume it should now print this line on some console of the CCS. Right?

    When compiling I get the message:

    <Linking>
    warning: creating output section ".sysmem" without a SECTIONS specification
    warning: creating ".sysmem" section with default size of 0x800; use the -heap
       option to change the default size
    'Finished building target: firstRMproj.out'

    Do I have to change something in HalCoGen?

    Is there really no document describing these elementary steps to write and run your own code?

    To ask each next step on this forum must be boring for the experienced users.

    I just want to have one simple program running, then I will be able to expand it.

  • Cor,

    Your comments are very valuable.

    I will suggest you to upgrade CCS to version 5.2.1
    Here is the link: http://processors.wiki.ti.com/index.php/Download_CCS

    This is our latest version, with support for all Hercules Safety controller.

    Concerning the warning during link, here is the reason and solution.

    All Standard IO function use the RAM as buffer to input and output messages.
    These buffers have to be mapped in RAM. The section .sysmem is used for that.
    In your linker command file (.cmd) you have to add the statement in RED:

    MEMORY
    {
        VECTORS (X)  : origin=0x00000000 length=0x00000020
        FLASH0  (RX) : origin=0x00000020 length=0x0017FFE0
        FLASH1  (RX) : origin=0x00180000 length=0x00180000
        STACKS  (RW) : origin=0x08000000 length=0x00001500
        RAM     (RW) : origin=0x08001500 length=0x00026B00

    /* USER CODE BEGIN (2) */


    /* USER CODE END */
    }

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

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


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

    SECTIONS
    {
        .intvecs : palign(32), fill =0xffffffff {} > VECTORS
        .text    : palign(32), fill =0xffffffff {} > FLASH0 | FLASH1
        .const   : palign(32), fill =0xffffffff {} > FLASH0 | FLASH1
        .cinit   : palign(32), fill =0xffffffff {} > FLASH0 | FLASH1
        .pinit   : palign(32), fill =0xffffffff {} > FLASH0 | FLASH1
        .bss     : {} > RAM
        .data    : {} > RAM

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

    }

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

    This new statement has to be place between a /* USER CODE BEGIN (4) */ and /* USER CODE END */
    If you have to re-generate your code with Halcogen, this new statement will stay. If it is outside, it will be removed.
    This is true for code in C files and H files. What ever you add has to be within a block /* USER CODE BEGIN (x) */ and /* USER CODE END */

    Please have a try and let me know.

  • Thanks again.

    I downloaded and installed CCS 5.2.1.

    When adding the ''.sysmem  : {} > RAM'' line and compiling again I now only get the second linking warning:

    warning: creating ".sysmem" section with default size of 0x800; use the -heap
       option to change the default size
    'Finished building target: firstRMproj.out'

    Why didn't HalCoGen make this section and set its size?

    Where can I find information about these sections and how to set them?

    When trying to run the compiled program on the evaluation board I get sometimes the error:

    CortexR4: Flash operation timed out waiting for the algorithm to complete. Operation cancelled.
    CortexR4: Flash Programmer: Error initializing device.
    CortexR4: Flash Programmer: Error erasing Flash memory.

    I didn't notice this with CCS4. How can I avoid it?

  • Cor,

    Good to hear that you are able to compile and download to the board.

    If you use the search engine in CCS with "sysmem" as entry you will find the detail on the usage.

    Halcogen is mainly generating startup code and peripheral drivers. None of this code use dynamic allocation, so there is no need for it.
    Anyway I will suggest to add this entry in the default linker command file.

    It is up to the user to evaluate how much space needs to be reserved for the sysmem section.
    By default the linker will define it as 0x800. You can change this value in the linker option properties.

    I will be interested to have your project (CCS and HalCogen) so I can check if every thing is ok.
    Can you zip the directory and share it?

  • 5432.test1.zip

    Well, it is not much more than what is generated bij HalCoGen (plus the printf and your suggestions).

    But I zipped it and attached it.

  • Cor,

    Can I close this thread at that point? Please mark my answer as verified answer.

  • Hi Jean-Marc,

    You asked for the project files, so I expected some reaction. But, yes, my question is answerred. Thanks a lot.