Help using OSMC on Pi as JTAG terminal

I’ve recently bricked a router (Buffalo WHR-G125) with a bad flash and I am looking to recover it by connecting to its JTAG port to re-flash it. I have a 5 year old program, tjtag-pi which should do it from Github. I can compile it and run it in without any parameters. As soon as I run properly with a “./tjtag -probeonly” I get:

root@osmc:/usr/src/tjtag-pi# ./tjtag -probeonly

EJTAG Debrick Utility v3.0.1 Tornado-MOD
Failed to open /dev/parport0: No such file or directory

There is no parport0 device in OSMC so how do I get it there?

It probably needs it because the original program used JTAG via a reworked parallel port cable.

I have found pi-parport on Github but I cannot get it to compile.
Making the dtc bit gives:

root@osmc:/usr/src/pi-parport/dts# make
dtc -@ -I dts -O dtb -o parport-gpio.dtbo parport-gpio.dts
make: dtc: Command not found
Makefile:4: recipe for target 'parport-gpio.dtbo' failed
make: *** [parport-gpio.dtbo] Error 127

“aptget-install dtc” does nothing and I am not sure how to hunt down which package provides it.
Doing the driver bit gives:

root@osmc:/usr/src/pi-parport/driver# make clean
make: Warning: File 'Makefile' has modification time 3594 s in the future
make -C /lib/modules/4.14.34-1-osmc/build M=/usr/src/pi-parport/driver clean
make[1]: *** /lib/modules/4.14.34-1-osmc/build: No such file or directory.  Stop.
Makefile:14: recipe for target 'clean' failed
make: *** [clean] Error 2

and changing the path in the makefile to “/lib/modules/$(KERNEL_VERSION)/kernel” gives:

root@osmc:/usr/src/pi-parport/driver# make
make: Warning: File 'Makefile' has modification time 3594 s in the future
make -C /lib/modules/4.14.34-1-osmc/kernel M=/usr/src/pi-parport/driver modules
make[1]: Entering directory '/lib/modules/4.14.34-1-osmc/kernel'
make[1]: *** No rule to make target 'modules'.  Stop.
make[1]: Leaving directory '/lib/modules/4.14.34-1-osmc/kernel'
Makefile:14: recipe for target 'modules' failed
make: *** [modules] Error 2

But obviously at this point I don’t have the dtoverlay=parport-gpio loaded as the earlier compile failed.

Can anyone please help me get this going? Is there an alternative source for a parport0 driver?

Thanks, Nick.

dtc is from the package device-tree-compiler. Unfortunately, the version with Debian stretch doesn’t work with this code, giving the error dtc: invalid option -- '@'.

If you search for this error you’ll find that there are various solutions that usually require the downloading/compiling of code from various sources. You’ll need to decide for yourself whether you want to take the risk of doing so.

FYI, I tried the one mentioned here. It all compiled with minimal effort, as did the dts file, but the Pi won’t boot once the line dtoverlay=parport-gpio is added to the /boot/config.txt file.

I think I’m making progress. I’ve followed this post and dtc compiles.
Adding the line dtoverlay=parport-gpio and rebooting is fine.

The next problem is with the pi-parport drivers.

cd /usr/src/pi-parport/driver
make

gives:

root@osmc:/usr/src/pi-parport/driver# make
make -C /lib/modules/4.14.34-1-osmc/build M=/usr/src/pi-parport/driver modules
make[1]: *** /lib/modules/4.14.34-1-osmc/build: No such file or directory.  Stop.
Makefile:14: recipe for target 'modules' failed
make: *** [modules] Error 2

Editing the makefile to change the kernel_path line to /lib/modules/$(KERNEL_VERSION)/kernel gives

root@osmc:/usr/src/pi-parport/driver# make
make: Warning: File 'Makefile' has modification time 3533 s in the future
make -C /lib/modules/4.14.34-1-osmc/kernel M=/usr/src/pi-parport/driver modules
make[1]: Entering directory '/lib/modules/4.14.34-1-osmc/kernel'
make[1]: *** No rule to make target 'modules'.  Stop.
make[1]: Leaving directory '/lib/modules/4.14.34-1-osmc/kernel'
Makefile:14: recipe for target 'modules' failed
make: *** [modules] Error 2

