[SOLVED] Restore original KBI

Hi,
I connected my vim2 with serial debugging tool and stop autoboot, I tried few commands, this is output
=> kbi hwver
saradc: 0x7f5, hw_ver: 0x22 (VIM2.V12)
=> kbi usid
Error reading the chip: -110
Error reading the chip: -110
Error reading the chip: -110
Error reading the chip: -110
Error reading the chip: -110
Error reading the chip: -110
usid: 000000
=> kbi bootmode r
Error reading the chip: -110
bootmode err: -110
=> kbi adc
Error reading the chip: -110
Error reading the chip: -110
adc: 0x0
=> kbi ethmac
Error reading the chip: -110
mac address: 00:00:00:00:00:00

I don’t remember mess I did last time, maybe update u-boot or somethings else…
Can I restore original uboot/kbi?

Thanks

Hello, Another VIM2 user experienced a similar KBI error. Perhaps the answer is in that thread.

@gazn3vada Which one imges you used ?

Thanks @RDFTKV and @Frank for your answers,
By krescue I flashed “VIMx.Ubuntu-xfce-bionic_Linux-4.9_arm64_V20190917.emmc” after “VIM2.Android.Nougat_V190518.emmc”.

Now my boot log:
GXM:BL1:dc8b51:76f1a5;FEAT:ADFC318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 100281

BL2 Built : 16:32:58, Nov  3 2017. 
gxl gb5491d8 - xiaobo.gu@droid12

set vdd cpu_a to 1120 mv
set vdd cpu_b to 1050 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR4 chl: Rank0+1 @ 1008MHz
Rank0: 2048MB(auto)-2T-18
Rank1: 1024MB(auto)-2T-18
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl31 from eMMC, src: 0x00020200, des: 0x05100000, size: 0x0002c600
Load bl33 from eMMC, src: 0x00050200, des: 0x01000000, size: 0x00056000
NOTICE:  BL3-1: v1.0(release):35dd647
NOTICE:  BL3-1: Built : 15:20:30, Feb  7 2018
NOTICE:  BL31: BL33 decompress pass
mpu_config_enable:ok
[Image: gxl_v1.1.3243-377db0f 2017-09-07 11:28:58 qiufang.dai@droid07]
OPS=0x82
wdt: reset registers!
97 9d 1a 40 c6 e1 67 a3 67 5d 1c 84 [0.314144 Inits done]
secure task start!
high task start!
low task start!
ERROR:   Error initializing runtime service opteed_fast


U-Boot 2015.01-g4c6694f (May 17 2019 - 18:11:25)

DRAM:  3 GiB
Relocation Offset is: b6ed0000
register usb cfg[0][1] = 00000000b7f58538
[CANVAS]canvas init
MMC:   aml_priv->desc_buf = 0x00000000b3ed0640
aml_priv->desc_buf = 0x00000000b3ed2960
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
init_part() 293: PART_TYPE_AML
[mmc_init] mmc init success
dtb magic edfe0dd0
start dts,buffer=00000000b3ed51b0,dt_addr=00000000b3ed51b0
parts: 10
00:      logo	0000000002000000 1
01:  recovery	0000000002000000 1
02:       rsv	0000000000800000 1
03:       tee	0000000000800000 1
04:     crypt	0000000002000000 1
05:      misc	0000000002000000 1
06:      boot	0000000002000000 1
07:    system	0000000080000000 1
08:     cache	0000000020000000 2
09:      data	ffffffffffffffff 4
init_part() 293: PART_TYPE_AML
eMMC/TSD partition table have been checked OK!
check pattern success
mmc env offset: 0x27400000 
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-917: calc e9efbecc, store 0
dtb_read()-1034: cpy 1 is not valid
_verify_dtb_checksum()-917: calc e9efbecc, store 0
dtb_read()-1034: cpy 0 is not valid
dtb_read()-1039: total valid 0
vpu: clk_level in dts: 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
vpu: vpu_clk_gate_init_off
vpp: vpp_init
hpd_state=1
[1080p60hz] is invalid for cvbs.
set hdmitx VIC = 16
config HPLL = 2970000
HPLL: 0xc000027b
config HPLL done
j = 4  vid_clk_div = 1
hdmitx: set enc for VIC: 16
HDMITX-DWC addr=0x10004006 rd_data=0x40
Error: HDMITX-DWC exp_data=0xff mask=0x9f
rx version is 1.4 or below  div=10
hdmtix: set audio
hdmitx phy setting done
vpp: vpp_pq_load pq val error !!!
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-917: calc e9efbecc, store 0
dtb_read()-1034: cpy 1 is not valid
_verify_dtb_checksum()-917: calc e9efbecc, store 0
dtb_read()-1034: cpy 0 is not valid
dtb_read()-1039: total valid 0
Net:   [aml_i2c_xfer] error ret = -110 	i2c master a current slave addr is 0x18
i2c_write: i2c transfer failed
Error writing the chip: -110
dwmac.c9410000amlkey_init() enter!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0

