Hi, I would like to connect w1 device (DS18B20 etc) to GPIO of BPI-R3 and got a big headache. OpenWRT v25.12.0
-
Select a free pin of GPIO by command: “cat /sys/kernel/debug/gpio”. Chose 18pin (GPIO44, UART1_CTS)
-
Created partition with FS FAT on a free space of eMMC - mmcblk0p6 (I found 20M free eMMC space.)
-
Wrote compiled w1-gpio.dts file to the mmcblk0p6 partition. ( dtc -@ -I dts -O dtb -o w1-gpio.dtbo w1-gpio.dts )
/dts-v1/;
/plugin/;
/ {
compatible = "bananapi,bpi-r3", "mediatek,mt7986a";
fragment@0 {
target = <&pio>;
__overlay__ {
w1_pins: w1-gpio-pins {
pins = "GPIO44";
function = "gpio";
};
};
};
fragment@1 {
target = <&uart1>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target-path = "/";
__overlay__ {
onewire {
compatible = "w1-gpio";
gpios = <&pio 44 0>; /* GPIO44, pin 18 */
pinctrl-names = "default";
pinctrl-0 = <&w1_pins>;
status = "okay";
};
};
};
};
- I tried loading changes to U-Boot bootloader by fw_setenv command.
fw_setenv load_w1 ‘fatload mmc 0:6 $loadaddr w1-gpio.dtbo && fdt addr $loadaddr && fdt resize 8192 && fdt apply $loadaddr’
fw_setenv boot_production ‘run boot_update_conf ; led $bootled_pwr on ; run load_w1 ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off’
As a result of reboot, nothing good happened. Folder /sys/bus/w1/devices is empty.
Please, help. Has anyone connected the w1 bus to GPIO?