This suggests to me it is trying to build something like “modules” which does not exist. Do I have to adjust the Makefile line somehow? If so, do you know what to?

There is an error in the post I followed to make dtc in this post . The line make PREFIX=/usr did nothing so it installed into /root therefore did not load at boot. Changing line 28 of /usr/src/dtc/Makefile to PREFIX = /usr fixes that and rebooting is still ok. which dtc now returns /usr/bin/dtc but the make of the pi-port drivers still fails:

root@osmc:/usr/src/pi-parport/driver# make
make -C /lib/modules/4.14.34-1-osmc/kernel M=/usr/src/pi-parport/driver modules
make[1]: Entering directory '/lib/modules/4.14.34-1-osmc/kernel'
make[1]: *** No rule to make target 'modules'.  Stop.
make[1]: Leaving directory '/lib/modules/4.14.34-1-osmc/kernel'
Makefile:14: recipe for target 'modules' failed
make: *** [modules] Error 2

p.s. how do you include code in posts? Classic “code” tags and the back-tick seem to take out newline characters so the lines all run together.

I’d normally recommend you install things like dtc into /usr/local, rather than /usr, but it’s not the end of the world.

I assume you haven’t installed the kernel headers. If not, run this command:

sudo apt-get install rbp2-headers-4.14.34-1-osmc

This is for a Pi2/3/3+. For a Pi1, it’ll start with rbp1.

You’ll also need to make a link to the headers directory:

sudo ln -s /usr/src/rbp2-headers-4.14.34-1-osmc /lib/modules/4.14.34-1-osmc/build

The bad news is that the compile fails on OSMC kernel 4.14:

osmc@osmc:~/pi-parport/driver$ make
make -C /lib/modules/4.14.34-1-osmc/build M=/home/osmc/pi-parport/driver modules
make[1]: Entering directory '/usr/src/rbp2-headers-4.14.34-1-osmc'
  CC [M]  /home/osmc/pi-parport/driver/share.o
/home/osmc/pi-parport/driver/share.c: In function ‘parport_claim_or_block’:
/home/osmc/pi-parport/driver/share.c:1259:8: error: implicit declaration of function ‘signal_pending’ [-Werror=implicit-function-declaration]
    if (signal_pending(current))
        ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:328: recipe for target '/home/osmc/pi-parport/driver/share.o' failed
make[2]: *** [/home/osmc/pi-parport/driver/share.o] Error 1
Makefile:1528: recipe for target '_module_/home/osmc/pi-parport/driver' failed
make[1]: *** [_module_/home/osmc/pi-parport/driver] Error 2
make[1]: Leaving directory '/usr/src/rbp2-headers-4.14.34-1-osmc'
Makefile:13: recipe for target 'modules' failed
make: *** [modules] Error 2

Looking around, this error seems to have been introduced with kernel 4.11. It compiled without error on a Raspbian kernel 4.9.35+ – but that’s on Raspbian Jessie, not OSMC stretch. If I get time this evening, I’ll see if it works with an OSMC 4.9 kernel.

Update. To overcome the above error, add the line

#include <linux/sched/signal.h>

to each file where the error occurs. There’s also one other error:

error: implicit declaration of function 'copy_from_user'

Just insert the line:

#include <linux/uaccess.h>

Success:

osmc@osmc:~/pi-parport/driver$ lsmod
Module                  Size  Used by
parport_gpio           16384  0
parport                49152  1 parport_gpio

.

May 14 19:05:36 osmc kernel: parport: loading out-of-tree module taints kernel.
May 14 19:05:36 osmc kernel: parport0: data on gpio pins [22,23,24,10,25,9,8,11]
May 14 19:05:36 osmc kernel: parport0: status on gpio pins [18,17,4,3,2]
May 14 19:05:36 osmc kernel: parport0: control on gpio pins [26,19,6,13]
May 14 19:05:36 osmc kernel: parport0: hd on gpio pin 20
May 14 19:05:36 osmc kernel: parport0: dir on gpio pin 21

Thanks for that. I’ve worked my way through the edits as the modules failed to compile one by one. Let’s hope the jtag programmer works now! I’ll test tomorrow.

