weenyPRU icon indicating copy to clipboard operation
weenyPRU copied to clipboard

Cannot use bcm2835 SPI driver on Raspberry Pi 5

Open Jaron123 opened this issue 1 year ago • 5 comments

Hello, I'm trying to run your your weeny project on a Raspberry pi 5 using the pre-made linuxCNC distro file from the LinuxCNC website. I'm not sure what is causing the problem but running the hallcompile and install of weeny.c goes without problems. I have a bluepill STM32F103C8T6 programmed with weenyPRU-default.bin and wired them as in the weenyPRU v1.2 image on oshwlab website (Connected to SPI0).

When I then try to run linuxcnc with weeny-xyza.ini and hal example files i've gotten different errors at different times but it never works.

The first error I got was this:

linuxcnc weeny-xyza.ini
LINUXCNC - 2.9.1
Machine configuration directory is '/home/cnc/Downloads/weenyPRU-main/configsamples/weeny-xyza2'
Machine configuration file is 'weeny-xyza.ini'
Starting LinuxCNC...
emc/iotask/ioControl.cc 786: can't load tool table.
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./weeny-xyza.hal
Waiting for component 'weeny' to become ready..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Then linuxcnc won't shut down properly so I have to reboot, at some other try I got this:

linuxcnc weeny-xyza.ini
LINUXCNC - 2.9.1
Machine configuration directory is '/home/cnc/Downloads/weenyPRU-main/configsamples/weeny-xyza'
Machine configuration file is 'weeny-xyza.ini'
Starting LinuxCNC...
emc/iotask/ioControl.cc 786: can't load tool table.
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./weeny-xyza.hal
link (updating variable file): No such file or directory
note: MAXV     max: 27.000 units/sec 1620.000 units/min
note: LJOG     max: 27.000 units/sec 1620.000 units/min
note: LJOG default: 35.000 units/sec 2100.000 units/min
note: AJOG     max: 45.000 units/sec 2700.000 units/min
note: AJOG default: 36.000 units/sec 2160.000 units/min
note: jog_order='XYZA'
note: jog_invert=set()
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  3 (X_GetWindowAttributes)
  Resource id in failed request:  0xffffffff
  Serial number of failed request:  660
  Current serial number in output stream:  661
Shutting down and cleaning up LinuxCNC...
task: 65 cycles, min=0.000009, max=0.010198, avg=0.007815, 0 latency excursions (> 10x expected cycle time of 0.010000s)
Note: Using POSIX realtime
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/cnc/linuxcnc_debug.txt
and
    /home/cnc/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

and then at another try (Maybe this was after I rebooted after linuxcnc didn't shut down properly, not sure)

linuxcnc weeny-xyza.ini
LINUXCNC - 2.9.1
Machine configuration directory is '/home/cnc/Desktop/weenyPRU-main/configsamples/weeny-xyza'
Machine configuration file is 'weeny-xyza.ini'
Starting LinuxCNC...
emc/iotask/ioControl.cc 786: can't load tool table.
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./weeny-xyza.hal
./weeny-xyza.hal:11: Pin 'weeny.SPI-enable' does not exist
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/cnc/linuxcnc_debug.txt
and
    /home/cnc/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

All I did was re-try after forcefully rebooting the pi after linuxcnc wouldn't shut down properly. i'm not sure the errors say anything usefull but hope you can help.

Oh and I wandered something, do I have to change anything to config.txt? I enabled SPI0 manually since it seemed only logical linux cnc would need it but it doesn't say anywhere in the documentation.

Jaron123 avatar Feb 15 '24 19:02 Jaron123