corrados
Posts: 2
Joined: Fri Apr 06, 2018 7:02 am

Failed to use overlays pwm-2chan and lirc-rpi on Pi Zero

Fri Apr 06, 2018 7:25 am

Hi,

I would like to use LIRC and analog audio out on my Pi Zero. The audio GPIOs are 18 and 13, the LIRC in is 23 and out is 24. But it seems not to work. It only works if I enable just one of them (i.e. only using pwm-2chan OR lirc-rpi works). Here is what I have in my config.txt:

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
dtoverlay=lirc-rpi,pgio_in_pin=23,gpio_out_pin=24

Looking at the dts files, I can find the following:
pwm-2chan:
__overlay__ {
pwm_pins: pwm_pins {
brcm,pins = <18 19>;
brcm,function = <2 2>; /* Alt5 */
};
lirc-rpi:
__overlay__ {
lirc_pins: lirc_pins {
brcm,pins = <17 18>;
brcm,function = <1 0>; // out in
brcm,pull = <0 1>; // off down
};
};

They both seem to use pin 18 as the default pin. Is that the reason why they cannot be enabled at the same time? Does it mean I have to compile my own dts to get it work or is there a workaround possible?

Thanks

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1822
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Failed to use overlays pwm-2chan and lirc-rpi on Pi Zero

Fri Apr 06, 2018 9:00 pm

You have a typo in your parameters - it should say "gpio_in_pin", not "pgio_in_pin". That doesn't quite explain the problem, but "sudo vcdbg log msg" might give you more of a clue.

The kernel rejects requests for pins that are already in use, in which case the driver will not be loaded and the pin functions will not be charged. lsmod and raspi-gpio may be useful diagnostic tools.

corrados
Posts: 2
Joined: Fri Apr 06, 2018 7:02 am

Re: Failed to use overlays pwm-2chan and lirc-rpi on Pi Zero

Sat Apr 07, 2018 7:40 am

The typo was the cause of my problem. Caused by the typo, the default in gpio 18 of lirc-rpi was used which conflicts with the pwm-2chan gpio and that was the reason both overlays did not work in combination. Now that I resolved the typo, everything is working as expected :-).

Thank you very much for your support!

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 1 guest