Can anyone explains what are the steps for making a TV box works with armbian?


supersmurfs
 Share

5 5

Recommended Posts

Yes, I am new to forum. 

Yes, I searched. 

But I still have questions. 

 

My story: At the beginning of the year (2021) I bought one orange pi zero 2 board at a good price. It was around 18 euro. I am very happy with the small board. So I was think to buy a second one. Turn out due to global chip shortage, the price of the board jump to 27 euro. The price is not attritive for me any more. Then I watched a youtube video. I think a lot of people watch the same video. Armbian install on H6 tv Box. so I bought the 'same' Tv box. Apparently, I did not read the spec carefully. The model I bought it is not with H6 CPU, but with H616 CPU. Yes, all the steps which from youtube wont work with my TV box. Then I found out TV box is not active support by Armbian anyway. Armbian is support more on the SBC, such as the orange pi zero 2. 

 

here are my questions:

  • What is big difference between Orangepi zero 2 image and armbian image? if read this page https://github.com/orangepi-xunlong/orangepi-build, it says it based on armbians.
  • As I understaand, to make armbian work on tv box, the first step you need a working u-boot for your tv box. is it possible to dump uboot and dtb file from the android tv box? I can see the android tv box already using u-boot from 2018.
  • if possible to dump u-boot the from android tv box, what are the next steps? build your own armbian images? or same steps like the youtuber video, first burn normal armbian image, then burn u-boot image , then then manually do some tweaks.

 

h616 tv box boot log. 

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2021.06.12 11:46:20 =~=~=~=~=~=~=~=~=~=~=~=
[182]HELLO! BOOT0 is starting!
[185]BOOT0 commit : 904a4b2
[187]set pll start
[190]periph0 has been enabled
[193]set pll end
[195]unknow PMU
[197]PMU: AXP806
[204]vaild para:16  select dram para0
[207]board init ok
[209]DRAM BOOT DRIVE INFO: V0.60
[213]the chip id is 0x5000
[215]chip id check OK
[218]DRAM_VCC set to 1500 mv
[220]DRAM CLK =600 MHZ
[223]DRAM Type =3 (3:DDR3,4:DDR4,7:LPDDR3,8:LPDDR4)
[230]Actual DRAM SIZE =2048 M
[233]DRAM SIZE =2048 MBytes, para1 = 30fb, para2 = 8000000, dram_tpr13 = 6041
[246]DRAM simple test OK.
[249]rtc standby flag is 0x0, super standby flag is 0x0
[254]dram size =2048
[257]card no is 2
[259]sdcard 2 line count 8
[262][mmc]: mmc driver ver 2019-12-19 10:41
[266][mmc]: set f_max to 50M, set f_max_ddr to 50M
[271][mmc]: mmc 2 bias 4
[279][mmc]: ***Try MMC card 2***
[416][mmc]: MMC 5.1
[418][mmc]: HSDDR52/DDR50 8 bit
[421][mmc]: 50000000 Hz
[424][mmc]: 14910 MB
[426][mmc]: ***SD/MMC 2 init OK!!!***
[488]Loading boot-pkg Succeed(index=0).
[492]Entry_name        = u-boot
[501]Entry_name        = monitor
[505]Entry_name        = dtbo
[508]Entry_name        = dtb
[511]tunning data addr:0x4a0003e8
[515]Jump to second Boot.
NOTICE:  BL3-1: v1.0(debug):b8b5557
NOTICE:  BL3-1: Built : 15:01:11, 2021-01-11
NOTICE:  BL3-1 commit: 8
ERROR:   Error initializing runtime service tspd_fast
NOTICE:  BL3-1: Preparing for EL3 exit to normal world
NOTICE:  BL3-1: Next image address = 0x4a000000
NOTICE:  BL3-1: Next image spsr = 0x1d3
ÿ

U-Boot 2018.05-gdd0276b-dirty (Feb 01 2021 - 10:50:58 +0800) Allwinner Technology

