The PRU code for hal_pru_generic is here: 
https://github.com/machinekit/machinekit-hal/tree/master/src/hal/drivers/hal_pru_generic

You'll see a number of .p files and they are assembled using pasm, the 
source code for which is also in the machinekit repository: 
https://github.com/machinekit/machinekit-hal/tree/master/src/hal/support/pasm

The copyrights at the top of the pasm source are by TI, so I imagine this 
was copied from somewhere else. I don't see a way to compile the pru code 
down to elf format using pasm, which is what it appears I need in order to 
use remoteproc. Is there another tool I can use to compile/assemble the .p 
files? Alternatively, is there another tool I can use to convert the 
compiled .bin file to an elf file?

On Wednesday, April 8, 2020 at 1:23:48 PM UTC-6, John Allwine wrote:
>
> The hal_pru_generic PRU code is all written in assembly and is compiled 
> down to a .bin file. Copying that bin file to the firmware doesn't work. On 
> the Beaglebone Black the contents of the bin file are copied to the 
> appropriate address in memory in order to load it onto the PRU. What do I 
> have to do to this bin file in order to be able to copy it to 
> /lib/firmare/am57xx-pru1_1-fw (or one of the other 3 pru options) and then 
> start it with remoteproc?
>
> On Wednesday, April 8, 2020 at 12:45:33 AM UTC-6, Jason Kridner wrote:
>>
>> On Wed, Apr 8, 2020 at 12:28 AM John Allwine <[email protected]> 
>> wrote: 
>> > 
>> > Thanks Jason! I’ve found enough info on the pinmux to get me by for 
>> now. hal_pru_generic and the PRUs seem to be the big blocker at this point. 
>> I still need to get my head around the details of hal_pru_generic to know 
>> if using remoteproc would work. How do I use remoteproc to run code on the 
>> PRU? 
>>
>> Check out 
>> https://github.com/beagleboard/cloud9-examples/tree/v2020.01/BeagleBone/AI/pru
>>  
>>
>> PRU start script in the Makefile is at 
>>
>> https://github.com/beagleboard/cloud9-examples/blob/v2020.01/common/Makefile#L164-L167
>>  
>>
>> > 
>> > > On Apr 7, 2020, at 9:57 PM, Jason Kridner <[email protected]> 
>> wrote: 
>> > > 
>> > > On Tue, Apr 7, 2020 at 11:27 PM John Allwine <
>> [email protected]> wrote: 
>> > >> 
>> > >> Is there a UIO PRU driver for the Beaglebone AI? How do I enable it? 
>> I'm trying to be able to talk to the PRUs using hal_pru_generic on the the 
>> Beaglebone AI, which does so on the BBB using the uio_pruss module. On the 
>> AI I see a uio_pruss_shmem module loaded when looking at /proc/modules, is 
>> that the same thing? 
>> > > 
>> > > This custom little uio_pruss_shmem driver will go away as a different 
>> > > existing uio driver can be configured to provide uio shared memory 
>> > > access without interfering with the remoteproc driver's ability to 
>> > > load the PRU code. 
>> > > 
>> > > It is largely the same as the uio_pruss module, but the memory region 
>> > > shared does not include the control registers needed to load code and 
>> > > start/stop the processor. That can be done with the remoteproc 
>> > > mechanisms. 
>> > > 
>> > > Will this work for you? 
>> > > 
>> > > BTW, sorry I never got back to you on the pinmux stuff. It keeps 
>> > > dropping from my plate as I seem to always have something more urgent 
>> > > to do at any given moment. Can you throw a meeting time on my 
>> calendar 
>> > > if you still need this and we can make it a live working session? The 
>> > > pinmux thing isn't complicated, but I have to look around in a bunch 
>> > > of places to gather the right bits. 
>> > > 
>> > >> 
>> > >> I can run the following commands on the AI: 
>> > >> 
>> > >> cat /sys/class/uio/uio0/maps/map0/addr 
>> > >> 0x4b200000 
>> > >> 
>> > >> cat /sys/class/uio/uio0/maps/map0/size 
>> > >> 0x00020000 
>> > >> 
>> > >> cat /sys/class/uio/uio1/maps/map0/addr 
>> > >> 0x4b280000 
>> > >> 
>> > >> cat /sys/class/uio/uio1/maps/map0/size 
>> > >> 0x00020000 
>> > >> 
>> > >> The size on both of those seem small as the PRUSS_INTC region starts 
>> at 0x00020000 according to the AM572x Technical Reference Manual on page 
>> 418 (and on the Beaglebone Black the PRU uio size is 0x00080000). 
>> > >> 
>> > >> Anyway, I'm not very familiar with things at this level, so I may 
>> not be phrasing my questions well, but any help is appreciated! 
>> > >> 
>> > >> -- 
>> > >> 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 [email protected]. 
>> > >> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/02eb6681-dcac-4ad2-a45c-fa27a2e346f3%40googlegroups.com.
>>  
>>
>> > > 
>> > > 
>> > > 
>> > > -- 
>> > > https://beagleboard.org/about - a 501c3 non-profit educating around 
>> > > open hardware computing 
>> > > 
>> > > -- 
>> > > 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 [email protected]. 
>> > > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/CA%2BT6QPnMrcQTc8jFkoGncpMZ18O7eSQf_Wm5Bw2KH4PMUFhsrA%40mail.gmail.com.
>>  
>>
>> > 
>> > -- 
>> > 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 [email protected]. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/396383D5-0B85-40C4-84D3-1AC9FAE2BF29%40allwinedesigns.com.
>>  
>>
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/6bb3d1f9-2d4c-441e-b10f-abe94017ed66%40googlegroups.com.

Reply via email to