PRU control files not found in /sys/class/uio/uio0

284 views
Skip to first unread message

mugginsac

unread,
Sep 4, 2018, 6:02:19 PM9/4/18
to Machinekit
I am working on a CRAMPS config for Stretch. It is blowing out with the error msg
PRU control files not found in /sys/class/uio/uio0

That comes from the following code it setup.sh:
if [ ! -r /sys/class/uio/uio0 ] ; then
    echo PRU control files not found in /sys/class/uio/uio0 >&2
    exit 1;
fi

If CRAMPS setup.sh is not finding the uio files, where do they come from?

mugginsac

unread,
Sep 4, 2018, 8:00:03 PM9/4/18
to Machinekit
Here is what I see in the console:

MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/configs/ARM.BeagleBone.CRAMPS'
Machine configuration file is 'CRAMPS.ini'
Starting Machinekit...
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=5 --usrmsglevel=5 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0
io started
<commandline>:0: Component 'iocontrol' ready
<commandline>:0: Program 'io' started
halcmd loadusr io started

PRU control files not found in /sys/class/uio/uio0
CRAMPS.hal:10: program './setup.sh' failed, returned 1
Shutting down and cleaning up Machinekit...
<commandline>:0: Realtime threads stopped
Cleanup done
Machinekit terminated with an error.  You can find more information in the log:
    /home/machinekit/linuxcnc_debug.txt
and
    /home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

And here are the .ini, .hal, linuxcnc.log, and dmesg files for those who are interested.


Charles Steinkuehler

unread,
Sep 5, 2018, 8:51:45 AM9/5/18
to machi...@googlegroups.com
The are created when the uio_pruss driver gets loaded. Your dmesg
output indicates you're using a TI kernel (4.14.67-ti-rt-r73) which
usually means the remote-proc PRU driver is supported (and indeed,
further along dmesg shows the remoteproc driver is loaded).

Robert Nelson has done some magic to make the UIO drivers and
remote-proc drivers somewhat switchable, but I haven't really started
using any of the 4.x kernels myself. I think you need to update your
uEnv.txt and change the device-tree to load the UIO driver and not the
remoteproc driver:

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_PRU_Options

...you want the last option (PRU via uio).

--
Charles Steinkuehler
cha...@steinkuehler.net

Condit Alan

unread,
Sep 5, 2018, 9:56:19 AM9/5/18
to Steinkuehler Charles, machi...@googlegroups.com
Thanks Charles,

That helps explain how things work. I probably screwed up when I started a new thread (bone-debian-9.5-machinekit-armhf-2018-08-30-4gb.img not working). But maybe that points to something with the new image as well.

In the new thread, I posted a copy of my uEnv.txt that shows it is using
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo already.

Is there a way to pull the two threads together?

Thanks again,
Alan

mugginsac

unread,
Sep 5, 2018, 11:25:35 AM9/5/18
to Machinekit
Yesterday I made a new uSD from bone-debian-9.5-machinekit-armhf-2018-08-30-4gb.img.
I did "sudo apt-get update", "sudo apt-get install ssh" and "sudo apt-get install xorg"
 so that I can run "ssh -X".
I followed Robert Nelson's advice
except that I nuked them in the setup.sh file in CRAMPS config
and use:
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
in /boot/uEnv.txt
- show quoted text -

I have attached a link to the uEnv.txt file in pastebin and it already has
"uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo" uncommented. I don't see what the error is.

/sys/class/uio/ is empty. And even after trying to run machinekit then rebooting /sys/class/uio is still empty.

uEnv.txt

mugginsac

