Rock 5B w1-gpio and ds18b20 sensors

Hi all,

I’m searching for a device-tree overlay for w1-gpio. I’m currently migrating from RPI3+ to the Rock 5b, so far, I’m really happy, except, the d18b20 sensors are not working so far. I found some similar-issues regarding the rk3308-w1-gpio, but I’m not familiar with device-trees. I guess, we have to create a rk3588-w1-gpio, but I’m not aware, which tools I have to use. By the way, I’m using the raxda debian 11 image.

greetings
Michael

So, I solved the problem.

First of all, @raxda, I’m using the dts-file for the rk3568, it is very generic and can be used for the rk3588, so, maybe it is possible to add a modified version for the rock 5b board.

The final workflow is to compile the dts-file to a dtbo, so that it can be used as an overlay. The dtbo file has to be copied to the linux-library location, so that extlinux is able to detect it.

First: extlinux is configured with to use
add the line dtoverlay=rk3588-w1-gpio to the file /boot/config.txt

Second: execute the follosing command in the home directory.

wget https://github.com/radxa/overlays/blob/main/arch/arm64/boot/dts/rockchip/overlays/rk3568-w1-gpio.dts
mv rk3568-w1-gpio.dts rk3588-w1-gpio.dts
IDE=rk3588-w1-gpio
SRC=$IDE.dts
TMP=$IDE.tmp.dts
DST=$IDE.dtbo

cpp -nostdinc -I /usr/src/linux-headers-5.10.66-27-rockchip-gea60d388902d/include/  -undef -x assembler-with-cpp $SRC > $TMP
dtc -@ -O dtb -b 0 -o $DST $TMP
rm $TMP
sudo cp $DST /usr/lib/linux-image-5.10.66-27-rockchip-gea60d388902d/rockchip/overlay/
sudo update_extlinux.sh

afterards reboot the system, and the 1-wire should work as with all other board. This is discussed in ohter threads. I changed the port directly in the dts-file, but it should be possible to do this via the configs.

Hopefully this is of use to someone,
Have Fun.

2 Likes