Libre Computer Wiring Tool

Where are the overlay files located? I need to convert my gpio layout from RPi and it has been a bit challenging. I need spidev.0 as well as an output bit to reset a quad uart and an incoming interrupt request line. Is there a noob guide for building overlays?

SPI is easy: sudo ldto enable spicc-cs1

There are tons of overlays already and you can just look through them to see how they work. GitHub - libre-computer-project/libretech-wiring-tool

Does that command permanently add the SPI pins to my device tree? Where are overlays normally stored on the controller?

Read the OP, this is covered there already.

Please forgive my ignorance: What is an “OP”, where can it be had? I did attempt man ldto to no avail. Also, I noticed that after I applied the overlay I did not see the pins appear in the output of gpioinfo even though ldto status shows spicc-cs1 as active. Thanks for your kind patience.

Original post. Just scroll up using the scroll bar. It goes over ldto basics.

SPI is not GPIO. Raspberry Pi stuff is a confusing mess of ideas.

GPIO is general purpose IO. SPI bus is serial peripheral interface. SPI shows up as /dev/spidevx.y. Best not to get the concepts confused.

Roger that on the RPI being a mess. I do see line 89: “7J1 Header Pin24” “spi0 CS0” output active-low [used] appears in the output of gpioinfo thus my confusion. Regarding the UART reset and interrupt line that I need I see that they are listed as lines 85 and 95 respectively (albeit unused) which suggests that I should be able to use libgpiod to set them up. Am I to assume that once I set them up with libgpriod functions that they will transition into “used”?

The answer is that it depends.

If your device has a Linux kernel driver, the driver should handle the reservation of the pin functions. You create a device tree and provide the driver what it needs (GPIO, interrupts, pinmux, clocks, etc). Everything is done in kernel space.

If you are handling a portion of it in userspace or completely in userspace, that’s a different ball game. libgpiod is a userspace library so it really can’t reserve anything in kernel space. /dev/spidev0.0 is an userspace interface for the kernel SPI driver. You need to separately enable it via ldto enable spicc-cs1-spidev. This has 2 CS (pin 24 and pin 26). If you don’t need the CS, you can use spicc and spicc-spidev overlays. spicc/spicc-cs1 enables the SPI device. spicc/spicc-cs1 spidev enable the SPI device userspace interface (/dev/spidevx.y). Hope that makes sense.

We provide a tool called lgpio and you can use it to manually toggle pins and such. It can also convert header/pin combinations to libgpiod numberings for you to use in python or whatever userspace application you have interacting with the GPIO kernel interface. The documentation is also in the OP.

So I’ve tried using the sudo apt install function to get the libretech-gpio library, and my device throws the error that it can’t find it. Is there some other way I could try to access these files?

  1. Use official images as this tool is only available on official images.
  2. If you are using an image from a long time ago, sudo apt update and then try that command.

Only our Ubuntu Raspbian and Debian images have this tool. Images by third parties do not include the repository with it.

A little bit more about your installation?

For the longest time I could not ‘find’ some of the libraries that I was downloading to the Libre. I am using Thonny which sets up its own Venv. Thonny did not do or find some of the libraries so I used Thonny’s open a terminal window link figuring that would install the thing to the Venv. what I found was that the libraries did indeed download to the Thonny directory of the working project. I then search those directories for the libraries I was looking for and moved them to sit with the project file and it all works now. Took me several days and loading lots of libraries to figure that out.

Pin 17 in the GPIO Header of Renegade is GND but should be 3.3V

Using 2023-10-10-raspbian-bookworm-arm64-lite+aml-s905x-cc.

On first boot, after cloning the repository and installing the dtos, I ran into the following issue when running ldto merge [overlay]:

/opt/libretech-wiring-tool/ldto merge uart-a spi-cc-cs1 spi-cc-1cs-ili9341

LDTO_findEFIDTBPath: no EFI boot path found.

After rebooting, it works without errors. I assume a reboot is required either right after booting for the first time or installing the wiring tool, but I just want to make sure this is the intended behavior.

spi-cc-cs1 spi-cc- 1cs-ili9341

This is wrong.

Sorry typo on my end, but the behavior is the same with the correctly inputted dto names.

What is the output of the command if you prefix it with bash -x?