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.

TMS570LS0432: TMS570LS0432: HALCoGen RAM issues

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN,

Hi,

For a project, the customer needs to reserve some memory space for uninitialized variables.

The linker command file (manually edited) is as follows:

MEMORY

{

    VECTORS (X)  : origin=0x00000000 length=0x00000020

    FLASH0  (RX) : origin=0x00000020 length=0x0005FFE0

    STACKS  (RW) : origin=0x08000000 length=0x00001500

    RAM     (RW) : origin=0x08001500 length=0x00006a00

 

/* USER CODE BEGIN (2) */

   RVRAM    (RW) : origin=0x08007F00 length=0x00000100

/* USER CODE END */

}

 

They have reduced the maximum RAM size by 0x100 and created new section RVRAM that is using that memory.

 

Then, in HALCoGen in RAM tab we’ve specified the RAM length parameter as 0x00007F00 instead of 0x00008000

In theory, it shall reduce RAM section by 0x100.

 

However, HALCoGen still allocating the whole RAM to section RAM (after taking stack space out, obviously) and they end up with this:

 

MEMORY

{

    VECTORS (X)  : origin=0x00000000 length=0x00000020

    FLASH0  (RX) : origin=0x00000020 length=0x0005FFE0

    STACKS  (RW) : origin=0x08000000 length=0x00001500

    RAM     (RW) : origin=0x08001500 length=0x00006b00

 

/* USER CODE BEGIN (2) */

   RVRAM    (RW) : origin=0x08007F00 length=0x00000100

/* USER CODE END */

}

 

This causes linkage error (as expected) and also means they have to change the linker command file manually each time they regenerate HALCoGen code.

 

In the HALCoGen DIL file, it has been noticed that while this line has been changed from this:

DRIVER.SYSTEM.VAR.RAM_LENGTH.VALUE=0x00008000

 

To this:

DRIVER.SYSTEM.VAR.RAM_LENGTH.VALUE=0x00007F00

 

The following line has stayed the same:

DRIVER.SYSTEM.VAR.RAM_LINK_LENGTH.VALUE=0x00006B00

 

Rather than change to something like this:

DRIVER.SYSTEM.VAR.RAM_LINK_LENGTH.VALUE=0x00006A00

 

Is there something that the customer is doing wrong or is it a HALCoGen issue?

  • Ross,

    I strongly recommend against making changes to the HALCoGen DIL file. Instead, to reserve a block of uninitiated RAM, add a section in the User Code section of the link command file and bind it to the desired address. Here is an example of reserving 256 bytes at the high end of the RAM on a TMS570LS0432. I added an optional symbol definition. Since this is between the "USER CODE BEGIN" and "USER CODE END" statements, it will not be altered on subsequent code generations by HALCoGen.

    /* USER CODE BEGIN (4) */
    	my_uninitialized_section:
    	{
    		my_uninitialized_section_address = .;
    		. += 0x100;
    	} > 0x08006A00
    /* USER CODE END */