I tried adding CT_CFG.SYSCFG_bit.STANDBY_INIT = 0; and the pin still isn’t toggling. The PRU does fortunately report that it is running with no errors. I think the issue has something to do with the device tree.
[ 8284.303172] rproc-virtio rproc-virtio.2.auto: .kick method not defined for 4a334000.pru
This error is due to a missing patch in kernel 6.18 (I tried it on 6.18.23-arm64-k3-r31). If you require RPMSG, I recommend to use kernel 6.12.57-ti-arm64-r59, which has it.
I wouldn’t be surprised at all…
Pinmuxing has everybody stumped; you’re not alone.
@dinux Is that patch included in the latest 7.0 kernel build?
I did get the PRU code to run, but I ended up using the __R30 method and then configuring the device tree. It is nice to have precise 5ns timing.
I used the following dtso:
*
* Configure PRU i/o pins
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
BB-PRU-PIN2-CONFIG.kernel = __TIMESTAMP__;
};
};
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
&ocp {
P9_27_pinmux { status = "disabled"; }; /* mcasp0_fsr */
};
&am33xx_pinmux {
bb_pru_pins: pinmux_pru_pru_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_MCASP0_FSR, PIN_OUTPUT_PULLDOWN, MUX_MODE5) /* P9_27 PRU0 pr1_pru0_pru_r30_5 output */
>;
};
};
&pruss {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_pru_pins>;
};
I don’t see the patch in mainline v7.0.0, so it’s probably missing in bbb.io-kernel-7.0-k3.
@dinux This is on the beaglebone black, but I installed 6.12.34-ti-arm32-r12 kernel and it apparently doesn’t contain that patch. The patch is specific for the RPMsg which I do want to use, but that 6.12.34 kernel also has another issue where “IRQ vring not found” is another error I get when trying to use RPMsg.
Please switch to:
bbb.io-kernel-6.12-bone or bbb.io-kernel-6.18-bone apt meta package, the 6.12.x-ti (arm32) branch has been abandoned. As almost 100% of am335x is mainline vs 6.12.x-ti and i got tired of TI not testing am335x and breaking basic things..
Regards,
@RobertCNelson I switched, but we still need the patch mentioned by @dinux. Without the patch RPMsg won’t work on any of the newer builds, which leaves using shared memory for sending data between the ARM, and the PRU. Maybe there’s another way to do this on a BBB?
Okay testing right now: test: remoteproc: pru: Add support for virtio rpmsg stack (8a96d813) · Commits · Robert Nelson / bb-kernel · GitLab
give ci a few minutes..
Okay up, please give this a test:
wget https://gitlab.com/RobertCNelson/bb-kernel/-/jobs/14084569669/artifacts/raw/deploy/linux-image-6.18.24-bone29.1_1xross_armhf.deb ;\
sudo dpkg -i linux-image-6.18.24-bone29.1_1xross_armhf.deb
Regards,
@RobertCNelson It is closer, but not working yet. I now get this error:
[ 202.662187] pru-rproc 4a334000.pru: error -ENXIO: IRQ vring not found
[ 202.677224] remoteproc remoteproc1: error -ENXIO: unable to get vring interrupt
[ 202.693943] remoteproc remoteproc1: can't start rproc 4a334000.pru: -6
[ 202.711023] remoteproc remoteproc1: Boot failed: -6
I did attempt to add the interrupt to the device tree, but I may not be doing it correctly.
ah so we need: PENDING: ARM: dts: am335x: Add PRU system events for virtio too
Had to add the device tree change: am335x: add vring · beagleboard/BeagleBoard-DeviceTrees@3596012 · GitHub
Okay, so lets just copy the ti pru_rproc.c driver over: ti: sync remoteproc_pru with 12.00.00.07 (d7f1bab7) · Commits · Robert Nelson / bb-kernel · GitLab
Waiting for ci..
Okay CI is done, please try this:
wget https://gitlab.com/RobertCNelson/bb-kernel/-/jobs/14085240199/artifacts/raw/deploy/linux-image-6.18.24-bone29.2_1xross_armhf.deb ;\
sudo dpkg -i linux-image-6.18.24-bone29.2_1xross_armhf.deb
Regards,
@RobertCNelson Remoteproc is working now from what I can tell. I’ll get the userspace end coded up now. Thanks for working on this.
Thanks for testing, i’ll keep it enabled on our builds!
@RobertCNelson I’ve check that the echo test works. Now udev rules need to be made so that /dev/rpmsg0, rpmsg1, rpmsg_ctrl0, rpmsg_ctrl1 have appropriate permissions so that the “debian” user can access them.
@RobertCNelson Here is an update for the udev rules. The rule already existed for the rpmsg, but just used the wrong subsystem.
# /etc/udev/rules.d/86-remoteproc-noroot.rules
#
# ReWritten by: Mark A. Yoder
# Corrects sys rpmsg_pru permissions on the BB so non-root users in the remoteproc
# group can write to /dev/rpmsg* without sudo'ing
#
SUBSYSTEM=="rpmsg", ACTION=="add", \