Allocating memory in MCU+ projects#

MCU+ projects define memory allocations in the linker command file. The memory allocations in the linker command file must align with the Linux devicetree file.

Note

The information on this page ONLY applies to SDK 9.1 or later! If you are using AM64x SDK 9.0 or earlier, please refer to the SDK 9.0 version of the AM64x academy. Here are the steps to access the SDK 9.0 version:

On the Left-hand menu, hover your mouse over “AM64x Academy”. Three dots will show up to the right of the label. Click on the 3 dots, and go to “Manage Versions”. Select AM64x Academy, Version 9.00.00.00 v2.

In the Left-hand menu, you should now see “AM64x Academy - 9.00.00.00 v2”

MCU+ projects define the memory used by the MCU+ core in the linker command file. The memory allocations in the Linux devicetree file must align with the memory allocation in the MCU+ linker files.

Starting in AM64x MCU+ SDK 9.1, project memory settings are configured in the SysConfig Memory Configurator tool. Memory Configurator tool settings for each core are saved in the project’s example.sysconfig file. Then, during a build command, the example.sysconfig data is used to generate the project’s linker command file during the make process.

For more information about the Memory Configurator tool, refer to the MCU+ SDK Memory Configurator documentation.

For information about managing memory configurations directly in a linker command file instead of using the Memory Configurator tool, refer to section By-passing Sysconfig generated Linker.

The memory configurator changes how build commands work with system projects. For more information, refer to section Projects with shared memory must be built as a system project.

Note

The MCU+ linker command files only define memory regions that are directly used by the MCU+ project. However, the Linux devicetree file defines all memory regions that are in DDR or on-chip SRAM (OCSRAM), regardless of whether Linux actually uses that memory region. Why is that?

The MCU+ code will never try to use memory that was not specifically given to it in the project settings. However, the Linux operating system assumes that it can use any part of DDR or SRAM that is not specifically reserved. Thus, we must define all DDR or SRAM regions that are used by the remote cores in the Linux devicetree. This prevents Linux from overwriting the data in those memory regions.

Adding new memory allocations#

Additional memory allocations can be added if a core needs additional memory, if a shared memory region is defined to pass large amounts of information between cores, etc.

For an example of how to add a shared memory region to pass large amounts of data between cores, reference How to use a shared memory region with RPMsg IPC.