March 4, 20251 yr Hello Community! I am struggling with assigning numbers to I2C buses in my BPi, doing the same(?) thing in two different ways i am getting two different results. By default, there is only /dev/i2c-0 node available, AFAIK because HDMI uses this bus. 1. Using build-in overlay for i2c0 bus (overlays=i2c0 in /boot/armbianEnv.txt) enables another i2c bus. In this case, /dev/i2c-0 is the bus connected to pins 3 and 5 at 40-pin header. The other bus (enabled by default) becomes /dev/i2c-1. It doesn't matter how many times i reset my board, assignment doesn't change. 2. The second way is to create my own overlay by cloning this code and compiling it with armbian-add-ovelray command. It also enables another i2c bus. However, in this case the buses are swapped, /dev/i2c-0 doesn't change, the newly created bus is /dev/i2c-1 and works fine with sensors connected to pins 3 and 5. This enumeration also doesn't change after reboot. Can someone tell me why does it happens? Does the cod for build-in overlay differ from the shared one? Please, be patient for newbie user Here is the version: cat /etc/armbian-release # PLEASE DO NOT EDIT THIS FILE BOARD=bananapim2zero BOARD_NAME="Banana Pi M2 Zero" BOARDFAMILY=sun8i BUILD_REPOSITORY_URL=https://github.com/armbian/build BUILD_REPOSITORY_COMMIT=7184c5aa8 LINUXFAMILY=sunxi ARCH=arm BOOT_SOC= IMAGE_TYPE=stable BOARD_TYPE=csc INITRD_ARCH=arm KERNEL_IMAGE_TYPE=zImage KERNEL_TARGET=legacy,current,edge KERNEL_TEST_TARGET=current FORCE_BOOTSCRIPT_UPDATE= FORCE_UBOOT_UPDATE= OVERLAY_DIR="/boot/dtb/allwinner/overlay" VENDOR="Armbian" VENDORDOCS="https://docs.armbian.com" VENDORURL="https://www.armbian.com/" VENDORSUPPORT="https://forum.armbian.com" VENDORBUGS="https://www.armbian.com/bugs" BOOTSCRIPT_FORCE_UPDATE="no" BOOTSCRIPT_DST="boot.cmd" VERSION=25.2.2 REVISION=25.2.2 BRANCH=current
March 9, 20251 yr Hi, to me it looks like there's no difference in the overlay you took from the sunnxi-DT-overlays repo and the one in the Armbian image you're running which comes from this patch: https://github.com/armbian/build/blob/fad71e196230690a2c8205ec977dcc5a653f9746/patch/kernel/archive/sunxi-6.12/patches.armbian/arm-dts-overlay-Add-Overlays-for-sunxi.patch#L4136 Normally according to the doc, i2c-0 is the bus connected to pins 3 an 5 (PA11, PA12), isn't it ? https://wiki.banana-pi.org/Banana_Pi_BPI-M2_ZERO So the behaviour looks correct when you enable the built-in i2c0 overlay. I cannot say why the numbering changes when you use your own overlay. Eventually you could follow the below link and provide 1 log after you boot the build-in overlay and 1 log after you boot with the custom one.
March 19, 20251 yr Author Thank you for your reply. Unfortunately, I don't have that much time to delve into it at the moment (I thought it would be easier to explain). I will come back to this topic as soon as possible.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.