<nick12310>
I'm trying to move data from the PRUs to the am335x processor. I found on the am335x pru reference guide that there is shared memory at address 0x0001_0000 for the prus, I have a set up to write to that memory location on my pru code. How can I verify that it is writing and then read/write that memory from the command line or with a c program on
<nick12310>
the am335x host processor end?
nick12310 has quit [Quit: Client closed]
jfsimon1981 has quit [Quit: Leaving]
jfsimon1981 has joined #beagle
Shadyman has quit [Remote host closed the connection]
vigneshr has quit [Quit: Connection closed for inactivity]
<nick12310>
I asked yesterday but got no response yet, how do I configure and access the memory on my arm am335 processor to communicate and check the memory I'm writing to with my pru? I am writing to address 0x00010000 on my pru, which is designated as the shared, but not sure how to access that on the other end
<zmatt>
nick12310: in general by mmap()ing an uio device. afaik that's still the solution used even when using remoteproc-pru (which I don't use personally, but is the default nowadays)
<zmatt>
are you using uio-pruss or remoteproc-pru ?
<nick12310>
remoteproc
<zmatt>
for uio-pruss, my py-uio library (https://github.com/mvduin/py-uio) makes it particularly easy to use shared memory... for remoteproc I'd need to dig for a moment to check what they created
<zmatt>
since remoteproc kinda sucks and afaik doesn't provide shared memory support :P
<zmatt>
yeah, when using remoteproc there's a /dev/uio/pru-shmem device
<zmatt>
which gives direct access to all three pruss memories (dram0, dram1, dram2)
<nick12310>
Hmm. Ok I will try installing py uio/uiopruss and use that, kinda been going with remoteproc because TI says to use it and their drivers, but it does seem like I have to hack something together to try and get it to work
<zmatt>
so, if you're using remoteproc you can still use the /dev/uio/pru-shmem device (with py-uio or C code) to access pru shared memory
<nick12310>
should I be able to access /dev/uio/pru-shmem by default? I can't see that device in directory
<zmatt>
hmm? it exists on my beaglebone (after switching from uio-pruss to remoteproc-pru)
<zmatt>
hm, okay odd, then I don't really know why the device doesn't exist for you... though I am actually running a slightly newer kernel myself, 4.19.94-ti-r72
<zmatt>
you could consider switching to uio-pruss and use py-uio to load your executable... there's not really any benefit to remoteproc-pru, it doesn't do anything *useful* that you can't do via uio-pruss (and uio-pruss can do much that remoteproc-pru doesn't)
<zmatt>
I guess remoteproc-pru may be useful when pru firmware is used in cooperation with a kernel driver rather than with in cooperation with userspace code
<zmatt>
when using uio-pruss, py-uio can be used to control and inspect pruss, including reading/writing/mapping pruss memory and pruss peripherals, loading code onto cores, running and halting cores, inspecting/modifying cpu registers when halted, single-stepping/debugging cpu cores
<zmatt>
documentation is unfortunately rather lacking, but it does have a bunch of examples and I'm here for questions
<nick12310>
Alright then. I'm installing it now, thanks for the help so far
<zmatt>
and py-uio supports loading both raw binaries as produced by pasm (the pru assembler that still has features that clpru doesn't) as well as ELF executables produced by clpru
<nick12310>
So I had my remoteproc pru code that toggled pins on and off and wrote to memory, is there an easy way to port that to uio pruss code , or how would I do those same things with the uio pruss?
<nick12310>
So in that case, I can take my compiled am335x-pru0-fw file from /lib/firmware/ and just load with python script?
<zmatt>
yep that should work
<zmatt>
unless the program uses remoteproc features not supported by py-uio, such as rpmsg
zjason`` has joined #beagle
zjason` has quit [Ping timeout: 268 seconds]
vagrantc has quit [Quit: leaving]
<nick12310>
So I think I'm either writing to the wrong memory or not writing to memory in my pru code, what is the address that py-uio reads from for shared memory?
<zmatt>
nick12310: ehh what do you mean? py-uio can read from anywhere in pruss memory
<nick12310>
it write/read from address 0x10000 in both, I thought, but when I run, it doesn't pass the ping
<zmatt>
nick12310: ddr-ping as the name implies is about using ddr memory, not pruss memory
<zmatt>
elf-test.py is a good example of accessing pruss memory
<zmatt>
lol why the hell does elf-test.py import struct, it doesn't use it
<nick12310>
So what exactly is an elf file?
<zmatt>
ELF is the file format produced by clpru
<zmatt>
it's a common file format for compiled code, also used for linux executables and libraries
<zmatt>
nick12310: btw I just pushed a small fix to github (turned out the read()/write()/fill() methods were not implemented on the pruss object itself, so I quickly implemented those)