FWIW The second error I got was error: implicit declaration of function 'copy_to_user' not copy_from_user but the fix was good.

If you ever drop by the ClearOS forums, perhaps I’ll be able to return the favour.

Also, if you let me know how to do the code blocks on the forum, I’ll fix my posts.

Very happy to help. Please let us know if it works.

And to format code, highlight it and then use the </> button. Discourse uses Markdown.

Ah! The secret with code blocks is to leave a blank line at the beginning. Then even my BB code method [code] works.

Unfortunately the Pi results are negative. From this it looks like when I insmod the two drivers, the port should announce itself on the console, but I see nothing and there is nothing obvious in /dev. I note that you have an excerpt from a log file. Which one? I have nothing in useful /var/log. Do I have to enable it somewhere?

Even if parport is loading correctly, the tjtag program fails saying it can’t detect my device (the router I’m trying to fix). This could be for any reason. It could be a parport reason - although it may be working as tjtag does not complain about not being able to access parport0. I could be my Mickey Mouse cabling between the Pi and the router or it could be the router is dead beyond hope. If parport is not loading correctly then I need to fix that. dmesg gives:

[  182.929985] parport: loading out-of-tree module taints kernel.

So there is hope - just nothing in the logs.

I won’t have much free time today, so apologies in advance if I seem to go AWOL.

The log message was from running sudo journalctl. Debian now uses systemd, so you no longer have a browsable log file under /var/log. Running dmesg would also have given the same messages. If you only see the “out of tree” message, then parport_gpio isn’t functioning correctly, since it produces the “parport0” messages. It is even loaded (lsmod)?

Edit: Confirmation of parport_gpio messages:

May 15 19:59:22 osmc sudo[1044]:     osmc : TTY=pts/1 ; PWD=/home/osmc ; USER=root ; COMMAND=/sbin/insmod parport.ko
May 15 19:59:22 osmc sudo[1044]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
May 15 19:59:22 osmc kernel: parport: loading out-of-tree module taints kernel.
May 15 19:59:22 osmc sudo[1044]: pam_unix(sudo:session): session closed for user root
May 15 20:00:02 osmc sudo[1076]:     osmc : TTY=pts/1 ; PWD=/home/osmc ; USER=root ; COMMAND=/sbin/insmod parport_gpio.ko
May 15 20:00:02 osmc sudo[1076]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
May 15 20:00:02 osmc kernel: parport0: data on gpio pins [22,23,24,10,25,9,8,11]
May 15 20:00:02 osmc kernel: parport0: status on gpio pins [18,17,4,3,2]
May 15 20:00:02 osmc kernel: parport0: control on gpio pins [26,19,6,13]
May 15 20:00:02 osmc kernel: parport0: hd on gpio pin 20
May 15 20:00:02 osmc kernel: parport0: dir on gpio pin 21

So I must have something wrong with mine :frowning:

root@osmc:/usr/src/pi-parport/driver# insmod parport.ko
root@osmc:/usr/src/pi-parport/driver# insmod parport_gpio.ko
root@osmc:/usr/src/pi-parport/driver# lsmod | grep parport
parport_gpio 16384 0
parport 49152 1 parport_gpio
root@osmc:/usr/src/pi-parport/driver# journalctl
< snip >
May 15 18:45:20 osmc systemd[1]: Started Cleanup of Temporary Directories.
May 15 19:13:31 osmc kernel: parport: loading out-of-tree module taints kernel.
lines 472-494/494 (END)

I’ll have to try to retrace my steps

I’m not so familiar with systemd. ClearOS/Centos/Redhat use it a bit but not to that extent. Starting and stopping programs is done through it but we still use rsyslog for logs.

[edit]
Are you allowed to attach your compiled drivers?
[/edit]

[edit2]
Retraced and got nowhere.
Recapping, dtc is from Updating DTC - BeyondLogic but with the makfile edited changing PREFIX to /usr. I then made the edit to /boot/config.txt and rebooted.
pi-parport is from GitHub - garlick/pi-parport: retro parallel port for raspberry pi. Here I did all your “include” edits until it compiled.
Did the two insmod commands but it did not initialise parport0
[/edit2]