unread,
Sep 5, 2018, 11:43:57 PM9/5/18
to Machinekit
Now I am more confused than ever. I have a working config for Xylotex.ini and I can't even get it to run. (I don't even know how I ever got it to run.)
The test for /sys/class/uio/uio0 is in setup.sh (in the files for both Xylotex and CRAMPS). It is before it even runs
the config_pin command.
The command
loadusr -w ./setup.sh (This blows out because /sys/class/uio/uio0 is empty.
is the first command in the CRAMPS.hal file.
This is quite a bit before the command
loadrt [PRUCONF](DRIVER) prucode=$(HAL_RTMOD_DIR)/[PRUCONF](PRUBIN) [PRUCONF](CONFIG) halname=hpg

So how is the the pru driver supposed to ever get loaded and thus populate /sys/class/uio/uio0????

Charles Steinkuehler

unread,
Sep 6, 2018, 9:59:03 AM9/6/18
to machi...@googlegroups.com
You are confusing the HAL driver with the Linux driver.

The entries in /sys/class/uio are created by the Linux driver which is
configured via device-tree.

The "loadrt" command loads the HAL driver which uses the uio device
nodes to talk to the PRU.

If you do not have any entries in /sys/class/uio, you have a problem
with either the kernel or device-tree. You might closely monitor the
boot sequence with a serial console and make sure you're really using
the expected u-boot settings, kernel, and u-boot overlays.

NOTES:
* You can verify the live device-tree settings by walking /proc/device-tree

* You might want to make sure the boot loader installed to your eMMC
flash is current. Older versions can cause problems with the new boot
loader scripts. If you need to update, just use any current "flasher"
image (it doesn't really matter which one).
--
Charles Steinkuehler
cha...@steinkuehler.net

Condit Alan

unread,
Sep 6, 2018, 11:45:56 AM9/6/18
to Steinkuehler Charles, machi...@googlegroups.com
Thank you Charles,

I am running the CRAMPS board on a A5C rev of BBB. Hence, I have only 2gb emmc. I now understand why Robert had me erase the emmc on my A6 board.

As soon as I erased the emmc boot area, the /sys/class/uio/ directory was populated during boot.

So now I got farther in the boot process but not yet success.

P9_25 is specified in setup.sh. So any idea why this error?

MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/configs/ARM.BeagleBone.CRAMPS'
Machine configuration file is 'CRAMPS.ini'
Starting Machinekit...
rtapi_msgd command:  /usr/libexec/linuxcnc/rtapi_msgd --instance=0 --rtmsglevel=5 --usrmsglevel=5 --halsize=524288
rtapi_app command:  /usr/libexec/linuxcnc/rtapi_app_rt-preempt --instance=0
io started
<commandline>:0: Component 'iocontrol' ready
<commandline>:0: Program 'io' started
halcmd loadusr io started
Waiting for /sys/class/uio/uio0 OK
P9_25 pinmux file not found!
bash: /sys/devices/platform/ocp/ocp*P9_25_pinmux/state: No such file or directory
Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P9_25_pinmux/state
CRAMPS.hal:11: program './setup.sh' failed, returned 1
Shutting down and cleaning up Machinekit...
<commandline>:0: Realtime threads stopped
Cleanup done
Machinekit terminated with an error.  You can find more information in the log:
    /home/machinekit/linuxcnc_debug.txt
and
    /home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to a topic in the Google Groups "Machinekit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/machinekit/XSxIKD_mi-s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to machinekit+...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Charles Steinkuehler

unread,
Sep 6, 2018, 12:21:56 PM9/6/18
to machi...@googlegroups.com
On 9/6/2018 10:45 AM, Condit Alan wrote:
>
> So now I got farther in the boot process but not yet success.
>
> P9_25 is specified in setup.sh. So any idea why this error?
>
> P9_25 pinmux file not found!
> bash: /sys/devices/platform/ocp/ocp*P9_25_pinmux/state: No such file or directory

That's one of the audio pins. The fact that the pinmux files don't
exist probably means it's not under control of the universal overlay and
is still being used for audio. You need to tweak which universal
overlay you're loading in u-boot and/or disable the audio overlay.

There used to be a _bunch_ of different flavors of the universal overlay
with various things enabled/disabled (eg: audio, hdmi, emmc). RCN has
simplified all this but I'm not 100% sure what you do/don't need to
setup in uEnv.txt (I'm traveling and don't have a "modern" BBB OS
install handy to reference).

--
Charles Steinkuehler
cha...@steinkuehler.net

Condit Alan

unread,
Sep 6, 2018, 3:15:02 PM9/6/18
to Steinkuehler Charles, machi...@googlegroups.com
Thanks again Charles,

That gave me enough info that I was able to produce a running config for CRAMPS. I have a little more cleanup and then I will try to generate a pull request to get a working CRAMPS/stretch config onto GitHub.

Alan

Harley Engholm

unread,
Sep 6, 2018, 3:19:23 PM9/6/18
to Machinekit
Search for this. Config error for Probotix cape. 'PRU control files not found in /sys/class/uio/uio0' .

Charles Steinkuehler

unread,
Sep 6, 2018, 5:08:41 PM9/6/18
to machi...@googlegroups.com
Great news!
--
Charles Steinkuehler
cha...@steinkuehler.net
Reply all
Reply to author
Forward
0 new messages