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.

How to modify the Memory Map using the cfg file?

I have found lots of information on adding Memory Sections to a xconfig file, but am having a hard time understanding how to add a new Memory Map.

I have some external devices that I would like to define and some internal registers so that I can use DATA_SECTIONS pragma to assign variables to them.

I tired to use the GUI to add a Program/Memory Sectuion Placement and add a "Avilable Memory Segments, it created the following code that produces the following error: "Cannot set property "base" of undefined to "167721600".

Thanks,

var execontextInstance0 = xdc.lookup('xdc.platform.ExeContext.Instance#0');

execontextInstance0.memoryMap["ms_1553_ram"].base = 0x64000000;

execontextInstance0.memoryMap["ms_1553_ram"].len = 0x00020000;

execontextInstance0.memoryMap["ms_1553_ram"].access = "RW";

execontextInstance0.memoryMap["ms_1553_ram"].name = "ms_1553_ram";

  • I did firgure out how to make a new platform and was able to add the memory map succesfully that way.

    That still leaves the question, How/Can you modify the memory map using the xdcscript?

    Thanks,

  • Mike,
    the memory map cannot be changed in the cfg script. The reason is that there are multiple packages involved in a configuration (BIOS, IPC, cfg script as a part of a special package, NDK, possibly others), and each of these packages could contain some logic that depends on the content of the memory map. Therefore, the map must be sealed as soon as any of the packages had a chance to read it, which could be the first statement in the CFG script.

    So, it has to be done in the platform package, which gets loaded before the CFG script starts. There is another way to change the map by using the file config.bld, which also runs before the CFG script, but that's a textual file that you have to edit manually. Users generally don't like that so we don't advertise it. So, these are the options - the Platform Wizard or config.bld.