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.

RTOS/PROCESSOR-SDK-AM335X: Memory configuration

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3359, SYSBIOS

Tool/software: TI-RTOS

Using the Ti-RTos system with the AM3359 processor.  As the unit has 512Meg of memory (BeagleBone Black), I would like to setup Ti-Rtos to use all free memory after the application as Heap memory.  I tried adding into the cfg file a BIOS.heapsize/Memory.defaultHeapSize to 256Meg.  But looking at the memory map, I see it places the memory in the BSS section, which in itself would not be an issue except the system initializes the BSS section on powerup, which clearing 256Meg takes a while.

Any Help, on how to move the memory so it is not initialized on powerup and not make the bin file 256Meg in size.

Robert

  • The RTOS team have been notified. They will respond here.
  • Robert,

    Please give this configuration a try and let me know if this works.

    var heap1 = HeapMem.create();
    heap1.size = 256*1024*1024; // 256MB
    heap1.sectionName = ".myHeapSect";
    Memory.defaultHeapInstance = heap1;
    
    Program.sectMap[".myHeapSect"] = new Program.SectionSpec();
    Program.sectMap[".myHeapSect"].loadSegment = "DDR3";

    //For TI compilers you can add.
    Program.sectMap[".myHeapSect"].type = "NOINIT";  //Only used with TI compilers.
    
    
    
    
    




  • NOPE, this just creates a 256M+ bin image.

    Here is what is in cfg file:

    var heap1 = HeapMem.create();
    heap1.size = 256 * 1024 * 1024;
    heap1.sectionName = ".myHeapSect";
    Memory.defaultHeapInstance = heap1;

    Program.sectMap[".myHeapSect"] = new Program.SectionSpec();
    Program.sectMap[".myHeapSect"].loadAddress = 0x8FF00000;
    Program.sectMap[".myHeapSect"].type = "NOLOAD";

    Looking at a generated Map file, you can see it is placing the ".myHeapSect" before the ".bss" section.

    .far:NDK_MMBUFFER
    0x80198980 0x1e460
    .far:NDK_MMBUFFER
    0x80198980 0x1e460 /Build/package/cfg/app_pa8fg.oa8fg
    0x80198980 ti_ndk_config_Global_pitBuffer
    0x801b6980 ti_ndk_config_Global_pit

    .myHeapSect 0x801b6de0 0x10000000
    .myHeapSect 0x801b6de0 0x10000000 /Build/package/cfg/app_pa8fg.oa8fg
    0x801b6de0 ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A

    ti.sysbios.family.arm.a8.mmuTableSection
    0x901b8000 0x4000
    ti.sysbios.family.arm.a8.mmuTableSection
    0x901b8000 0x4000 /Build/package/cfg/app_pa8fg.oa8fg
    0x901b8000 ti_sysbios_family_arm_a8_Mmu_Module_State_0_tableBuf__A

    .heap 0x901bc000 0x0
    0x901bc000 __heap_start__ = .
    0x901bc000 end = __heap_start__
    0x901bc000 _end = end
    0x901bc000 __end = end
    0x901bc000 . = (. + __HEAP_SIZE)
    0x901bc000 __heap_end__ = .
    0x901bc000 __HeapLimit = __heap_end__

    .bss 0x901bc000 0x7cddc
    0x901bc000 __bss_start__ = .
    *(.shbss)
    *(.bss)
    .bss 0x901bc000 0xc obj/main.o
    .bss 0x901bc00c 0xa0 obj/globalConfig.o
    0x901bc0ab ethernetConfig

    So still no luck.

    Robert
  • Ok, did see something I did not forgot to fix, but still same issue:

    Corrected cfg file:

    var heap1 = HeapMem.create();
    heap1.size = 256 * 1024 * 1024;
    heap1.sectionName = ".myHeapSect";
    Memory.defaultHeapInstance = heap1;

    Program.sectMap[".myHeapSect"] = new Program.SectionSpec();
    Program.sectMap[".myHeapSect"].loadSegment = "DDR3";
    Program.sectMap[".myHeapSect"].type = "NOINIT";

    Robert
  • Fixed:

    What I did:

    var heap1 = HeapMem.create();
    heap1.size = 256 * 1024 * 1024;
    heap1.sectionName = ".stack";
    Memory.defaultHeapInstance = heap1;

    This placed the heap at the end of the .stack section.

    Then used the "--remove-section=.stack" option to tell objcopy not to put the .stack section into the binary file. Now, the binary file does not include the heap area, and the rtos does not try to initialize it as it did when it was in the .bss section (Default place).

    Robert
  • Robert,

    Thanks for posting the solution. That is a neat trick that I will use in the future :)

    Regards,
    Rahul