BPI-R2 pro gpio control

i want to use led on/off 7 pin (gpio 40 header) but it doesn’t work.

Others work fine:

echo 20 > /sys/class/gpio/export
echo 23 > /sys/class/gpio/export
echo 40 > /sys/class/gpio/export
echo 42 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio20/direction
echo out > /sys/class/gpio/gpio23/direction
echo out > /sys/class/gpio/gpio40/direction
echo out > /sys/class/gpio/gpio42/direction

echo 1 > /sys/class/gpio/gpio20/value
echo 1 > /sys/class/gpio/gpio23/value
echo 1 > /sys/class/gpio/gpio40/value
echo 1 > /sys/class/gpio/gpio42/value

Pin 7 is GPIO3 B5 (13) and shared with pwm10 which is disabled by default

https://wiki.fw-web.de/doku.php?id=en:bpi-r2pro:gpio

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts#n682

So i guess your gpio calculation is wrong,i’m unsure how only a number here is enough…you need to target pin13 on 4th controller

i used armbian and i dont see it in rk3568-bpi-r2-pro.dtb pwm10 https://www.armbian.com/bananapi-r2-pro/ r2pro.dts (229.1 КБ)

pwm10 {

                    pwm10m0-pins {
                            rockchip,pins = <0x03 0x0d 0x05 0xab>;
                            phandle = <0x9d>;
                    };

                    pwm10m1-pins {
                            rockchip,pins = <0x02 0x01 0x02 0xab>;
                            phandle = <0x1f5>;
                    };

maybe I misunderstand

Dts looks a bit strange…maybe armbian does it a bit different…and it seems that it is enabled (no disabled statement)…so pwm blocks access to the “normal” gpio