Start read misc partition datas!
info->attemp_times = 0
info->active_slot = 0
info->slot_info[0].bootable = 1
info->slot_info[0].online = 1
info->slot_info[1].bootable = 0
info->slot_info[1].online = 0
info->attemp_times = 0
attemp_times = 0 
active slot = 0 
wipe_data=successful
wipe_cache=successful
upgrade_step=0
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0xbf851000
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0xbf851000
[CANVAS]addr=0xbf851000 width=3840, height=2160
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
[aml_i2c_xfer] error ret = -110 	i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
[BL31]: tee size: 0

usid: 98aafc6048d5
[aml_i2c_xfer] error ret = -110 	i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
[BL31]: tee size: 0

mac address: 98:aa:fc:60:48:d5
[KM]Error:f[key_manage_query_size]L507:key[deviceid] not programed yet
saradc - saradc sub-system

Usage:
saradc saradc open <channel>		- open a SARADC channel
saradc close	- close the SARADC
saradc getval	- get the value in current channel
saradc get_in_range <min> <max>	- return 0 if current value in the range of current channel

gpio: pin GPIOAO_2 (gpio 102) value is 1
saradc: 0x1cb, hw_ver: 0x12
Product checking: pass! Hardware version: VIM2.V12
saradc: 0x1cc, hw_ver: 0x12
saradc: 0x1ca, hw_ver: 0x12
[aml_i2c_xfer] error ret = -110 	i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
[aml_i2c_xfer] error ret = -110 	i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
state err
[aml_i2c_xfer] error ret = -110 	i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
boot wol: disable
card out
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
emmc/sd response timeout, cmd1, status=0x1ff2800
SF: Detected W25Q16FW with page size 256, total 2 MiB
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0 
kvim2#

And kbi version:
kvim2#kbi version
[aml_i2c_xfer] error ret = -110 i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
[aml_i2c_xfer] error ret = -110 i2c master a current slave addr is 0x18
i2c_read: i2c transfer failed
Error reading the chip: -110
version: 00
kvim2#

@gazn3vada Can you use USB_burn-tool to burn a image ? Don’t use krescue frist .

Thanks Frank,
I used usb_burn from serial and now everythings is ok!

kvim2#kbi version   
version: 03
kvim2#kbi usid
[BL31]: tee size: 0

usid: 98aafc6048d5
kvim2#kbi adc
adc: 0x25a
kvim2#kbi ethmac
[BL31]: tee size: 0

mac address: 98:aa:fc:60:48:d5

Some note:

