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.

HALCoGen v3.00.01: Strange RAM definition, GUI options vs. linker command needs vs. generated code

Other Parts Discussed in Thread: HALCOGEN

Hi folks,

using the TMS570LS3137PGE with HALCoGen v3.00.01 i encountered the following issues:

1)  the controller has 256KB RAM, which is stated correctly in the RAM tab, giving start address at 0x08000000 and length as 0x3FFFF.

But the generated linker file does not present the full RAM area, following the default stack definitions the known RAM ends at 0x08028000 instead of 0x803FFFF.

STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x00026B00

How come? 

2)  We have the need to exclude a certain RAM area from initialization at startup/reset of the controller. This is not possible using the HALCoGen GUI due to lacking options.

One possible solution is to have a manually setup linker command file, but the generated code out of the HALCoGen tool doesn't care about this. it seems that there is no way to control the behaviour of the generated to application needs, it looks like a fixed template code.

How can i tell HALCoGen to match the application needs in terms of generating a proper linker control file AND generate the matching code?

Especially painful is the function "_memoryInit_", generated in module ".../source/sys_memory.asm", which astonishingly knows the full RAM area and wipes it regardless of needed exclusion areas. I do not want to patch generated code!

Thanks in advance for Your answers!

Best regards

 Klaus

  • Hello Klaus,

    I have forwarded your questions to the HalCoGen expert who will looking into this matter.

    Best regards,

    TI Forum Support

  • Hi Klaus,

    Please use 3.01.01 for your development, Make sure you regenrate the HALCoGen project with necessary selection. See my response on this in following forum query. http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/207521/736115.aspx#736115 

    Pls find comments corresponding to your question.

    1) Yes, this is a Bug and already we fixed in upcoming 3.02.00 ( Mid Sep). But if you go and edit one of the field in RAM tab then calculation will be correct.

    2) Yes the linker command file is a template based, for application specific, user can use their custom linker command file ( Have a note on the stack location from HALCoGen).
    _memoryInit_ is intended to clear the RAM contenets in the Startup before enabling RAM ECC. It is TI's recommended procedure for Safety Initialization. If you do not want it you can use the /* user code */ above and below this function call and #if 0 and #endif.  See below For reference

    /* USER CODE BEGIN (30) */

    #if 0
    /* USER CODE END */

     /* Initialize CPU RAM.
      * This function uses the system module's hardware for auto-initialization of memories and their
      * associated protection schemes. The CPU RAM is initialized by setting bit 0 of the MSIENA register.
      * Hence the value 0x1 passed to the function.
      * This function will initialize the entire CPU RAM and the corresponding ECC locations.
      */
     _memoryInit_(0x1);

    /* USER CODE BEGIN (31) */

    #endif
    /* USER CODE END */

     

    Regards
    Prathap

     

     

  • Hi Prathap,

    thanks for Your answers!

    Unfortunately i cannot fully agree.

    >Please use 3.01.01 for your development...

    Stiil too many problems reported,  i cannot afford setting everything up new from scratch without reliable DIL import.

    BTW: if from 3.00.01 the option to check for updates is issued, it tells everything is up to date. No hint for a version 3.01.01

    1)

    >But if you go and edit one of the field in RAM tab then calculation will be correct.

    Some values are changed indeed, but the full RAM area still is not set.

    After initial setup of a new project in HALCoGen 3.01.01, i can play around with the ONLY stack related entries in HALCoGen. Still the outcome is a linker file which does not provide the fully remaining length of RAM after stack valid for the selected controller.

    Start (origin=) and length of configured stack area + start of remaining RAM with remaining length should use the entire available RAM of the controller.

    For the TMS570LS3137PGE this should provide area 0x800 0000 up to 0x803 FFFF, but only 0x800 0000 up to 0x802 8000 is generated into ex. linker file.

    The DIL file contains a MPU setting end address of 0x800 0000 up to 0x803 FFFF, so the HALCoGen seems to know the real available RAM size of the selected controller.


    What do i miss? I haven´t got a clou.

    Best regards

     Klaus

  • All my comments were based on 3.01.01, in which I checked that if I do a edit in RAM Tab Linker command file shows proper RAM length,(  say change one of stack lenght from 100 to 0 and set it back to 100 before generating code. ).
    Workaround no 2 : go to HALCoGen / v3.01.01 / config / TMS570LS3137ZWT.cnf --> Change VAR.RAM_LINK_LENGTH.DEFAULT = 0x00026b00 to 0x0003eb00

    Latest HALCoGen can be downloaded from http://www.ti.com/tool/halcogen

    I understand the DIL portability issue with 3.01.01, but 3.02.00 ( Mid Sep release) should have all the issues resolved.

    Regards
    Prathap

     

  • Hi Prathap,

    as i wrote:

    >After initial setup of a new project in HALCoGen 3.01.01, i can play around with the ONLY stack related entries inHALCoGen. Still the outcome is a linker file which does >not provide the fully remaining length of RAM after stack valid for the selected controller.

    i also did it with HALCoGen 3.01.01. It did not work correctly! Fresh setup based on default settings.

    Same behaviour on that in HALCoGen 3.01.01 AND HALCoGen 3.00.01.

    Regards

    Klaus