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.

[FAQ] PROCESSOR-SDK-DRA8X-TDA4X: How to add new memory section in vision apps?

Part Number: PROCESSOR-SDK-DRA8X-TDA4X

Vision apps currently reserves 15MB memory for code section of each core remote cores. The 15MB is enough for code section, but many times, application requires more memory for storing static objects. In this cases, it is better to allocate a separate section in the memory and move this static objects to this newly created section. This article explains how to add new section in the vision apps memory map.

  • The memory map used in the vision apps can be found in HTML format in the file V:\vision_apps\apps\basic_demos\app_tirtos\tirtos_linux\system_memory_map.html for the Linux and V:\vision_apps\apps\basic_demos\app_tirtos\tirtos_qnx\system_memory_map.html. The link, downloads.ti.com/.../developer_notes_memory_map.html, explains different memory sections available and how it can be updated in vision apps. It also explains how python based tool PyTI can be used to update the memory map. This article extends it and helps to add new memory section.
    There are multiple ways of adding a new memory section in vision apps memory map. Below explains how to do it by creating a new 'temp' section on Mcu2_0

    1. Allocating section from the Vision Apps Core Heap: As we can see in the memory map file, vision apps allocates heap heap and scratch memory for each core and the size of this total memory is around 736MB. This entire 736MB is mapped as a single entry in the DTS file. In this method, a separate section could be created by reducing the size of the heap or scratch memory of one of the core. This method does not require any change in the Linux DTS file, as new section is still part of the vision apps heap section. Attached patch 'Added_16MB_Temp_Sect_From_C7x_Scratch_Mem.patch' creates a new section temp on mcu2_0 by reducing size of the C7x scratch memory.
    2. Allocating section from Frame Buffer: as we can see in the memory map file, that currently vision apps alloctes 512MB memory as buffer memory. This entire 512MB is mapped as a 'vision_apps_shared_region' single entry in the Linux DTS file. In this method, a separate section could be created by reducing the size of the frame buffer memory. Although it reduces the buffer memory, but still same DTS entry with 512MB can be used on Linux. The idea is to create separate section, but still use entire 512MB on Linux. This does not require change in the Linux DTS file. Attached patch 'Added_16MB_Temp_Sect_From_Frame_Buffer.patch' creates a new section temp on mcu2_0 by reducing size of the frame buffer memory.

    Once the new section is created, as explained in the developer note, run the command ./gen_linker_mem_map.py to generate new memory and generate all relevant linker command file. Once the new section is carved our, the sysbios method "__attribute__ ((section("temp")); " could be used to redirect specific object this newly created section.

    Regards,

    Brijesh