1 - format usb drive in fat32
2 - save “update.img” from Nougat image (https://dl.khadas.com/Firmware/VIM2/Android/Nougat/VIM2_Nougat_V180619.7z) in usb drive
3 - save “aml_sdc_burn.ini” (example from https://github.com/khadas/images_upgrade/blob/master/Amlogic/aml_sdc_burn.ini) in usb drive
4 - connect usb drive to VIM2
5 - connect serial debugging tool and stop autoboot
6 - type command usb_burn aml_sdc_burn.ini
kvim2#usb_burn aml_sdc_burn.ini
[MSG]usb start
(Re)start USB…
USB0: USB3.0 XHCI init start
Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices… 3 USB Device(s) found
scanning usb for storage devices… init_part() 278: PART_TYPE_DOS
1 Storage Device(s) found
[MSG]ini sz 0x24dB
[fat]Filesize is 0x24dB[0M]
[fat]0x:leftSz 24d < BPS 8000, gotSz 24d

=========sdc_burn_paras=====>>>
[common]
erase_bootloader = 1
erase_flash      = 1
reboot           = 0x0
key_overwrite    = 0x0

[burn_ex]
package          = update.img
media            = 

[burn_parts]
burn_num         = 0

<<<<=====sdc_burn_paras======

[fat]Filesize is 0x5ed60ac4B[1517M]
[fat]0x:leftSz 6c40 < BPS 8000, gotSz 6c40
[MSG]image version [0x00000002]
[MSG]cfg10=0xADFC318C
[fat]Seek 0xaab00 from 0x6c40
[MSG]itemSizeNotAligned 0x5500
[MSG]align 4 mmc read...	[fat]0x:leftSz 608d < BPS 8000, gotSz b58d
[MSG]Down(mem) part(dtb) sz(0xb58d) fmt(normal)
[MSG]Burn Start...
[MSG]load dt.img to 0x0000000001000000, sz=0xb58d
[MSG]Burn complete
[MSG]echo video prepare for upgrade
hpd_state=1
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0xbf851000
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0xbf851000
[1080p60hz] is invalid for cvbs.
set hdmitx VIC = 16
config HPLL = 2970000
HPLL: 0xc000027b
config HPLL done
j = 4  vid_clk_div = 1
hdmitx: set enc for VIC: 16
rx version is 1.4 or below  div=10
hdmtix: set audio
hdmitx phy setting done
[MSG]dw,dh[1920, 1080]
[MSG]w,h[4,14]
[MSG]Exit before re-init
command:	store  exit
dtb magic edfe0dd0
start dts,buffer=0000000001000000,dt_addr=0000000001000000
parts: 10
00:      logo	0000000002000000 1
01:  recovery	0000000002000000 1
02:       rsv	0000000000800000 1
03:       tee	0000000000800000 1
04:     crypt	0000000002000000 1
05:      misc	0000000002000000 1
06:      boot	0000000002000000 1
07:    system	0000000080000000 1
08:     cache	0000000020000000 2
09:      data	ffffffffffffffff 4
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
init_part() 293: PART_TYPE_AML
[mmc_init] mmc init success
switch to partitions #0, OK
mmc1(part 0) is current device
Device: SDIO Port C
Manufacturer ID: 15
OEM: 100
Name: CWBD3 
Tran Speed: 52000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 58.2 GiB
mmc clock: 40000000
Bus Width: 8-bit
[store]amlmmc erase 1emmckey_is_protected : protect
 start = 0,end = 57343


Caution! Your devices Erase group is 0x400
The erase range would be change to 0x36000~0x747bfff

start = 221184,end = 122142718
[burn_parts]
burn_num         = 5
burn_part0       = _aml_dtb
burn_part1       = boot
burn_part2       = logo
burn_part3       = recovery
burn_part4       = system


[MSG]=====>To burn part [_aml_dtb]
[MSG]itemSizeNotAligned 0x5500
[MSG]Down(store) part(_aml_dtb) sz(0xb58d) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 1
[MSG]itemSizeNotAligned 0x5500
[fat]0x:leftSz 608d < BPS 8000, gotSz 608d
[MSG]Burn Start...
[MSG]optimus_download_dtb_image:dataSzReceived=0xb58d
start erase dtb......
start = 81920,end = 82943
dev # 1,  , several blocks erased OK
[store]To run cmd[emmc dtb_write 0x00000000076fab00 0x40000]
dtb_write()-1140: valid 0
dtb_write()-1160: new stamp 0, checksum 0x603a4a1a, version 1, magic A~D
dtb magic edfe0dd0
start dts,buffer=00000000076fab00,dt_addr=00000000076fab00
dtb magic edfe0dd0
start dts,buffer=00000000076fab00,dt_addr=00000000076fab00
parts: 10
00:      logo	0000000002000000 1
01:  recovery	0000000002000000 1
02:       rsv	0000000000800000 1
03:       tee	0000000000800000 1
04:     crypt	0000000002000000 1
05:      misc	0000000002000000 1
06:      boot	0000000002000000 1
07:    system	0000000080000000 1
08:     cache	0000000020000000 2
09:      data	ffffffffffffffff 4
init_part() 293: PART_TYPE_AML
partition table success
[MSG]Burn complete
[store]To run cmd[emmc dtb_read 0x0000000007700000 0x40000]
dtb_read_shortcut()-975: short cut in...
[MSG]VERIFY OK 

[MSG]=====>To burn part [boot]
[fat]Seek 0x15e510 from 0xb60bd
[MSG]itemSizeNotAligned 0x1af0
[MSG]flash LOGIC partCap 0x2000000B
[MSG]Down(store) part(boot) sz(0x8e1800) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 142
[MSG]itemSizeNotAligned 0x1af0
[fat]0x:leftSz 7d10 < BPS 8000, gotSz fd10
[MSG]Burn Start...
[MSG]Burn complete
[MSG]Verify Start...
[MSG]To verify part boot in fmt normal
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [logo]
[fat]Seek 0xae7d70 from 0xa3fd40
[MSG]itemSizeNotAligned 0x290
[MSG]flash LOGIC partCap 0x2000000B
[MSG]Down(store) part(logo) sz(0x257c40) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 38
[MSG]itemSizeNotAligned 0x290
[fat]0x:leftSz 79b0 < BPS 8000, gotSz 79b0
[MSG]Burn Start...
[MSG]Burn complete
[MSG]Verify Start...
[MSG]To verify part logo in fmt normal
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [recovery]
[fat]Seek 0xd52264 from 0xd3f9e0
[MSG]itemSizeNotAligned 0x5d9c
[MSG]flash LOGIC partCap 0x2000000B
[MSG]Down(store) part(recovery) sz(0xcf0000) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 207
[MSG]itemSizeNotAligned 0x5d9c
[fat]0x:leftSz 2264 < BPS 8000, gotSz a264
[MSG]Burn Start...
[MSG]Burn complete
[MSG]Verify Start...
[MSG]To verify part recovery in fmt normal
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [system]
[MSG]itemSizeNotAligned 0x5d6c
[MSG]flash LOGIC partCap 0x80000000B
[MSG]Down(store) part(system) sz(0x5d31e800) fmt(sparse)
[MSG]totalSlotNum = 0, nextWriteBackSlot 1024
[MSG]itemSizeNotAligned 0x5d6c
[MSG]Burn Start...
[fat]0x:leftSz a94 < BPS 8000, gotSz 8a94
[MSG]Burn complete
Downloading %100
[MSG]Verify Start...
[MSG]To verify part system in fmt sparse
[MSG]Verify End
[MSG]VERIFY OK 

[MSG]=====>To burn part [bootloader]
[MSG]itemSizeNotAligned 0x2c0
[MSG]Down(store) part(bootloader) sz(0xa8000) fmt(normal)
[MSG]totalSlotNum = 0, nextWriteBackSlot 11
[MSG]itemSizeNotAligned 0x2c0
[fat]0x:leftSz 7d40 < BPS 8000, gotSz 7d40
[MSG]Burn Start...
mmc switch to boot0 success
mmc switch to boot1 success
mmc switch to user success
[MSG]Burn complete
mmc switch to boot0 success
mmc switch to boot1 success
mmc switch to user success
[MSG]VERIFY OK 
[MSG]Set upgrade_step to 1
Saving Environment to aml-storage...
mmc env offset: 0x27400000 
Writing to MMC(1)... done
[MSG]to close image
[MSG]======sdc burn SUCCESS.
[MSG]stop here as poweroff and powerkey not supported in platform!
[MSG]You can <Ctrl-c> to reboot

@gazn3vada Maybe krescure don’t support it . We will check it . You can use use_burn_tool .