[00.591]CPU:   Allwinner Family
[00.593]Model: sun50iw9
I2C:   ready
[00.598]DRAM:  2 GiB
[00.601]Relocation Offset is: 75ec5000
[00.640]secure enable bit: 0
[00.642]pmu_axp152_probe pmic_bus_read fail
[00.647]PMU: AXP806
[00.648]PMU: pmu_axp806 found
[00.652]dcdce_vol = 3300, onoff=1
[00.656]aldo1_vol = 3300, onoff=1
[00.659]bldo1_vol = 1800, onoff=1
[00.662]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=400Mhz
[00.853]sunxi overlay merged okqv
[00.857]init_clocks:finish
[00.859]drv_disp_init
[00.884]HDMI 2.0 driver init start!
[00.893]__clk_enable: clk is null.
[00.896]hdmi cec clk enable failed!
[00.902]drv_disp_init finish
[00.904]gic: sec monitor mode
[00.907]sunxi flash type@2 not support fast burn key
[00.923]node ir_recovery_key_code4 get failed!
[00.944]flash init start
[00.946]workmode = 0,storage type = 2
[00.949]MMC:	 2
[00.951]mmc driver ver uboot2018:2019-12-13 9:48:00
[00.955]get mem for descripter OK !
[00.960]Set eMMC Power Mode to 1.8V!
[00.964]card2 io is 1.8V.
[00.970]get card2 disable pin fail
[00.973]get sdc_ex_dly_used 2, use auto tuning sdly
[00.977]get sdc_ex_dly_used 2, use auto tuning sdly
[00.982]get sdc2 sdc_boot0_sup_1v8 fail.
[00.987]get card-pwr-gpios faild
[00.989]get card2_boot_para:time_pwroff_ms:use default time_pwroff:200
[00.996]io is 1.8V
[00.997]init mmc 2 clock and io
[01.000]devnum 2, prv bffab350, bdesc bbf0ab6c
[01.004]SUNXI SD/MMC: 2
[01.007]==================== work mode: 0 0, sample_mode:2
[01.012]=============== start mmc_init_boot...
[01.154]MMC version:4
[01.156]mmc_startup: set clock 50000000
[01.160]Best spd md: 4-HS400, freq: 3-100000000
[01.164]already at HSSDR52_SDR25 mode
[01.167]Bus width 8
[01.169]sunxi flash init ok
[01.173]Loading Environment from SUNXI_FLASH... OK
[01.181]no secure os for keybox operation
[01.185]try to burn key
[01.188]read item0 copy0
[01.190]the secure storage item0 copy0 is good
[01.194]no item name key_burned_flag in the map
[01.198]sunxi secure storage has no flag
[01.202]usb burn from boot
delay time 0
weak:otg_phy_config
[01.215]usb prepare ok
[02.018]overtime
[02.022]do_burn_from_boot usb : no usb exist
[02.026]boot_gui_init:start
FAT: Misaligned buffer address (bbe80cb8)
34 bytes read in 4 ms (7.8 KiB/s)
[02.044]get format[40a] for type[4]
[02.047]get format[20b] for type[2]
[02.201][HDMI2.0]CEA VIC=16: [02.203]1920x1080p[02.205]@60 Hz [02.206]16:9, [02.207]8-bpp [02.209]YCbCr-444
[02.210]BT709
[02.211]eotf:SDR_LUMINANCE_RANGE
[02.327]switch device: sel=0, type=4, mode=10, format=1, bits=0, eotf=4, cs=257
[02.334]boot_gui_init:finish
[02.338]bmp_name=bootlogo.bmp
2764856 bytes read in 17 ms (155.1 MiB/s)
[02.374]no item name device_unlock in the map
[02.378]no item name fastboot_status_flag in the map
[02.382]sunxi secure storage has no flag
[02.388]hsddr 2-50000000
[02.390]hs200 5-200000000
[02.392]hs400 4-150000000
[02.395]get max-frequency ok 50000000 Hz
[02.398]0 0 0: 0 0 0
[02.402](weak)update dtb dram start
[02.406]update dtb dram  end
[02.409]update dts
[02.410]no item name rootwait init in the map
** Unrecognized filesystem type **
[02.424]load file(ULI/factory/rootwait init.txt) error.
[02.428]no item name snum in the map
** Unrecognized filesystem type **
[02.441]load file(ULI/factory/snum.txt) error.
[02.445]name in map mac
[02.447]update mac = 481011280498, source:secure
[02.452]no item name wifi_mac in the map
** Unrecognized filesystem type **
[02.464]load file(ULI/factory/wifi_mac.txt) error.
[02.469]no item name bt_mac in the map
** Unrecognized filesystem type **
[02.481]load file(ULI/factory/bt_mac.txt) error.
[02.485]no item name selinux in the map
** Unrecognized filesystem type **
[02.498]load file(ULI/factory/selinux.txt) error.
[02.503]no item name specialstr in the map
** Unrecognized filesystem type **
[02.515]load file(ULI/factory/specialstr.txt) error.
[02.520]name in map hx_flag
[02.523]update hx_flag = 216, source:secure
[02.527]MAC address changed to: 48:10:11:28:04:98
[02.558]update part info
[02.560]key 0
[02.563]cant find rcvy value
[02.568]cant find fstbt value
[02.572]misc partition found
[02.584]update bootcmd
[02.586]serial num is: 2c001415a30109922ce
[02.589]Net:   [02.591]Net Initialization Skipped
[02.594]No ethernet found.
Hit any key to stop autoboot:  0 
[02.607]partinfo: name boot, start 0x2a000, size 0x10000
[02.725]in boot normal mode,pass normal para to cmdline
[02.731]android.hardware = sun50iw9p1
[02.791]Starting kernel ...

 

then I tried two images, one from armbians which wont boot. another one is orange pi zero 2 image. at least I see something happens. I know it wont work. because they are different hardwares.

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2021.06.18 09:19:20 =~=~=~=~=~=~=~=~=~=~=~=
 
U-Boot SPL 2021.01-rc5-armbian (May 06 2021 - 18:50:04 +0000)
DRAM: 1024 MiB
Trying to boot from MMC1
MMC: no card present
spl: mmc init failed with error: -123
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###


