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: PRU access to SDRAM

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

Tool/software: TI-RTOS

Hi,

I'm tryign to write a data to EMIF0 SDRAM memory by PRU and it dosen't work. I tried it on L3 OCMC0 and everything work fine. This is how I tried to do it:

On the ARM processor I use this code to generate a pointer pointing into EMIF0 SDRAM :

 x  = (uint32_t *)0x800230d0;

On the PRU side I tried to write 199 into that memory section:

int *addx = (int *)0x800230d0;
*addx = 199;

After all on ARM I read the adress by:

    UART_printf("%x\n", *x);

And I get only 0 and terminal. Does PRU proc have connection to EMIF0 SDRAM? Cos whe i tried L3 OCMC0 memory everything work fine, can I use this memory instead of EMIF0 SDRAM?

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

    Did you clear bit 4 (STANDBY_INIT) of SYSCFG register for enabling OCP master ports? The PRU accesses the external Host memory map through the Interface/OCP Master port.

    Also check the thread e2e.ti.com/.../233891

    You certainly can use OCMC0 if there is no conflict with other drivers in your application.

    Regards,
    Garrett
  • Yes I have cleared STANDBY_INIT and my PRU is able to write under EMIF0 SDRAM, but the problem occure after the ARM core write to the same memory adress and after write it blocks the memory adresss from PRU and it can't write to it anymore. What is cosing the main procesor to block the PRU?? Thank you for your respone

  • Ok I solved it by setting in the cfg file MMU to sherable. You need to mark it so ARM wont block the PRU access. I also add this code into cfg:

    // For Cortex-A8
    var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');

    var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');

    // Enable the cache
    Cache.enableCache = true;

    // Enable the MMU (Required for L1/L2 data caching)
    Mmu.enableMMU = true;

    // descriptor attribute structure for marking the memory region
    // as normal cacheable memory (write-back and write-allocate)
    var attrs = {
    type: Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
    tex: 0x1,
    bufferable: true, // bufferable
    cacheable: true, // cacheable
    shareable : true, <--------------------------------------------------------------------- U NEED TO ADD THIS THING
    };

    // Set the descriptor for each entry in the address range
    for (var i=0x80000000; i < 0x90000000; i = i + 0x00100000) {
    // Each 'SECTION' descriptor entry spans a 1MB address range
    Mmu.setFirstLevelDescMeta(i, i, attrs);
    }

    var memmap = Program.cpu.memoryMap;
    var DDR = null;

    // Find DDR in memory map
    for (var i=0; i < memmap.length; i++) {
    if (memmap[i].name == "DDR") {
    DDR = memmap[i];
    }
    }

    // Place the MMU table in the DDR memory segment if it exists
    if (DDR != null) {
    var sectionName = "ti.sysbios.family.arm.a8.mmuTableSection";
    Program.sectMap[sectionName] = new Program.SectionSpec();
    Program.sectMap[sectionName].type = "NOLOAD"; // NOINIT for TI Tools
    Program.sectMap[sectionName].loadSegment = "DDR";
    }
    else {
    print("No DDR memory segment was found");
    }


    IMPORTANT TO REMEMBER ABOUT "shareable: true"
  • rafal,

    Thanks for sharing your finding! This can be associated with the thread - e2e.ti.com/.../2420346

    for reference.



    Regards,
    Garrett

  • Thank you very much I will look into the thread