IR LED on Pine Quartz64b

I’m working on trying to get the IR LED working on my Quartz64 Model B, but it looks like DietPi doesn’t enable it by default in the device tree. Has anyone used the IR LED in the Quartz64 model B with DietPi?

If not, perhaps someone can help point me in the right direction to recompile the device tree using the dtoverlay from Raspberry Pi OS. According to the schematic for the board, the IR LED is attached to PWM15_IR_M0, which is on pin 1P4 of the RK3566 chip. I’m very new to messing with device trees and what not, so I’m not sure what needs to be updated in the overlay to connect to the proper pins.

found a bit of information about the IR on that board
PINE64 - Onboard IR receiver

I have this problem too IR not recognized by system. any thoughts? I had no luck with the above link. would not boot after changes

Does the gpio-ir-recv driver pick it up when rk3566-quartz64-b-rc.dtbo is applied?

rk3566-quartz64-b-rc.dtbo.gz (353 Bytes)

Hello Davejlong

You need to apply a DTBO overlay with a script with a few command line
for exemple see below the script

# Create the directory for user overlays
mkdir -p /boot/overlay-user
cd /boot/overlay-user
# Create the overlay source file
cat << '_EOF_' > ir-rx-overlay.dts
/dts-v1/;
/plugin/;

/ {
    compatible = "rockchip,rk3566";

    fragment@0 {
        target = <&pwm15>;
        __overlay__ {
            status = "okay";
        };
    };

    fragment@1 {
        target-path = "/";
        __overlay__ {
            ir_receiver: ir-receiver {
                compatible = "gpio-ir-receiver";
                // Adjust pin mapping to match your specific GPIO/IR line 
                gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_LOW>;
                pinctrl-names = "default";
                linux,rc-map-name = "rc-rc6-mce";
                status = "okay";
            };
        };
    };
};
_EOF_
# Install the device tree compiler
apt install device-tree-compiler
# Compile the overlay binary file
dtc -I dts -O dtb -o ir-rx-overlay.dtbo -@ ir-rx-overlay.dts
# To see the result of the compiler uncommit next line
#fdtdump ir-rx-overlay.dtbo
# Enable the user overlay via U-Boot environment file
#G_CONFIG_INJECT 'user_overlays=' 'user_overlays=ir-rx-overlay' /boot/dietpiEnv.txt

The command line to create and apply the DTBO file

In a terminal just a few command when you are connected

sudo nano ir-rx.sh

Copy and past the script

Ctrl+o to write the line and Ctrl+x to save and exit

Run the script

sh ir-rx.sh

Inject the user-overlay

G_CONFIG_INJECT 'user_overlays=' 'user_overlays=ir-rx-overlay' /boot/dietpiEnv.txt

And reboot

That’s all :wink:

Try and tell us

@MichaIng
After a quick response , can you have a look to this

G_CONFIG_INJECT 'user_overlays=' 'user_overlays=ir-rx-overlay' /boot/dietpiEnv.txt

There is no “dietpiEnv.txt” in the img file but a “extlinux.conf”

Thanks

Yes, our Quartz64 images are do not use a boot.scr, no /boot/overlay-user, no /boot/dietpiEnv.txt, but /boot/extlinux/extlinux.conf instead.

If you want to apply an overlay, use fdtoverlays /path/to/overlay.dtbo in /boot/extlinux/extlinux.conf. So the whole script would be:

# Create the overlay source in /boot
cd /boot
cat << '_EOF_' > ir-rx-overlay.dtso
/dts-v1/;
/plugin/;

&pwm15 {
    status = "okay";
};

&{/} {
    ir_receiver: ir-receiver {
        compatible = "gpio-ir-receiver";
        // Adjust pin mapping to match your specific GPIO/IR line 
        gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_LOW>;
        pinctrl-names = "default";
        linux,rc-map-name = "rc-rc6-mce";
        status = "okay";
    };
};
_EOF_
# Install the device tree compiler
apt install device-tree-compiler
# Compile the overlay binary file
dtc -@ -I dts -O dtb -o ir-rx-overlay.dtbo ir-rx-overlay.dtso
# Enable the overlay via extlinux
G_CONFIG_INJECT 'fdtoverlays[[:blank:]]' 'fdtoverlays /boot/ir-rx-overlay.dtbo' /boot/extlinux/extlinux.conf

I switched to simpler modern dts syntax.

Thanks a lot @MichaIng

just the last line to apply the custom overlay is

G_CONFIG_INJECT 'fdtoverlays[[:blank:]]' 'fdtoverlays /boot/ir-rx-overlay.dtbo' /boot/extlinux/extlinux.conf

:star_struck:

If @davejlong can tell if it help ?

Thanks for the correction of my copy&paste mistake :smile:. I edited it in my reply.