nparafe has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
nparafe has joined #beagle
nick12310 has joined #beagle
nick12310 has quit [Quit: Client closed]
vagrantc has quit [Quit: leaving]
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #beagle
Shadyman has joined #beagle
nick12310 has joined #beagle
vigneshr has joined #beagle
<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]
ft has quit [Remote host closed the connection]
ft has joined #beagle
brook_ has quit [Ping timeout: 268 seconds]
brook has joined #beagle
vagrantc has joined #beagle
nparafe has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
nparafe has joined #beagle
nick12310 has joined #beagle
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> and I can use it via py-uio: https://pastebin.com/Z1Edinbd
<nick12310> I just get "ls: cannot access '/dev/uio/pru-shmem': No such file or directory" . I can access dev, but no /dev/uio exists for me
<zmatt> does /dev/uio0 exist?
<zmatt> what kernel are you using?
<nick12310> no
<zmatt> (and what debian image?)
<nick12310> 4.19.94-ti-r42
<nick12310> Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 armv7l GNU/Linux
<zmatt> try: grep PRUSS_SHMEM /boot/config-$(uname -r)
<nick12310> CONFIG_UIO_PRUSS_SHMEM=m
<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?
<zmatt> py-uio can load the exact same executable
<zmatt> which includes testing shared memory
<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> I'm trying to adapt the ddr-ping.py to what I have for my pru code. This my pru code that I compile https://pastebin.com/jb6kDvyD, and this is the ddr-ping.py https://pastebin.com/Kmkr2jGx
<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)
<zmatt> nick12310: https://pastebin.com/WM0aU8M8 a summary of shared memory access using py-uio