[216]HELLO! BOOT0 is starting May 13 2020 14:10:04!
[221]BOOT0 commit : 593cf83
[224]set pll start
[227]periph0 has been enabled
[230]set pll end
[231]unknow PMU
[233]PMU: AXP806
[240]vaild para:1  select dram para0
[244]board init ok
[246]DRAM BOOT DRIVE INFO: V0.52
[249]the chip id is 0x5000
[252]chip id check OK
[254]DRAM_VCC set to 1500 mv
[258]write_leveling error 
[261]read_calibration error 
[265]write_leveling error 
[267]read_calibration error 
[271]write_leveling error 
[274]read_calibration error 
[278]write_leveling error 
[281]read_calibration error 
[285]write_leveling error 
[288]read_calibration error 
[291]write_leveling error 
[294]read_calibration error 
[298]write_leveling error 
[301]read_calibration error 
[305]write_leveling error 
[308]read_calibration error 
[312]write_leveling error 
[315]read_calibration error 
[318]write_leveling error 
[321]read_calibration error 
[324]retraining final error 
[328]write_leveling error 
[331]dx_high 16bit write training error  
[335]dx_high 16bit write training error  
[339]dx_high 16bit write training error  
[344]dx_high 16bit write training error  
[348]dx_high 16bit write training error  
[352]write_training error 
[356]write_leveling error 
[359]dx_high 16bit write training error  
[363]dx_high 16bit write training error  
[367]dx_high 16bit write training error  
[371]dx_high 16bit write training error  
[376]dx_high 16bit write training error  
[380]write_training error 
[384]write_leveling error 
[386]dx_high 16bit write training error  
[391]dx_high 16bit write training error  
[395]dx_high 16bit write training error  
[399]dx_high 16bit write training error  
[403]dx_high 16bit write training error  
[408]write_training error 
[411]write_leveling error 
[414]dx_high 16bit write training error  
[418]dx_high 16bit write training error  
[423]dx_high 16bit write training error  
[427]dx_high 16bit write training error  
[431]dx_high 16bit write training error  
[435]write_training error 
[439]write_leveling error 
[442]dx_high 16bit write training error  
[446]dx_high 16bit write training error  
[450]dx_high 16bit write training error  
[455]dx_high 16bit write training error  
[459]dx_high 16bit write training error  
[463]write_training error 
[467]write_leveling error 
[470]dx_high 16bit write training error  
[474]dx_high 16bit write training error  
[478]dx_high 16bit write training error  
[482]dx_high 16bit write training error  
[487]dx_high 16bit write training error  
[491]write_training error 
[494]write_leveling error 
[497]dx_high 16bit write training error  
[502]dx_high 16bit write training error  
[506]dx_high 16bit write training error  
[510]dx_high 16bit write training error  
[514]dx_high 16bit write training error  
[519]write_training error 
[522]write_leveling error 
[525]dx_high 16bit write training error  
[529]dx_high 16bit write training error  
[534]dx_high 16bit write training error  
[538]dx_high 16bit write training error  
[542]dx_high 16bit write training error  
[546]write_training error 
[550]write_leveling error 
[553]dx_high 16bit write training error  
[557]dx_high 16bit write training error  
[561]dx_high 16bit write training error  
[566]dx_high 16bit write training error  
[570]dx_high 16bit write training error  
[574]write_training error 
[578]write_leveling error 
[581]dx_high 16bit write training error  
[585]dx_high 16bit write training error  
[589]dx_high 16bit write training error  
[593]dx_high 16bit write training error  
[598]dx_high 16bit write training error  
[602]write_training error 
[604]retraining final error 
[609]read_calibration error 
[612]read_calibration error 
[616]read_calibration error 
[620]read_calibration error 
[624]read_calibration error 
[628]read_calibration error 
[632]read_calibration error 
[636]read_calibration error 
[640]read_calibration error 
[644]read_calibration error 
[647]retraining final error 
[651][AUTO DEBUG]16 bit,1 ranks training success!
[658]DRAM CLK =720 MHZ
[660]DRAM Type =3 (3:DDR3,4:DDR4,7:LPDDR3,8:LPDDR4)
[667]Actual DRAM SIZE =1024 M
[669]DRAM SIZE =1024 MBytes, para1 = 30fb, para2 = 4000001, dram_tpr13 = 6041
[683]DRAM simple test OK.
[685]rtc standby flag is 0x0, super standby flag is 0x0
[690]dram size =1024
[693]*****dram handle ok****
[696]card no is 0
[698]sdcard 0 line count 4
[701][mmc]: mmc driver ver 2019-12-19 10:41
[705][mmc]: sdc0 spd mode error, 2
[708][mmc]: set f_max to 50M, set f_max_ddr to 25M
[713][mmc]: mmc 0 bias 0
[721][mmc]: Wrong media type 0x0
[724][mmc]: ***Try SD card 0***
[743][mmc]: HSSDR52/SDR25 4 bit
[747][mmc]: 50000000 Hz
[749][mmc]: 30436 MB
[751][mmc]: ***SD/MMC 0 init OK!!!***
[852]Loading boot-pkg Succeed(index=0).
[856]Entry_name        = u-boot
[865]Entry_name        = monitor
[869]Entry_name        = dtbo
[872]Entry_name        = dtb
[876]Jump to second Boot.
NOTICE:  BL3-1: v1.0(debug):9fecd83
NOTICE:  BL3-1: Built : 17:08:29, 2020-05-28
NOTICE:  BL3-1 commit: 8
ERROR:   Error initializing runtime service tspd_fast
NOTICE:  BL3-1: Preparing for EL3 exit to normal world
NOTICE:  BL3-1: Next image address = 0x4a000000
NOTICE:  BL3-1: Next image spsr = 0x1d3


