Part Number: K2GICE
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.
In reply to Nick Saulnier:
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Manishkumar Jain:
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))
TESTA = 0xA0A0A0A0;
TESTB = 0x0B0B0B0B;
TESTC = 0xCCCCCCCC;
TESTD = 0xD0D1D2D3;
this was my output:
Thanks for your reply.
I am using the below device tree for my system.
I am loading the pru program with uio driver module into PRUs.
When try to access the pru memory I am getting the issue with bus error.
I am doing the following on my system:
1. Load the device tree with the below mentioned dts file.
2. Run a user application which loads PRU program and enable the PRU both using uio-module driver.
3. Access the shared memory and data memory using uio-module driver - This results in segmentation fault.
Alternatively, when I try to access the access the PRU memory through the tool mentioned above, I get the Bus Error at that memory location.
I would kindly request you to share with me the device tree which you used along with method to load code into PRU.
I am sorry this response took so long - future responses will be faster. Let me know if you are still working on this issue.
Glancing through, your code does not look too different from the template.
I typically load PRU firmware using RemoteProc (since TI does not support UIO for a general purpose use case). You would need to make sure that your device tree was not disabling the pruss_soc_bus[0,1] and all the subnodes which are created in keystone-k2g.dtsi. keystone-k2g-evm.dts would be a good example of how to set up the device tree appropriately.
Information on RemoteProc can be found here.
and an example of using it to load firmware is here. (the example is am335x, but k2g should work similarly)
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.