[edit3]
and my device is a Pi 2B
[/edit3]

Back to basics. Let’s check if the overlay is looking ok. It’s not really an area I know much about but we can compare your data with mine, which at least seems to work.

osmc@osmc:~$ sudo vcdbg log msg
002251.716: brfs: File read: /mfs/sd/config.txt
002252.184: brfs: File read: 304 bytes
002263.494: HDMI:EDID error reading EDID block 0 attempt 0
002264.759: HDMI:EDID error reading EDID block 0 attempt 1
002266.020: HDMI:EDID error reading EDID block 0 attempt 2
002267.280: HDMI:EDID error reading EDID block 0 attempt 3
002268.540: HDMI:EDID error reading EDID block 0 attempt 4
002269.799: HDMI:EDID error reading EDID block 0 attempt 5
002271.060: HDMI:EDID error reading EDID block 0 attempt 6
002272.320: HDMI:EDID error reading EDID block 0 attempt 7
002273.580: HDMI:EDID error reading EDID block 0 attempt 8
002274.840: HDMI:EDID error reading EDID block 0 attempt 9
002275.863: HDMI:EDID giving up on reading EDID block 0
002293.001: brfs: File read: /mfs/sd/config.txt
002293.337: HDMI:Setting property pixel encoding to Default
002293.358: HDMI:Setting property pixel clock type to PAL
002293.378: HDMI:Setting property content type flag to No data
002293.399: HDMI:Setting property fuzzy format match to enabled
002293.497: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
002476.555: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
002481.981: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
002482.287: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
002482.310: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
002482.620: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
002483.889: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
002485.153: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
002486.416: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
002487.680: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
002488.944: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
002490.208: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
002491.472: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
002492.736: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
002494.000: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
002495.027: hdmi: HDMI:EDID giving up on reading EDID block 0
002495.061: hdmi: HDMI: No lookup table for resolution group 0
002495.077: hdmi: HDMI: hotplug attached with DVI support
002495.108: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
002495.404: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
002496.667: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
002497.929: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
002499.191: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
002500.453: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
002501.715: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
002502.977: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
002504.239: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
002505.502: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
002506.764: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
002507.789: hdmi: HDMI:EDID giving up on reading EDID block 0
002508.076: hdmi: HDMI: hotplug deassert
002508.092: hdmi: HDMI: HDMI is currently off
002508.106: hdmi: HDMI: changing mode to unplugged
002508.125: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
002508.633: *** Restart logging
002508.660: brfs: File read: 304 bytes
002512.766: brfs: File read: /mfs/sd/cmdline.txt
002512.841: Read command line from file 'cmdline.txt'
8250.nr_uarts=0 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  root=/dev/nfs nfsroot=192.168.8.3:/mnt/usbdrive/osmc/pi3/2018.04 ip=dhcp rootwait quiet osmcdev=rbp2
002513.102: brfs: File read: 172 bytes
003028.920: brfs: File read: /mfs/sd/kernel.img
003028.944: Loading 'kernel.img' to 0x8000 size 0x7de9e0
003032.572: No kernel trailer - assuming DT-capable
003032.616: brfs: File read: 8251872 bytes
003036.000: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
003036.025: Loading 'bcm2710-rpi-3-b.dtb' to 0x7e69e0 size 0x5edf
003171.081: brfs: File read: 24287 bytes
003171.797: brfs: File read: /mfs/sd/config.txt
003171.925: brfs: File read: 304 bytes
003189.057: brfs: File read: /mfs/sd/overlays/pi3-disable-bt-overlay.dtb
003206.565: Loaded overlay 'pi3-disable-bt'
003248.529: brfs: File read: 818 bytes
003260.753: brfs: File read: /mfs/sd/overlays/parport-gpio.dtbo
003273.553: Loaded overlay 'parport-gpio'
004474.297: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
004583.679: Device tree loaded to 0x2eff9900 (size 0x66f7)
004585.759: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
005868.289: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
005871.005: vchiq_core: vchiq_init_state: slot_zero = 0xef980000, is_master = 1
005874.357: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
046171.783: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223

Plus modinfo on the driver modules:

osmc@osmc:~$ modinfo ./parport_gpio.ko
filename:       /home/osmc/./parport_gpio.ko
license:        GPL
version:        1.0
description:    Parport Driver for Raspberry Pi GPIO Parallel Port HAT
author:         Jim Garlick
srcversion:     14915D8AC75F78C4FA93144
alias:          of:N*T*Cparport-gpioC*
alias:          of:N*T*Cparport-gpio
depends:        parport
name:           parport_gpio
vermagic:       4.14.34-1-osmc SMP preempt mod_unload modversions ARMv7 p2v8 
osmc@osmc:~$ modinfo ./parport.ko
filename:       /home/osmc/./parport.ko
license:        GPL
srcversion:     89CB63BF592226E91748548
depends:        
name:           parport
vermagic:       4.14.34-1-osmc SMP preempt mod_unload modversions ARMv7 p2v8

Mine are:

root@osmc:/usr/src/pi-parport/driver# vcdbg log msg
001563.125: brfs: File read: /mfs/sd/config.txt
001563.583: brfs: File read: 231 bytes
001576.175: HDMI:EDID error reading EDID block 0 attempt 0
001577.442: HDMI:EDID error reading EDID block 0 attempt 1
001578.702: HDMI:EDID error reading EDID block 0 attempt 2
001579.962: HDMI:EDID error reading EDID block 0 attempt 3
001581.222: HDMI:EDID error reading EDID block 0 attempt 4
001582.482: HDMI:EDID error reading EDID block 0 attempt 5
001583.742: HDMI:EDID error reading EDID block 0 attempt 6
001585.001: HDMI:EDID error reading EDID block 0 attempt 7
001586.262: HDMI:EDID error reading EDID block 0 attempt 8
001587.522: HDMI:EDID error reading EDID block 0 attempt 9
001588.545: HDMI:EDID giving up on reading EDID block 0
001604.173: brfs: File read: /mfs/sd/config.txt
001604.496: HDMI:Setting property pixel encoding to Default
001604.517: HDMI:Setting property pixel clock type to PAL
001604.537: HDMI:Setting property content type flag to No data
001604.558: HDMI:Setting property fuzzy format match to enabled
001604.642: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001613.818: gpioman: gpioman_get_pin_num: pin WL_LPO_CLK not defined
001613.844: gpioman: gpioman_get_pin_num: pin BT_ON not defined
001613.865: gpioman: gpioman_get_pin_num: pin WL_ON not defined
001783.104: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
001788.543: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001788.598: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001788.622: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001788.931: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001790.199: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001791.463: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001792.727: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001793.990: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001795.254: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001796.518: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001797.782: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001799.046: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001800.310: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001801.338: hdmi: HDMI:EDID giving up on reading EDID block 0
001801.372: hdmi: HDMI: No lookup table for resolution group 0
001801.389: hdmi: HDMI: hotplug attached with DVI support
001801.418: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001801.715: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
001802.976: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
001804.237: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
001805.498: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
001806.760: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
001808.022: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
001809.283: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
001810.544: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
001811.805: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
001813.066: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
001814.091: hdmi: HDMI:EDID giving up on reading EDID block 0
001814.126: hdmi: HDMI: hotplug deassert
001814.141: hdmi: HDMI: HDMI is currently off
001814.156: hdmi: HDMI: changing mode to unplugged
001814.176: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001814.681: *** Restart logging
001814.708: brfs: File read: 231 bytes
001820.537: brfs: File read: /mfs/sd/cmdline.txt
001820.578: Read command line from file 'cmdline.txt'
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait quiet osmcdev=rbp2
001820.822: brfs: File read: 63 bytes
002396.418: brfs: File read: /mfs/sd/kernel.img
002396.441: Loading 'kernel.img' to 0x8000 size 0x7de9e0
002400.070: No kernel trailer - assuming DT-capable
002400.116: brfs: File read: 8251872 bytes
002404.658: brfs: File read: /mfs/sd/bcm2709-rpi-2-b.dtb
002404.681: Loading 'bcm2709-rpi-2-b.dtb' to 0x7e69e0 size 0x5a33
002551.516: brfs: File read: 23091 bytes
002551.954: brfs: File read: /mfs/sd/config.txt
002551.998: brfs: File read: 231 bytes
002571.068: brfs: File read: /mfs/sd/overlays/lirc-rpi-overlay.dtb
002579.798: Loaded overlay 'lirc-rpi'
002579.920: dtparam: gpio_in_pin=18
002580.468: dtparam: gpio_out_pin=17
002641.056: brfs: File read: 1348 bytes
002673.859: Failed to load overlay 'parport-gpio'
002673.879: brfs: File read: /mfs/sd/overlays/parport-gpio.dtb
003678.908: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
003775.628: Device tree loaded to 0x2effa000 (size 0x5f05)
003777.308: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
005154.398: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
005157.426: vchiq_core: vchiq_init_state: slot_zero = 0xef980000, is_master = 1
005161.438: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
039494.388: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
041003.488: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
041711.390: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
055985.168: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
056692.678: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
059004.911: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
059712.172: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
078605.257: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223
079312.572: aphy_drv_slew = 00000333, dphy_drv_slew = 00000223