U-Boot 2018.05-orangepi (Mar 16 2021 - 10:43:40 +0800) Xunlong Software

[00.953]CPU:   Allwinner H616
[00.956]Model: Orange Pi Zero 2
I2C:   ready
[00.961]DRAM:  1 GiB
Relocation Offset is: 35ec9000
[01.001]secure enable bit: 0
[01.004]PMU: AXP806
[01.008]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=400Mhz
[01.190]sunxi overlay merged okqv
[01.194]drv_disp_init
[01.223]__clk_enable: clk is null.
tv_init()950 fetch tv0 err.
[01.228]drv_disp_init finish
[01.231]gic: sec monitor mode
[01.236]flash init start
[01.238]workmode = 0,storage type = 1
[01.241]MMC:	 0
[01.243]get mem for descripter OK !

card_caps:0x3000000a
host_caps:0x3000003f
[01.279]sunxi flash init ok
[01.283]Loading Environment from FAT... [01.286]get mem for descripter OK !

** Bad device mmc 1 **
Failed (-5)
[01.301]usb burn from boot
delay time 0
weak:otg_phy_config
[01.314]usb prepare ok
[02.117]overtime
[02.121]do_burn_from_boot usb : no usb exist
[02.125]boot_gui_init:start
card_caps:0x3000000a
host_caps:0x3000003f
104 bytes read in 6 ms (16.6 KiB/s)
Set HDMI disp_mode to 1080p60
104 bytes read in 7 ms (13.7 KiB/s)
Set fb0_width to 1280
Set fb0_height to 720
[02.451]boot_gui_init:finish
[02.454]bmp_name=/boot/boot.bmp
230456 bytes read in 17 ms (12.9 MiB/s)
[02.486]update dts
Net:   [02.490]No ethernet found.
Hit any key to stop autoboot:  1  0 
no mmc device at slot 1
card_caps:0x3000000a
host_caps:0x3000003f
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
2616 bytes read in 9 ms (283.2 KiB/s)
## Executing script at 43100000
U-boot loaded from SD
Boot script loaded from mmc
104 bytes read in 7 ms (13.7 KiB/s)
8472802 bytes read in 366 ms (22.1 MiB/s)
24125512 bytes read in 1020 ms (22.6 MiB/s)
## Booting kernel from Legacy Image at 41000000 ...
   Image Name:   
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    24125448 Bytes = 23 MiB
   Load Address: 41000000
   Entry Point:  41000000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 43300000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    8472738 Bytes = 8.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 497eb000, end 49fff8a2 ... OK
   reserving fdt memory region: addr=48000000 size=1000000
## Linux machid: 00000000, FDT addr: 7be89580

Starting kernel ...

 

 

I dont need HDMI or Bluetooth or wifi. If usb port and ethernet works, that's good enough for me. 

 

 

Link to post
Share on other sites

  • supersmurfs changed the title to Can anyone explains what are the steps for making a TV box works with armbian?
Armbian is a community driven open source project. Do you like to contribute your code?

Hi! 

 

Well, directly to your questions 

 

The first step to compile a operating system to any ARM board is to know your board's Device Tree (DTB file)

 

You can extract the DTBs from the stock Android ROM. I do it on Linux using the tool binwalk to lookup the image and find the DTBs

There are other methods you can search 

 

About the u-boot, you can't use the Android u-boot. Android uses very old kernels, so it's U-Boot release Is made to boot those. 

You need a modern U-Boot release, so that's your first step 

 

To bring Linux to a new board, you'll need to compile U-Boot from source and use the DTB file you just extracted from the stock Android ROM. 

 

After that, you can use the Armbian kernel and use any Armbian image or even use your own custom rootfs 

 

My boxes are running Arch Linux ARM actually! 

 

If you get stuck in one of those steps, just post it here or, if you want to, PM me 

 

Good luck!

Link to post
Share on other sites

4 minutes ago, Clonazepunk said:

Hi! 

 

Well, directly to your questions 

 

The first step to compile a operating system to any ARM board is to know your board's Device Tree (DTB file)

 

You can extract the DTBs from the stock Android ROM. I do it on Linux using the tool binwalk to lookup the image and find the DTBs

There are other methods you can search 

 

About the u-boot, you can't use the Android u-boot. Android uses very old kernels, so it's U-Boot release Is made to boot those. 

You need a modern U-Boot release, so that's your first step 

 

To bring Linux to a new board, you'll need to compile U-Boot from source and use the DTB file you just extracted from the stock Android ROM. 

 

After that, you can use the Armbian kernel and use any Armbian image or even use your own custom rootfs 

 

My boxes are running Arch Linux ARM actually! 

 

If you get stuck in one of those steps, just post it here or, if you want to, PM me 

 

Good luck!

Thanks for your reply. It is much clear for me now. So my first will be using binwalk extra dtb from the android  img. Right now I don’t have any img file from the Android box. I can try to contact the AliExpress seller. Even I don’t expect much useful information from them. Otherwise, my first step would be to leaning dump img from the android box. 

Link to post
Share on other sites

2 hours ago, Clonazepunk said:

So, Allwinner chips have a flashing tool called PhoenixSuit

 

