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.

CCS/TMS320C6678: how to get the DDR base address & size info in sysbios?

Part Number: TMS320C6678

Tool/software: Code Composer Studio

as far as I know, the RTSC platform like evmc6678 provide the information about the DDR base address and size. And I have created different  RTSC platforms for different custom boards with different DDR size configuration.

How can I use C code to get the DDR size or more information that is provided by RTSC platform?

  • Hi,

    I've notified the RTOS team. Their feedback will be posted here.

    In the mean time you can inspect the C6678 gel file for hints.

    Best Regards,
    Yordan
  • the platform definition in TI RTOS is used to create a linker command file that gets used when the application is being linked to created the application binry. I don`t think there is a way to read this from C code.

    I am moving this to the TI RTOS forums to see if they are able to provide any inputs regarding this issue.

    Regards,
    Rahul
  • Hello Canfoderiskii,

    As mentioned by Rahul the linker files are dynamically generated from platform defination file in XDC.
    One way I can think of is map user defined data section at the start of DDR and get the address of this section from C code (by putting some variable in this section and getting address of that variable)

    I will still wait for other RTOS experts to comment if there is any other way.

  • canfoderiskii,
    can you give some more details? Are you providing a platform to a third party, or you are also writing the CFG script and building the app that uses the platform? Is the source code that should have access to the DDR base in the app or in a library?
  • hi, Sasha.

    1. I don't provide platforms to any third party.I only use them for myself.
    2. I truly write CFG script and build the app based on those platforms.
    3. I tried to add some DDR testing codes here, so I have to access the DDR address.
    4. I have different custom board with different size of DDR, so I create several platforms for those boards based on the platform 'evmc6678'.
    5. I want to make the DDR testing codes be portable between those custom boards. so I am wondering in C code if there is a way to read the DDR information that is already written once when I create a RTSC platform.
  • In that case, the easiest approach is to create global symbols in your CFG script:
    if ("DDR3" in Program.cpu.memoryMap) {
    Program.global.DDR3_BASE = Program.cpu.memoryMap["DDR3"].base;
    Program.global.DDR3_SIZE = Program.cpu.memoryMap["DDR3"].len;
    }

    Now, you have to include <xdc/cfg/global.h> in your C sources, and you should be able to use DDR3_BASE and DDR3_SIZE. They are defined in that header file:
    #define DDR3_BASE 0x80000000
    #define DDR3_SIZE 0x20000000
  • thank you very much. it works.