Ok, I’ve updated my project to use the C preprocessor to apply the includes and use the defines in the wiring tool repository, and that isn’t enough to get this to work. I know I’m getting the correct pin, as when I export it via sysfs I can loop over reading the ‘value’ file and see when my attached device sets it low. There is still no ‘edge’ file when exporting the gpio.
So, I tried going back to basics (still Le Potato) with the gpiod tools… I ldto reset my device tree overlays to remove what I had done, and rebooted. Then tried
gpioget gpiochip1 84
That’s fine. Then tried with:
gpiomon -l -f gpiochip1 84
and it replies: gpiomon: error waiting for events: No such device
My understanding is that this gpiod tool, gpiomon, is supposed to be using the /dev/gpiochip1 with ioctl calls to setup the interrupt and then poll it in a totally standards based way.
Hello @librecomputer I am trying to use an MCP23017 chip on the i2c bus with the i2c-ao.dts overlay.
When I scan the i2c-1 but I only see the addresses of 0x30 and 0x50. I am looking for the address of 0x20 for the MCP23017 device. In the original raspbian image there is an overlay that is applied but I do not believe the original overlays are being applied.
Would you be able to help with accessing the MCP23017 via pins 3 and 5 over i2c please. Thank you!
Have you tried scanning i2c-0? I know if you merge rather than enable overlays it will swap the device numbers. It may happen in other circumstances too.
Hey @librecomputer I have verified wiring (it is soldered into a pcba) and can detect the chip with a raspberry pi. How would I check the I2C bus frequency on the libre?
Would you be able to help with a device tree overlay for an MCP23017 at address 0x20 that is compatible with the i2c-ao overlay please. I have attempted to copy an existing overlay and apply the overlay but I am getting an error that the overlay does not exist.
Overall I am not certain if an overlay is needed for the MCP23017 to register at address 0x20. Any assistance would be appreciated. Thank you
After writing the overlay, you need to compile it by running make in the root directory before running sudo ./ldto. Do not run sudo ldto as that will use the system version rather than the newly modified version.
Once you tested it, feel free to contribute it back and it will be pushed in the future.
We do not have the device to test and verify functionality. The overlay looks correct. You can decompile the Raspberry Pi dtbo via the command dtc -I dtb -O dts FILE.dtbo.
I have done the decompile and see that the overlay for the Raspberry Pi has quite a bit more code than my custom overlay above. A few questions:
What sections of the Raspberry Pi .dtbo overlay information do I need to add to the Libre overlay I have above?
Do you have an example of a Raspberry Pi .dtbo that has switched the compatibles, targets, buses, GPIOs, and interrupt for the AML-S905X-CC?
Is there a “master .dtbo” file for the Libre which includes additional info that is shown in the Raspberry Pi .dtbo? I don’t understand why the Raspberry Pi overlay has so much extra code for compatibles, GPIOs and so forth and how this affects the current overlays.
root@raspberrypi:/home/pi/libretech-wiring-tool# make
CC libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.dts
DTC libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.pre.dts
libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.dts:18.20-24.11: ERROR (phandle_references): /fragment@0: Reference to non-existent node or label "i2c_A0"
libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.dts:26.20-37.11: ERROR (phandle_references): /fragment@1: Reference to non-existent node or label "i2c_A0"
libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.dts:39.20-55.11: ERROR (phandle_references): /fragment@2: Reference to non-existent node or label "i2c_A0"
libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.dts:68.29-75.19: ERROR (phandle_references): /fragment@4/__overlay__: Reference to non-existent node or label "i2c_A0"
ERROR: Input tree has errors, aborting (use -f to force output)
make: *** [Makefile:24: libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.dtbo] Error 2
rm libre-computer/aml-s905x-cc/dt/i2c-ao-mcp23017-a.pre.dts
Copying the Raspberry Pi overlay without understanding what you are doing is not going to work. The Raspberry Pi overlays have extensive hacks to work with Raspberry Pi boards and are usually non-standard. Standard overlays are much simpler.
Linux drivers each have supported compatible strings. They are just names. When you change compatibles in the device tree, you are just telling Linux to change the driver used.
Anything less than 3 inches is usually powered by an ST controller rather than an ILI controller. There’s overlays for 240x320 in the wiring tool that was uploaded recently.