I'm not sure, by maybe you can dump the image through it 

It worth the test

 

thanks again. I have been google around. I found this post. https://unix.stackexchange.com/questions/347489/current-question-how-can-i-decompile-an-arm-firmware-file-to-get-the-device-tr

At the end of page, some small letters says: 

Quote

FYI. An android firmware/recovery or boot partition can contain multiple dtb files. Also, an android dtb is not compatable with linux. Already been down that rabbit hole! – 5p0ng3b0b Aug 27 '20 at 8:46 

 

Link to post
Share on other sites

Now I am totally agres with Armbian offically not supporting the cheap android TV box. It just takes too much time and efforts. 

If there is a way can easily extract dtb file from the cheap tv box and it easily adopt for linux, I think the tv box and armiban both will become more popular. It will be much easier for beginners/ new users like me. 

 

Right now, I cannot get any further about extra dtb file from android. I think the tv box need to be rooted at first then extra recovery/boot image from it. then then extra dtb file from the image file. finally, the dtb file might be not working with liunx. 

 

Another option, waiting for reaction for the aliexpress seller. I asked for the image file of the tv box. 

 

 

Link to post
Share on other sites

Try the PhoenixSuit solution 

 

Your box doesn't need root accees on Android. There's a button somewhere in your board that triggers FEL mode 

Every Allwinner processor has it 

 

More info at https://linux-sunxi.org/FEL

 

When in FEL mode, you can plug your board on your PC using a USB male to male cable. It allows direct access to the internal memory, thus allowing to dump it

 

I found the cable available online, but with two old USB cables and some electric tape you can build your own lol 

 

Besides the PhoenixSuit, there is also the sunxi-fel tool. It allows the memory dump. Just tried with Allwinner H3 and Allwinner F1C100 and it works like a charm :D

 

 

Link to post
Share on other sites

11 часов назад, Clonazepunk сказал:

That's not true 

We have a lot of people who could boot Armbian on their boxes by using the original DTB file. 

 

Sometimes, is the only way

Do not mislead users. DTB from Android will never work directly on Armbian. These are completely different kernels, Android always has very old kernels that are not compatible with Armbian.

Link to post
Share on other sites

Luckily, The aliexpress sell sent me the android 10 image in 24 hours. I am very happy I dont need to manually dump the andriod image any more. 

 

I have tried using extract-dbt.py and binwalk. I have no idea about what I am looking at. 

 

The tool extract-dtb.py got memory error message. 

