• TI Thinks Resolved

Linux/K2GICE: PRU Memory access using Linux

Part Number: K2GICE

Tool/software: Linux

Hello

I am trying to access PRU shared Memory from Linux Application using uio_module_driver. I have modified the device tree to list the pru using uio. 

I am using the modified device tree - keystone-k2g-ice-pru-excl-uio.dtb.

I am able to access the registers of PRU and have wriitten program in pru iram to write data to shared memory and ocmc ram. 

I am using Icek2gv2 board along with sdk 04_03_00_05. 

My linux application is reading back value '0' instead of values written by the PRU. I have checked the running state of PRU.  

Kindly let me know what could be wrong.

Thanks.

  • In reply to Nick Saulnier:

    Hello Nick,

    I am accessing few registers in the devmem2 which return the default values as mentioned in the device datasheet.

    Before accessing the pru shared memory, I am also accessing few configuration registers. Upon reading them, I see that they return the default values.

    I do not know any other tool to access the memory locations and check if the values are actually written or read from it. If you have any suggestions then I can try it.

    Regards
    Manish Jain
  • In reply to Manishkumar Jain:

    Hello Manish,

    Here's example firmware I wrote using devmem2 to read PRU0 DRAM0 and shared RAM locations to see if my PRU firmware was actually writing to that memory:

    /* test reading PRU DRAM0 and shared RAM from command line */
    #define TESTA    (*((volatile unsigned int *)0x100))
    #define TESTB    (*((volatile unsigned int *)0x110))
    #define TESTC    (*((volatile unsigned int *)0x10120))
    #define TESTD    (*((volatile unsigned int *)0x10130))
    
    void main(void)
    {
    	TESTA = 0xA0A0A0A0;
    	TESTB = 0x0B0B0B0B;
    	TESTC = 0xCCCCCCCC;
    	TESTD = 0xD0D1D2D3;
    }

    this was my output: 

    Regards, 

    Nick

  • In reply to Nick Saulnier:

    Hello Manish,

    I'm going to mark this resolved. Please let us know if you have further questions.

    Regards,
    Nick