MarkAYoder / PRUCookbook

This is a cookbook of the Programmable Realtime Unit on the BeagleBoard
66 stars 38 forks source link

neo4.pru1.c #20

Closed MaBecker closed 2 years ago

MaBecker commented 2 years ago

Hi,

neo4.pru0.c and neo4.pru1.c build without any issue.

# turning neopixel on and off via /dev/rpmsg_pru30 work's
echo 10 10 10 0 > dev/rpmsg_pru30 ; echo -1 > /dev/rpmsg_pru30

# turning neopixel on and off via /dev/rpmsg_pru31 has no efffect
echo 10 10 10 0 > dev/rpmsg_pru31 ; echo -1 > /dev/rpmsg_pru31

active entries in uEnv.txt

grep ^[^#] /boot/uEnv.txt
uname_r=4.19.94-ti-r42
enable_uboot_overlays=1
disable_uboot_overlay_video=1
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
enable_uboot_cape_universal=1
cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

check P9_29 used by neo4.pru0.c and P9_16 used by neo4.pru1.c

config-pin -q P9_29
Current mode for P9_29 is:     pruout

config-pin -q P9_16
Current mode for P9_16 is:     default

config-pin  P9_16  pruout
ERROR: write() to /sys/devices/platform/ocp/ocp:P9_16_pinmux/state failed, No such device

What am I missing to make the second neopixel strip via pru1 work too?

MarkAYoder commented 2 years ago

I assume you are working with a BeagleBone Black, rather than the BeagleBone AI. The code in neo4.pru0.c is for the Black, the code in neo4.pru1_1.c is for the AI. If you want to run on pru1 on the Black I suggest modifying the neo4.pru0.c code. I think it will use P8_46 for the output.

--Mark

MaBecker commented 2 years ago

Hi Mark,

yes tried that code on a BBB. Like to drive two neopixel stripe, one via pru0 and the other via pru1 - if possible.

After reading the BeagleBone Cape Header Pins.xlxs found pru1 out pins and will try them,

Bildschirmfoto 2022-01-05 um 13 19 39

KR Mark

Edit: added link to excel sheet

MaBecker commented 2 years ago

Added some pru 1 pins on P8 to /var/lib/cloud9/prugpio.h

git diff common/prugpio.h
diff --git a/common/prugpio.h b/common/prugpio.h
index f4441f6..38a3831 100644
--- a/common/prugpio.h
+++ b/common/prugpio.h
@@ -147,6 +147,20 @@
 // R31 input bits on pru1
 #define P9_26   (1<<16) /* input */

+// R30 input/output bits on pru1
+#define P8_27   (1<<8)
+#define P8_28   (1<<10)
+#define P8_29   (1<<9)
+#define P8_30   (1<<11)
+#define P8_39   (1<<6)
+#define P8_40   (1<<7)
+#define P8_41   (1<<4)
+#define P8_42   (1<<5)
+#define P8_43   (1<<2)
+#define P8_44   (1<<3)
+#define P8_45   (1<<0)
+#define P8_46   (1<<1)
+
 // R30 output bits on pru0 on Pocket
 #define P1_36   (1<<0)
 #define P1_33   (1<<1)

just had to change the out pin to make it work with pru1 on BBB.

good to close ;-)