(python37) pi@raspberrypi4GB:~/Documents/H6_h616 $ extract-dtb H6_H616_timing_20210203_1530_v1.9_202102030101.img -o /home/pi/Documents/H6_h616/dtb
Dumped 00_kernel, start=0 end=110592
Dumped 01_dtbdump_,sun50iw9.dtb, start=110592 end=734780
Dumped 02_dtbdump_+(o
.dtb, start=734780 end=1771068
Dumped 03_dtbdump_+(o
.dtb, start=1771068 end=2479104
Dumped 04_dtbdump_board_manufacturer,board_model.dtb, start=2479104 end=2484224
Dumped 05_dtbdump_,sun50iw9.dtb, start=2484224 end=52503552
Traceback (most recent call last):
  File "/home/pi/Documents/python37/bin/extract-dtb", line 10, in <module>
    sys.exit(main())
  File "/home/pi/Documents/python37/lib/python3.7/site-packages/extract_dtb/extract_dtb.py", line 158, in main
    split(args)
  File "/home/pi/Documents/python37/lib/python3.7/site-packages/extract_dtb/extract_dtb.py", line 74, in split
    dump_file(filepath, content[begin_pos:pos])
MemoryError

 

Binwalk tool signatures:

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
110592        0x1B000         device tree image (dtb)
411024        0x64590         uImage header, header size: 64 bytes, header CRC: 0x2DE9F045, created: 1973-11-13 18:10:56, image size: 776473926 bytes, Data Address: 0x16461C46, Entry Point: 0xDDF83080, data CRC: 0xFCF7CCFA, image name: ""
734780        0xB363C         device tree image (dtb)
784180        0xBF734         CRC32 polynomial table, little endian
834203        0xCBA9B         Copyright string: "Copyright (C) 2010 Charles Cazabon."
836528        0xCC3B0         Android bootimg, kernel size: 1851878912 bytes, kernel addr: 0x6E695F64, ramdisk size: 1677750118 bytes, ramdisk addr: 0x5F706D75, product name: "s"
1447312       0x161590        uImage header, header size: 64 bytes, header CRC: 0x2DE9F045, created: 1973-11-13 18:10:56, image size: 776473926 bytes, Data Address: 0x16461C46, Entry Point: 0xDDF83080, data CRC: 0xFCF7CCFA, image name: ""
1771068       0x1B063C        device tree image (dtb)
1820468       0x1BC734        CRC32 polynomial table, little endian
1870491       0x1C8A9B        Copyright string: "Copyright (C) 2010 Charles Cazabon."
1872816       0x1C93B0        Android bootimg, kernel size: 1851878912 bytes, kernel addr: 0x6E695F64, ramdisk size: 1677750118 bytes, ramdisk addr: 0x5F706D75, product name: "s"
2479104       0x25D400        device tree image (dtb)
2484224       0x25E800        device tree image (dtb)
2619392       0x27F800        Microsoft executable, portable (PE)
2767872       0x2A3C00        Microsoft executable, portable (PE)
3140935       0x2FED47        mcrypt 2.5 encrypted data, algorithm: "sProcessorFeaturePresent", keysize: 871 bytes, mode: "I",
3146848       0x300460        XML document, version: "1.0"
3313671       0x329007        Unix path: /home/user/lichee/tools/pack/out_android/
3314530       0x329362        Unix path: /home/user/lichee/tools/pack/out_android/boot.img  /home/user/imgdata/boot
3467263       0x34E7FF        Unix path: /home/user/lichee/tools/pack/out_android/
3467982       0x34EACE        Unix path: /home/user/lichee/tools/pack/out_android/boot.img  /home/user/imgdata/boot
3478528       0x351400        Microsoft executable, portable (PE)
3926528       0x3BEA00        PC bitmap, Windows 3.x format,, 1280 x 720 x 24
6693376       0x662200        PC bitmap, Windows 3.x format,, 1280 x 720 x 24
9460224       0x905A00        PC bitmap, Windows 3.x format,, 1280 x 720 x 24
12227072      0xBA9200        PC bitmap, Windows 3.x format,, 246 x 257 x 24
12417536      0xBD7A00        PC bitmap, Windows 3.x format,, 1280 x 720 x 24
12628545      0xC0B241        MySQL ISAM compressed data file Version 6
12636304      0xC0D090        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12640144      0xC0DF90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12643984      0xC0EE90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12647824      0xC0FD90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12651664      0xC10C90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12655504      0xC11B90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12659344      0xC12A90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12663184      0xC13990        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12667024      0xC14890        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12670864      0xC15790        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12674704      0xC16690        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12678544      0xC17590        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12682384      0xC18490        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12686224      0xC19390        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12690064      0xC1A290        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12693904      0xC1B190        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12697744      0xC1C090        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12701584      0xC1CF90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12705424      0xC1DE90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12709264      0xC1ED90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12713104      0xC1FC90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12716944      0xC20B90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12720784      0xC21A90        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
12724624      0xC22990        LZMA compressed data, properties: 0x66, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
13825297      0xD2F511        LZMA compressed data, properties: 0x5A, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
14248102      0xD968A6        LZMA compressed data, properties: 0x75, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
15184384      0xE7B200        PC bitmap, Windows 3.x format,, 1280 x 720 x 24
18309632      0x1176200       PC bitmap, Windows 3.x format,, 1280 x 720 x 24
19720348      0x12CE89C       LZMA compressed data, properties: 0x89, dictionary size: 16777216 bytes, uncompressed size: 257 bytes
21076480      0x1419A00       PC bitmap, Windows 3.x format,, 1280 x 720 x 24
23843328      0x16BD200       PC bitmap, Windows 3.x format,, 1280 x 720 x 24
26958336      0x19B5A00       PC bitmap, Windows 3.x format,, 258 x 334 x 32
27304448      0x1A0A200       PC bitmap, Windows 3.x format,, 250 x 120 x 32
27425280      0x1A27A00       PC bitmap, Windows 3.x format,, 120 x 186 x 32
27515392      0x1A3DA00       PC bitmap, Windows 3.x format,, 250 x 120 x 32
27636224      0x1A5B200       PC bitmap, Windows 3.x format,, 250 x 120 x 32
27757056      0x1A78A00       PC bitmap, Windows 3.x format,, 250 x 120 x 32
27877888      0x1A96200       PC bitmap, Windows 3.x format,, 250 x 120 x 32
27998720      0x1AB3A00       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28119552      0x1AD1200       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28240384      0x1AEEA00       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28361216      0x1B0C200       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28482048      0x1B29A00       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28602880      0x1B47200       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28723712      0x1B64A00       PC bitmap, Windows 3.x format,, 250 x 120 x 32
28844544      0x1B82200       PC bitmap, Windows 3.x format,, 800 x 480 x 32
30503424      0x1D17200       PC bitmap, Windows 3.x format,, 1280 x 720 x 24
33403904      0x1FDB400       Android bootimg, kernel size: 18323464 bytes, kernel addr: 0x40080000, ramdisk size: 771370 bytes, ramdisk addr: 0x43000000, product name: "".............

 

 

I am curious about decompileing the DTB file. I saw somebody had the same questions: how to decompile dtb file? https://forum.digilentinc.com/topic/2427-how-to-decompile-dtb-file/

 

Quote

Posted July 13, 2016

Thanks, I found the script under kernel tools dtc, it works like magic

 

~/gits/linux-xlnx/scripts/dtc/dtc -I dtb -O dts -o devicetree.dts devicetree.dtb

 

binwalk_log.7z

Link to post
Share on other sites

With dtc compiler I try to convert 01_dtbdump_sun50iw9.dtb to dts. Here is what I got. 

/dts-v1/;

/memreserve/	0x0000000048000000 0x0000000001000000;
/ {
	interrupt-parent = < 0x01 >;
	#address-cells = < 0x02 >;
	#size-cells = < 0x02 >;
	model = "sun50iw9";
	compatible = "allwinner,h616\0arm,sun50iw9p1";

	clocks {
		compatible = "allwinner,clk-init";
		device_type = "clocks";
		#address-cells = < 0x02 >;
		#size-cells = < 0x02 >;
		ranges;
		reg = < 0x00 0x3001000 0x00 0x1000 0x00 0x7010000 0x00 0x400 0x00 0x7000000 0x00 0x04 >;

		losc {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,fixed-clock";
			clock-frequency = < 0x8000 >;
			clock-output-names = "losc";
			linux,phandle = < 0x1e >;
			phandle = < 0x1e >;
		};

		iosc {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,fixed-clock";
			clock-frequency = < 0xf42400 >;
			clock-output-names = "iosc";
			linux,phandle = < 0x20 >;
			phandle = < 0x20 >;
		};

		hosc {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,fixed-clock";
			clock-frequency = < 0x16e3600 >;
			clock-output-names = "hosc";
			linux,phandle = < 0x09 >;
			phandle = < 0x09 >;
		};

		osc48m {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,fixed-clock";
			clock-frequency = < 0x2dc6c00 >;
			clock-output-names = "osc48m";
			linux,phandle = < 0x0a >;
			phandle = < 0x0a >;
		};

		hoscdiv32k {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,fixed-clock";
			clock-frequency = < 0x8000 >;
			clock-output-names = "hoscdiv32k";
			linux,phandle = < 0xdf >;
			phandle = < 0xdf >;
		};

		pll_periph0div25m {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,fixed-clock";
			clock-frequency = < 0x17d7840 >;
			clock-output-names = "pll_periph0div25m";
			linux,phandle = < 0xe0 >;
			phandle = < 0xe0 >;
		};

		pll_cpu {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_cpu";
			linux,phandle = < 0xd3 >;
			phandle = < 0xd3 >;
		};

		pll_ddr0 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_ddr0";
			linux,phandle = < 0xd8 >;
			phandle = < 0xd8 >;
		};

		pll_ddr1 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_ddr1";
			linux,phandle = < 0xe1 >;
			phandle = < 0xe1 >;
		};

		pll_periph0 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			assigned-clocks = < 0x02 >;
			assigned-clock-rates = < 0x23c34600 >;
			lock-mode = "new";
			clock-output-names = "pll_periph0";
			linux,phandle = < 0x02 >;
			phandle = < 0x02 >;
		};

		pll_periph1 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			assigned-clocks = < 0x03 >;
			assigned-clock-rates = < 0x23c34600 >;
			lock-mode = "new";
			clock-output-names = "pll_periph1";
			linux,phandle = < 0x03 >;
			phandle = < 0x03 >;
		};

		pll_gpu {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_gpu";
			linux,phandle = < 0xda >;
			phandle = < 0xda >;
		};

		pll_video0x4 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_video0x4";
			linux,phandle = < 0x08 >;
			phandle = < 0x08 >;
		};

		pll_video1 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			assigned-clocks = < 0x04 >;
			assigned-clock-rates = < 0x19bfcc00 >;
			clock-output-names = "pll_video1";
			linux,phandle = < 0x04 >;
			phandle = < 0x04 >;
		};

		pll_video2 {
			#clock-cells = < 0x00 >;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			assigned-clocks = < 0x05 >;
			clock-output-names = "pll_video2";
			linux,phandle = < 0x05 >;
			phandle = < 0x05 >;
		};

 

