On Feb 28, 2018, at 6:47 AM, TJF <jeli.f...@gmail.com> wrote:When you allocate the array from user space the memory may be not continuous. To get a single block, you have to allocate from kernel space.
The most easy way: drop rproc, instead use libprussdrv. The uio_pruss kernel driver allocates external memory, which you can fill by the C code and read from the PRU code. (Note: PRU access to ARM memory isn't as fast as DRam or SRam, needs at least 3 cycles - AFAIR.)
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/f1a1ca96-a613-4b16-9788-427a21bf8ceb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is not a true statement. The kernel uses virtual memory just like user space does. The memory is only contiguous in physical memory if you use kmalloc. If you use vmalloc, the memory can be fragmented in physical memory.On Feb 28, 2018, at 6:47 AM, TJF <jeli.f...@gmail.com> wrote:When you allocate the array from user space the memory may be not continuous. To get a single block, you have to allocate from kernel space.
sudo modprobe uio_pruss extram_pool_sz=0x12500 Hello,
I've been working with PRU0 on the Beaglebone Black (wireless) for a couple weeks now (only a beginner) and have made some hopeful progress towards developing a real time system that will change gpio logic states based on given location data from a pupil-tracking system.
So far I've been using the examples given in the BeagleScope project (found here) to program the PRU using pru_rpmsg, and I'm currently using: Linux beaglebone 4.4.113-ti-r147 #1 SMP Tue Feb 20 20:58:22 UTC 2018 armv7l GNU/Linux
Things are going well!
But I wanted to ask technical support about the simplest way to build a large 1-D array (look up table of ~310,000 indexes of just integers) that can be accessed by PRU0 on the fly to know how to set the gpios when it receives a new set of pupil-location values. Previously I've built this array in userspace from an existing .txt file that is read byte by byte from a C script that builds the array in userspace, but I need that array to be accessible from PRU0. What is the simplest way to do this?
I've looked into trying to build the array in DDR memory (which could in theory be accessed by the PRU using address pointers), but allocating that kind of space to be available to a user space program looks pretty complicated (especially to ME who has never done any kernel space programming). I'm hoping that someone can give me inspiration for a simpler way to get this array to PRU0.
Please get back to me soon! Thank you for reading
Evan Carter
extram_pool_sz=Everything gets easy when you use the matching tools.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/ff1e0d76-008f-42bd-a516-adc1a7feff99%40googlegroups.com.
Hi TJF,I love the work you do and the advise you give. My only purpose was to remove any confusion ;-)Regards,John
This is not a true statement.
Okay awesome, thank you!This weekend I will get a chance to dig into this more. So a lot of the examples I've seen using uio_pruss involve a device tree overlay for gpio pin muxing, I'm comfortable doing that, but I've noticed lately that slots isn't around anymore because I guess a lot of people were messing things up by echoing into it. Should I still be using an overlay to do my pins? Or would something like config-pin work just fine?
TJF and the others were right, I could not find an easy way to do this using rproc, but with uio_pruss it is fairly straight forward. While the suggestions made to help me get this going were surely valid, I found what seemed to be the simplest way for me using the example PRU_memAccess_DDR_PRUsharedRAM found in the am335x_pru_package which I just cloned from here.I was unable to do this before because I did not set up my beaglebone for uio_pruss correctly, and would always get errors when using commands like prussdrv_open(). But from the suggestions in this post I was able to figure out what I was doing wrong, and got uio_pruss set up properly so that I could run this example. The example uses a c script to mmap() a block of memory in DDR and stores 3 values in the first 3 addresses of the mapped memory, then it programs the pru with an assembly file that is compiled with pasm, to simply configure OCP master port, configure one programmable pointer to point at the DDR memory where the 3 values are, and configure another programmable pointer to point to the pru's shared RAM. The pru loads in the three values into 3 of its 32 registers, and then places them in the first 3 address of its 12kB shared RAM. Then the pru halts after interrupting the host c program that it finished, and the c program checks the 3 registers in the shared RAM to see if they are the same values that it originally stored in DDR RAM.
prussdrv_map_extmem(&ERam)
ESize = prussdrv_extmem_size()
EAddr = prussdrv_get_phys_addr(ERam)