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.

MSP430FR5994: Can I combine 4kb LEA RAM with SRAM into a single 8kb block of RAM?

Part Number: MSP430FR5994

Hello,

The default linker file for the MSP430FR5994 separates the RAM into 2 regions, LEARAM, and RAM.

RAM       : origin = 0x1C00, length = 0x1000

LEARAM                  : origin = 0x2C00, length = 0x1000 - LEASTACK_SIZE.

If I'm not using the LEA in my application can I simply combine the regions to access the full 8kb or RAM?

RAM       : origin = 0x1C00, length = 0x2000

Are there any other considerations I need to be aware of?

Thanks,
Ryan

  • Hi,
    By default, LEA shares his 4KB (excluding stack and command memory) of memory with others like DMA and CPU.
    Let say,
    RAM : origin = 0x1C00, length = 0x2000 - LEASTACK_SIZE
    would be more correct. Otherwise you need to disable LEA explicitly to allocate full memory.
    Regards,
    Alexey
  • Hi Alexey,

    I have also removed the LEA STACK memory allocation, by removing the lines below.

    LEASTACK : origin = 0x3C00 - LEASTACK_SIZE, length = LEASTACK_SIZE

    .leaRAM : {} > LEARAM /* LEA RAM
    .leaStack : {} > LEASTACK (HIGH) /* LEA STACK

    Is this what you mean by "disable LEA explicitly"? Does the LEA stack automatically get initialized somewhere on boot?

    Thanks,
    Ryan
  • These definitions are just for a compiler to manage names and address ranges. They do not change anything in a real hardware. The LEASTACK region holds internal data for LEA usage only, including command attributes. Writing anything to this region without disabling LEA module can put system to unpredicted behavior.

    Regards,
    Alexey
  • Ok, so I guess the question now is how can I disable the LEA module? (if possible)
  • Quick follow up.

    I can remove all references in the linker file to LEA and do not get any warnings or errors during compilation. I believe this would indicate that nothing is being placed in the .leaRAM, or .leaStack memory definitions?

    The last thing I want is the LEA to inadvertently overwrite data on the system stack if I don't reserve a region for the LEA stack. Just looking for a confirmation on the behaviour of the LEA if not used in our application.
  • Hi Ryan

    The LEA RAM can be used as the common RAM if you want.Because the operation of LEA need the commands. You can define the RAM to 8K and delete the defines about the LEA_RAM in CMD file.

    Best regards
    Gary

**Attention** This is a public forum