and

root@osmc:/usr/src/pi-parport/driver# modinfo parport_gpio.ko
filename:       /usr/src/pi-parport/driver/parport_gpio.ko
license:        GPL
version:        1.0
description:    Parport Driver for Raspberry Pi GPIO Parallel Port HAT
author:         Jim Garlick
srcversion:     14915D8AC75F78C4FA93144
alias:          of:N*T*Cparport-gpioC*
alias:          of:N*T*Cparport-gpio
depends:        parport
name:           parport_gpio
vermagic:       4.14.34-1-osmc SMP preempt mod_unload modversions ARMv7 p2v8
root@osmc:/usr/src/pi-parport/driver# modinfo parport.ko
filename:       /usr/src/pi-parport/driver/parport.ko
license:        GPL
srcversion:     81EB5E68B877BA99D9604E5
depends:
name:           parport
vermagic:       4.14.34-1-osmc SMP preempt mod_unload modversions ARMv7 p2v8

Did you move your modules after you compiled them? I’m still loading mine from /usr/src/pi-parport/drivers.

Also it looks like my overlay, ‘parport-gpio’, is not loading. Looking at your output, if /mfs/sd/overlays is the same as /boot/overlays, then I don’t have a /boot/overlays/parport-gpio.dtbo.
When compiling, did you override any of the folders in the Makefile? I just fixed PREFIX as it was putting three folders into /root (like it was ignoring the command line make PREFIX=/usr) or should I put it back to $(HOME) and compile as the osmc user using sudo? (I am used to running root sessions rather than using sudo).
Also did you do make PREFIX=/usr or something different. From reading the Master ReadMe.md it may be possible to use the Master branch with the make NO_PYTHON=1 command but for the moment I don’t want to experiment.

I did both. If you move them to /lib/modules/$(uname -r) you need to run depmod -a for them to be seen. But since this is probably just a one-off exercise, insmod should be enough.

Then I assume you didn’t run sudo make install from the dts directory.

When compiling the overlay and modules didn’t change any settings.