test.dts.txt

Link to post
Share on other sites

In my opinion, the first few lines look very similar to Orangepi zero 2 u-boot.dts  https://github.com/orangepi-xunlong/orangepi-build/blob/main/external/packages/pack-uboot/sun50iw9/bin/dts/orangepizero2-u-boot.dts

/dts-v1/;

/memreserve/	0x0000000048000000 0x0000000001000000;
/ {
	interrupt-parent = <0x1>;
	#address-cells = <0x2>;
	#size-cells = <0x2>;
	model = "Orange Pi Zero 2";
	compatible = "allwinner,h616", "arm,sun50iw9p1";

	clocks {
		compatible = "allwinner,clk-init";
		device_type = "clocks";
		#address-cells = <0x2>;
		#size-cells = <0x2>;
		ranges;
		reg = <0x0 0x3001000 0x0 0x1000 0x0 0x7010000 0x0 0x400 0x0 0x7000000 0x0 0x4>;

		losc {
			#clock-cells = <0x0>;
			compatible = "allwinner,fixed-clock";
			clock-frequency = <0x8000>;
			clock-output-names = "losc";
			linux,phandle = <0x1e>;
			phandle = <0x1e>;
		};

		iosc {
			#clock-cells = <0x0>;
			compatible = "allwinner,fixed-clock";
			clock-frequency = <0xf42400>;
			clock-output-names = "iosc";
			linux,phandle = <0x20>;
			phandle = <0x20>;
		};

		hosc {
			#clock-cells = <0x0>;
			compatible = "allwinner,fixed-clock";
			clock-frequency = <0x16e3600>;
			clock-output-names = "hosc";
			linux,phandle = <0x9>;
			phandle = <0x9>;
		};

		osc48m {
			#clock-cells = <0x0>;
			compatible = "allwinner,fixed-clock";
			clock-frequency = <0x2dc6c00>;
			clock-output-names = "osc48m";
			linux,phandle = <0xa>;
			phandle = <0xa>;
		};

		hoscdiv32k {
			#clock-cells = <0x0>;
			compatible = "allwinner,fixed-clock";
			clock-frequency = <0x8000>;
			clock-output-names = "hoscdiv32k";
			linux,phandle = <0xdd>;
			phandle = <0xdd>;
		};

		pll_periph0div25m {
			#clock-cells = <0x0>;
			compatible = "allwinner,fixed-clock";
			clock-frequency = <0x17d7840>;
			clock-output-names = "pll_periph0div25m";
			linux,phandle = <0xde>;
			phandle = <0xde>;
		};

		pll_cpu {
			#clock-cells = <0x0>;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_cpu";
			linux,phandle = <0xd3>;
			phandle = <0xd3>;
		};

		pll_ddr0 {
			#clock-cells = <0x0>;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_ddr0";
			linux,phandle = <0xd8>;
			phandle = <0xd8>;
		};

		pll_ddr1 {
			#clock-cells = <0x0>;
			compatible = "allwinner,pll-clock";
			lock-mode = "new";
			clock-output-names = "pll_ddr1";
			linux,phandle = <0xdf>;
			phandle = <0xdf>;
		};

 

Link to post
Share on other sites

This comment is likely superceeded by balbes and jock's posts, but I wanted to just provide my thoughts on the android dtb issues. 

The way I like to think about dtbs is they are glue code between the kernel and the hardware.  We often think of them only from the perspective of the hardware, which once a box is built the hardware doesn't change (although boxes can change over the course of different manufacturing runs providing different board revisions).  But the kernel is an evolving code base and even though the hardware may be fixed, the dtb glue may need to change over time as the kernel code changes.  Thus technically dtbs are kernel version specific (but in practice the changes in the kernel generally are not significant over smaller periods of time).

However....  When it comes to android kernels two factors come into play, one is that android kernels tend to be highly forked/patched from mainline kernels and second, android kernels tend to be based off very old kernels.  So for example an android 4.4 based kernel is really a 5 year old kernel, and a lot has changed in the kernel over a 5 year period.

Also, making this more complex is that fact that sbc/tv box support has only been added to mainline kernels fairly recently.  So older android or legacy kernels that were supported were highly patched kernels.

Armbian is generally focused on current mainline kernels (after all that is where the future support will all take place), and therefore a 5.10/5.12 kernel is very different in how it supports sbc/tv box hardware than a 4.4/4.x legacy/android kernel. 

The end result is to not expect an android dtb to work with a mainline kernel.  That doesn't mean that there isn't a lot to be learned from an older dtb file, but the process is much more complicated than simply getting the old andoird dtb and using it on a mainline kernel and expecting it to work.

Link to post
Share on other sites

50 minutes ago, SteeMan said:

This comment is likely superceeded by balbes and jock's posts, but I wanted to just provide my thoughts on the android dtb issues. 

The way I like to think about dtbs is they are glue code between the kernel and the hardware.  We often think of them only from the perspective of the hardware, which once a box is built the hardware doesn't change (although boxes can change over the course of different manufacturing runs providing different board revisions).  But the kernel is an evolving code base and even though the hardware may be fixed, the dtb glue may need to change over time as the kernel code changes.  Thus technically dtbs are kernel version specific (but in practice the changes in the kernel generally are not significant over smaller periods of time).

However....  When it comes to android kernels two factors come into play, one is that android kernels tend to be highly forked/patched from mainline kernels and second, android kernels tend to be based off very old kernels.  So for example an android 4.4 based kernel is really a 5 year old kernel, and a lot has changed in the kernel over a 5 year period.

Also, making this more complex is that fact that sbc/tv box support has only been added to mainline kernels fairly recently.  So older android or legacy kernels that were supported were highly patched kernels.

Armbian is generally focused on current mainline kernels (after all that is where the future support will all take place), and therefore a 5.10/5.12 kernel is very different in how it supports sbc/tv box hardware than a 4.4/4.x legacy/android kernel. 

The end result is to not expect an android dtb to work with a mainline kernel.  That doesn't mean that there isn't a lot to be learned from an older dtb file, but the process is much more complicated than simply getting the old andoird dtb and using it on a mainline kernel and expecting it to work.

Thanks for information. When I get android dtb, I thought I am much close to a bootable image for my tv box. After I am searching around about how to compile u-boot en linux image. I just realize this is just beginning. The learning curve is quite sharp for people like me with zero knowledge about linux compiling. 

 

I am start reading sources like below. I am not sure how far I can go. There is a great chance I might give up somewhere, because it quite difficult for me. Solving puzzle will definitly bring a lot of joy, too. 

https://docs.armbian.com/Developer-Guide_Build-Preparation/

http://www.orangepi.org/Docs/Building.html

http://sunxi.org/Manual_build_howto

Link to post
Share on other sites

On 6/19/2021 at 11:13 AM, supersmurfs said:

I am not sure how far I can go.

 

Ha!  You already went further than me, and I been hanging around here few years now.  It takes time.

 

On 6/19/2021 at 11:13 AM, supersmurfs said:

Solving puzzle will definitly bring a lot of joy, too. 

 

You are encouraging even me.  And I already learned a couple new things just reading this thread.  Keep up the good work.

Link to post
Share on other sites

 Share

5 5