Post by EBo Post by Bertho Stultiens
Well, SPI is now working and it seems to be satisfactory. I created an
experimental EPP driver for the 7i90/7i43 (which is why I started this
thread) but it needs to be tested and I am looking for volunteers.
What all would be evolved with testing? We found a use at work to use
an RPi-3 for a proof of concept, so I will be jumping back into RPi's
for the next while. It would be nice to make sure that the hard
real-time and other systems are running correctly, as well as LCNC. I
also need to get back to some LCNC projects whenever I can break away
the time... Anyway, I or my intern might take a poke at the testing if
it does not envolve to much, or if we can find a way to make it work
First thing you need is a quite a bit of patience. Creating bootable
images with all updates and extra packages RPi is a slow process on a
RPi. So you better have some other work too, or there cannot be enough
You need to build a converter from the 40-pin I/O header to a 26-pin IDC
with flatcable (see http://media.vagrearg.org/rpi3-lcnc/pi-epp.pdf).
Now for the software.
The easy way gets you going, but there may be junk you do not need/want
or care about or whatever brainfart I mistakenly left in that image.
The hard way will make you in full control of the image you create. It
also ensures that you actually get an idea what you need to build and
run (I found that very helpful)
The "easy" way (couple of hours to start testing):
1 - Get my SD image.
It is a bit used, but it is fully functional.
This will take, no joke, about 3.14 hours <smile> to upload.
The image: picnc-rt_kernel-4.4.4-dev-lcnc-X-20170620210413.img.gz
will be available from http://media.vagrearg.org/rpi3-lcnc/
(once it is uploaded)
2 - dd image to 8+GB SD card
3 - Copy a set of ini/hal files to ~/linuxcnc/configs/...
and modify them to use the new hm2_rpepp driver
4 - test
The "hard" way (about a day before testing):
1 - install base Raspbian image on 8+GB SD card
2 - update the image (atp-get update; apt-get dist-upgrade)
3 - install RT-PREEMPT kernel 4.4.4-rt9-v7+ from Machinekit
The procedure has been derived from
However, I did not want to upgrade the bootloader and that means doing
more work. Please note that is will run properly on the Pi3. If you
upgrade the bootloader then disregard the following and keep to the MK
Procedure without upgrading the bootloader:
$ sudo su -
# dpkg -i linux-image-rpi2-rt_4.4.4-rt9-v7+-7_armhf.deb
# cd /boot
# mkdir old
# mv bcm* overlays kernel7.img old/
# mv dtbs_rt/* .
# cp kernel_rt-4.4.4-rt9-v7+.img kernel7.img
Now you have to edit /boot/cmdline.txt to look something like this:
dwc_otg.fiq_enable=0 dwc_otg.fiq_fsm_enable=0 dwc_otg.nak_holdoff=0
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=PARTUUID=4fb6ef8f-02
rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
The first three parameters have been added. Your "root=..." and
"console=..." are probably different. I have a serial console attached
for debug purpose.
4 - add to /etc/rc.local
echo -n 1200000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo -n performance >
5 - install git
6 - clone LinuxCNC from github. My fork has the hm2_rpepp module in a
branch called hm2_rpepp; see https://github.com/BsAtHome/linuxcnc
7 - brace yourself, about to install build-dependencies
8 - read docs/src/code/building-linuxcnc.txt how to find the build
$ sudo apt-get install dpkg-dev
$ cd ~linuxcnc-git/debian
$ ./configure uspace
$ cd ..
Now install all that has been listed and get some more coffee and
probably return the next morning.
9 - Build LinuxCNC. Beware: do _not_ compile with parallel jobs. The RPi
has not enough memory to compile multiple c++ files and starts swapping,
killing the performance and going to practically zero progress.
$ cd ~/linuxcnc-git/src
$ ./configure --with-realtime=uspace
$ sudo make setuid
10 - Copy a set of ini/hal files to ~/linuxcnc/configs/... and modify
them to use the new hm2_rpepp driver
11 - test
(disclaimers are disclaimed)