root@osmc:/usr/src# git clone https://github.com/pantoniou/dtc.git
Cloning into 'dtc'...
remote: Counting objects: 3992, done.
remote: Total 3992 (delta 0), reused 0 (delta 0), pack-reused 3992
Receiving objects: 100% (3992/3992), 991.15 KiB | 1.23 MiB/s, done.
Resolving deltas: 100% (3009/3009), done.
root@osmc:/usr/src# cd dtc
root@osmc:/usr/src/dtc# git checkout dt-overlays5
Branch dt-overlays5 set up to track remote branch dt-overlays5 from origin.
Switched to a new branch 'dt-overlays5'
root@osmc:/usr/src/dtc# make PREFIX=/usr
         DEP tests/dumptrees.c
         DEP tests/trees.S
         DEP tests/testutils.c
         DEP tests/value-labels.c
         DEP tests/asm_tree_dump.c
         DEP tests/truncated_property.c
         DEP tests/subnode_iterate.c
         DEP tests/integer-expressions.c
         DEP tests/utilfdt_test.c
         DEP tests/path_offset_aliases.c
         DEP tests/add_subnode_with_nops.c
         DEP tests/dtbs_equal_unordered.c
         DEP tests/dtb_reverse.c
         DEP tests/dtbs_equal_ordered.c
         DEP tests/extra-terminating-null.c
         DEP tests/incbin.c
         DEP tests/boot-cpuid.c
         DEP tests/phandle_format.c
         DEP tests/path-references.c
         DEP tests/references.c
         DEP tests/string_escapes.c
         DEP tests/propname_escapes.c
         DEP tests/appendprop2.c
         DEP tests/appendprop1.c
         DEP tests/del_node.c
         DEP tests/del_property.c
         DEP tests/setprop.c
         DEP tests/set_name.c
         DEP tests/rw_tree1.c
         DEP tests/open_pack.c
         DEP tests/nopulate.c
         DEP tests/mangle-layout.c
         DEP tests/move_and_save.c
         DEP tests/sw_tree1.c
         DEP tests/nop_node.c
         DEP tests/nop_property.c
         DEP tests/setprop_inplace.c
         DEP tests/addr_size_cells.c
         DEP tests/notfound.c
         DEP tests/sized_cells.c
         DEP tests/char_literal.c
         DEP tests/get_alias.c
         DEP tests/node_offset_by_compatible.c
         DEP tests/node_check_compatible.c
         DEP tests/node_offset_by_phandle.c
         DEP tests/node_offset_by_prop_value.c
         DEP tests/parent_offset.c
         DEP tests/supernode_atdepth_offset.c
         DEP tests/get_path.c
         DEP tests/get_phandle.c
         DEP tests/getprop.c
         DEP tests/get_name.c
         DEP tests/path_offset.c
         DEP tests/subnode_offset.c
         DEP tests/find_property.c
         DEP tests/root_node.c
         DEP tests/get_mem_rsv.c
         DEP libfdt/fdt_addresses.c
         DEP libfdt/fdt_empty_tree.c
         DEP libfdt/fdt_strerror.c
         DEP libfdt/fdt_rw.c
         DEP libfdt/fdt_sw.c
         DEP libfdt/fdt_wip.c
         DEP libfdt/fdt_ro.c
         DEP libfdt/fdt.c
         DEP util.c
         DEP fdtput.c
         DEP fdtget.c
         DEP fdtdump.c
         LEX convert-dtsv0-lexer.lex.c
         DEP convert-dtsv0-lexer.lex.c
         DEP srcpos.c
         BISON dtc-parser.tab.c
         DEP dtc-parser.tab.c
         LEX dtc-lexer.lex.c
         DEP dtc-lexer.lex.c
         DEP treesource.c
         DEP livetree.c
         DEP fstree.c
         DEP flattree.c
         DEP dtc.c
         DEP data.c
         DEP checks.c
        CHK version_gen.h
        UPD version_gen.h
         DEP util.c
        CHK version_gen.h
         CC srcpos.o
         CC util.o
         CC convert-dtsv0-lexer.lex.o
         LD convert-dtsv0
         CC dtc.o
         CC checks.o
         CC data.o
         CC flattree.o
         CC fstree.o
         CC livetree.o
         CC treesource.o
         CC dtc-lexer.lex.o
         CC dtc-parser.tab.o
         LD dtc
         CC fdtdump.o
         LD fdtdump
         CC fdtget.o
         CC libfdt/fdt.o
         CC libfdt/fdt_ro.o
         CC libfdt/fdt_wip.o
         CC libfdt/fdt_sw.o
         CC libfdt/fdt_rw.o
         CC libfdt/fdt_strerror.o
         CC libfdt/fdt_empty_tree.o
         CC libfdt/fdt_addresses.o
         AR libfdt/libfdt.a
         LD fdtget
         CC fdtput.o
         LD fdtput
         LD libfdt/libfdt-1.4.1.so
root@osmc:/usr/src/dtc# sudo make install
        CHK version_gen.h
         INSTALL-BIN
         INSTALL-LIB
         INSTALL-INC
root@osmc:/usr/src/dtc# ls /boot/overlays/pa*
/boot/overlays/papirus-overlay.dtb

:frowning:

Also without changing PREFIX I now have:

root@osmc:/usr/src/dtc# ls /root/* -ld
drwxr-xr-x 2 root root 4096 May 16 10:37 /root/bin
-rwxr--r-- 1 root root  134 May 15 22:13 /root/go
drwxr-xr-x 2 root root 4096 May 16 10:37 /root/include
drwxr-xr-x 2 root root 4096 May 16 10:37 /root/lib

The bin, include and lib were generated by the make.

[edit]
Also the .dtbo file is not found anywhere:

root@osmc:~# find / -name parport*
/lib/modules/4.14.34-1-osmc/parport_gpio.ko
/lib/modules/4.14.34-1-osmc/parport.ko
/usr/src/pi-parport/dts/parport-gpio.dts
/usr/src/pi-parport/hardware_v1/parport.sch
/usr/src/pi-parport/hardware_v1/parport.brd
/usr/src/pi-parport/driver/parport.h
/usr/src/pi-parport/driver/parport_gpio.o
/usr/src/pi-parport/driver/parport_gpio.c
/usr/src/pi-parport/driver/parport.mod.o
/usr/src/pi-parport/driver/parport_gpio.mod.o
/usr/src/pi-parport/driver/parport_gpio.mod.c
/usr/src/pi-parport/driver/parport.mod.c
/usr/src/pi-parport/driver/.tmp_versions/parport.mod
/usr/src/pi-parport/driver/.tmp_versions/parport_gpio.mod
/usr/src/pi-parport/driver/parport.o
/usr/src/pi-parport/hardware_v2/parport.sch
/usr/src/pi-parport/hardware_v2/parport.brd
/usr/src/rbp2-headers-4.14.34-1-osmc/include/linux/parport.h
/usr/src/rbp2-headers-4.14.34-1-osmc/include/linux/parport_pc.h
/usr/src/rbp2-headers-4.14.34-1-osmc/include/asm-generic/parport.h
/usr/src/rbp2-headers-4.14.34-1-osmc/include/include/generated/asm/parport.h
/usr/src/rbp2-headers-4.14.34-1-osmc/include/config/arch/might/have/pc/parport.h
/usr/src/rbp2-headers-4.14.34-1-osmc/include/uapi/linux/parport.h
/usr/src/rbp2-headers-4.14.34-1-osmc/drivers/parport
/usr/src/rbp2-headers-4.14.34-1-osmc/arch/arm/include/generated/asm/parport.h
/usr/include/linux/parport.h

[/edit]

From GitHub - garlick/pi-parport: retro parallel port for raspberry pi

There is a device tree overlay for mapping specific GPIO pins to their functions in the driver. This must be compiled and loaded. In the dts directory, run

$ make
$ sudo make install
and add the following line to /boot/config.txt:

dtoverlay=parport-gpio

My (really) bad. I was confusing dtc and dts so skipping the dts stage. It is now loading. Now I have to set up the test. I’ll keep you posted.

Unfortunately all the components appear to be working but my tjtag program won’t communicate with the router. I have no way of telling which component is failing. It could be the router, my lashed up cable, or any of the programs on the Pi. I’ll have to park it for the moment. When I get more time I’ll try to rebuild the cable differently and give it another go. Failing that I’ll have to investigate serial recovery.

Thanks for all your help.

Extra question. Would I have to disable the lirc overlay as it appears to clash in with the gpio, especially wanting pin 18?

That would be a sensible step. If you actually use the lirc-rpi overlay you can also remap the pins it uses.

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Uncomment this to override the defaults for the lirc-rpi module
#dtparam=gpio_out_pin=16
#dtparam=gpio_in_pin=17
#dtparam=gpio_in_pull=down

You are running down a completely incorrect rabbit hole. Despite tjtag-pi having “pi” in the title, it is NOT written for the pi, but for any system. You have to explicitly specify which system you want to build for when running “make” and compiling it, such as “make pi”. Otherwise, it will build for a default device, in this case you have compiled tjtag-pi for a system that is not the Raspberry PI, hence why it is throwing the “parport0” error because it is expecting a parallel port and not GPIO pins. Try “make clean && make pi” and it should work, unless you have a Pi3 then grab the fork that adds Pi3 support and do “make clean && make pi3”.