Kbi error writing the chip

hi @Terry,

I have strange error after flasing vim2 ubuntu server fw built by myself with fenix script.
I see a lot of i2c errors

kvim2#kbi led systemon w off
[aml_i2c_xfer] error ret = -110 i2c master a current slave addr is 0x18
i2c_write: i2c transfer failed
Error writing the chip: -110

Also this:
[aml_i2c_xfer] error ret = -110 i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110

S.

Hello @ssehovic

With latest script ?

Have you tried other images ?

https://dl.khadas.com/Firmware/VIM2/Ubuntu/EMMC/VIM2_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20190830.7z

Will try official fw and report back.
S.

1 Like

Hi @numbqq,

after flashing latest official firmware I have same errors and some like these:

sd: req failed (CMD18): -110, retrying…

I flashed form u-boot with usb_burn command from usb stick connected to vim2

Also this error I have with kbi:
kvim2#kbi led systemoff r
[aml_i2c_xfer] error ret = -110 i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
read led mode err

S.

So after flashing latest Android rom everything is working fine.
It seems that errors were because of a wrong uboot.

S.

I checked the V20190830 and it works well.

kvim2#version

U-Boot 2015.01 (Aug 30 2019 - 12:19:42)
aarch64-none-elf-gcc (crosstool-NG linaro-1.13.1-4.8-2013.11 - Linaro GCC 2013.10) 4.8.3 20131111 (prerelease)
GNU ld (crosstool-NG linaro-1.13.1-4.8-2013.11 - Linaro GCC 2013.10) 2.23.2.20130610 Linaro 2013.10-4
kvim2#kbi led systemoff r
led mode: on  [systemoff]
kvim2#

Hi,

I have the same issue on a VIM2 v1.2 with an image built from fenix rev 384c117ddb7b73cdb071bff9f9a7218eef9ec55b (head from Oct 30) and selecting uboot-2015.01 + linux-4.9 kernel

‘kbi hwver’ works (‘saradc: 0x203, hw_ver: 0x22 (VIM2.V12)’), but other kbi commands time out with i2c error -110 and message ‘i2c master a current slave addr is 0x18’

could this be related to https://github.com/khadas/fenix/commit/40586f31e0aa467e578b768ab008081bcd13a730 ?

also i2cdetect doesn’t seem to find anything on the i2c bus:

WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

the following patch for u-boot fixes the problem:

diff --git a/board/khadas/kvim2/kvim2.c b/board/khadas/kvim2/kvim2.c
index 18f2334134..9aee041ef2 100644
--- a/board/khadas/kvim2/kvim2.c
+++ b/board/khadas/kvim2/kvim2.c
@@ -375,7 +375,7 @@ struct aml_i2c_platform g_aml_i2c_plat = {
    .wait_xfer_interval = 5,
    .master_no          = AML_I2C_MASTER_B,
    .use_pio            = 0,
-   .master_i2c_speed   = AML_I2C_SPPED_400K,
+   .master_i2c_speed   = AML_I2C_SPPED_100K,
    .master_b_pinmux = {
            .scl_reg    = (unsigned long)MESON_I2C_MASTER_B_GPIODV_27_REG,
            .scl_bit    = MESON_I2C_MASTER_B_GPIODV_27_BIT,

So you slow down the I2C speed and it works? I checked on my side with a VIM2 V12 board, it works well without slow down the speed…