I am new to the PRUSS. And I am trying to make baby steps into getting where i want to be.
My first goal is to physically measure GPIO's (as outputs) , driven by the PRU. Meaning I am creating a gpioToggle example which is missing for am335x.
I have done many experiments on the code to try and get the GPIO's working, but remain unsuccessful.
I have the am335x specsheet. the PRUv1 examples and the PRUv2 examples.
I am able to compile/load/run PRU binaries from the PRUv2 examples
https://github.com/beagleboard/am335x_pru_package/
There are many magic numbers in the old gpioToggle example without an explanation or how they can be found/calculated. (some I can understand, and most I don't)
E.g.
Some super basic stuff like:
Where can i find the logic of using the internal muxer to couple a GPIOx_x to R30?
//PRU1_R30[15]
M_MOV32 R0, SYS_BASE
LBBO R1, R0, PINMUX12, 4
AND R1.b0,R1.b0,#0xF0
OR R1.b0,R1.b0,#0x04
SBBO R1, R0, PINMUX12, 4
this actually means:
-load (sys_base + pinmux12 offset)
- do & 0xF0
- do | 0x04
-store.
I do not understand the values chosen, nor can I map them to the AM335x CPU/PRU: sys_base, pinmux, 0xF0, 0x04.
(I already found that STANDBY_INIT should be set to 0)
Perhaps instead of me trying to convert these files:
Is it possible for you to port the gpioToggle example from the old PRU to the new PRUv2 for AM335x?
If you could add enough comments (for all the magic numbers) so that I can understand the origin/calculation, then perhaps I could be able to continue on my own.
My second goal is to generate interrupts PRU2ARM by GPIO's (as inputs), but that is a separate topic if needed :-)
Thanks in advance.