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.

AM5728: How to declare one special data memory buffer on specific memory address?

Part Number: AM5728

Hello experts.

I have two simple question about memory allocation.

Question ::

I'd like to allocate(declare) one special data memory buffer on specific memory address in DDR.

(ex. The start address of memory buffer is 0x8800 0000 and the end address is 0x8810 0000.

       SBL and my application read and write to this memory buffer by pointer) 

I'm worried if compiler allocates some memory in here...(such as stack or data memory).

So then, What should I do for this? How do I allocate(declare) this memory buffer?

System configure and usage

- Using IDK5728

- Board Init is done by SBL(default ddr initialize, io initialize)

- Application, SBL and pci-e access to this memory buffer.

- Application is running on MPU0 same as SBL.

- Based on RTOS or Baremetal.

Please help me...

Have a nice day and thanks.

  • You can use #pragma or __attribute__ keyword to define the Data buffer in your code and then allocate the section to your start memory by creating a section in the linker command file.

    For example refer to how this is done in SBL for the MMU tables. the file sbl_startup.c (pdk_am57xx_1_0_xx\packages\ti\boot\sbl\soc\am57xx) define the attribute and this is then placed in a certain memory section using linker command file linker.cmd (pdk_am57xx_1_0_xx\packages\ti\boot\sbl\board\evmAM572x\build)

    Code:
    __attribute__((section("SBL_MMU_TABLE")));

    Linker script:

    MEMORY
    {
    MMU_TABLE (RW): org = 0x40370000, len = 0x10000 /* OCMCRAM1 region meant to hold MMU table */
    }


    SBL_MMU_TABLE :
    {
    *(SBL_MMU_TABLE*)
    } > MMU_TABLE


    Hope this helps.

    Regards,
    Rahul
  • Thank you a lot.
    After SBL with this process, should I do this process in my application project again?(code, linker)

    Because my application should access to this memory,too.

    Have a nice day and thanks for great answer.

  • Yes, please do it in your application as well so the same memory region is visible to application SBL and app never run at the same time so for same to be reflected in the application you need to have the same define/ memory defined.