Jump to content

Recommended Posts

Posted

Hi, I'm trying to repurpose my Vero 4k (not 4k+) by installing Armbian on it. The device is based on the S905X and it looks like the most recent versions include a dtb for 4k, thanks to the work done by chewitt.

I used the AMLogic s9xx TV Box edition and followed these instructions in the forums to copy the dtb and u-boot.

 

However, I'm having some trouble getting the device to boot into an SD card flashed with the Armbian image. I was wondering whether anyone else has some experience with this.

 

Here's what I tried so far:

  1. Downloaded and extracted the image (I used the Minimal/IoT version)
  2. Wrote the image to an SD Card (tried two Class 10 ones, 32GB and 64GB). I also tried both dd and USBImager.
  3. Mounted the boot partition on my PC
  4. Copied u-boot-s905x-s912 to u-boot.ext
  5. Edited the extlinux.conf file to use dtb/amlogic/meson-gxl-s905x-vero4k.dtb
  6. Inserted the SD card into the Vero 4k slot
  7. Used the toothpick method to press the button in the audio jack
  8. While keeping the button pressed, attached the PSU cable
  9. Waited for the boot process (I tried several durations of pressing the button)

 

I've tried these steps with several variations on u-boot and dtb or other Armbian versions, but in all cases OSMC boots up (installed on emmc)

 

I also successfully ran the OSMC installation from the SD Card a few times, so that suggests the SD Card is fine? I asked on the OSMC forums for help, but got no further than this, so it kinda feels like I ran into a dead end.

 

Any ideas or pointers are much appreciated!

Posted

The boot process uses the native android uboot on emmc.  I have no idea what uboot OSMC uses and if it is compatible with the mechanism that armbian uses to chain from the native uboot to the u-boot.ext.

To understand what is happening during the boot you will need to hookup a usb-uart connector to the board and capture the uboot output.

Posted

Thanks for replying! Yes, it seems a bit out of the ordinary (the Vero doesn't come with Android, but with OSMC (Linux) preinstalled). However, I've seen reports of people successfully booting from SD card, so I tried those first, but they didn't seem to have this problem.

 

Would a USB-A to USB-A connector work? Or do I need USB-A to UART? The Vero doesn't have such an external port, so would I need to open it up?

 

It does have a separate USB connector that it can draw power from (without PSU) and connect to a PC.

I failed to mention that I purchased a USB-A to USB-A cable to try this (IIRC this was mentioned somewhere in the OSMC wiki).

Though, when I connect it, it doesn't show up either in lsusb or dmesg. I tried different ports and different PCs. The Vero does boot using this cable, so something is working. Am I missing something maybe?

Posted
35 minutes ago, patientgamer said:

However, I've seen reports of people successfully booting from SD card

Booting armbian from SD on this box?  Or something else.

The way the armbian build works for these amlogic TV boxes is specifically designed to boot from the android uboot on emmc.

Posted
38 minutes ago, patientgamer said:

Or do I need USB-A to UART

You we will need to find the debug uart pins on your board, solder connectors to them and connect the usb-uart connector.  Some boards come with pins already soldered in place but most don't.  It can be difficult to sometimes find the right points as they may not be labeled well.

Posted
46 minutes ago, patientgamer said:

Would a USB-A to USB-A connector work?

No.  USB isn't available as the board is booting.  You need the debug output which early in the boot process is only sent to the debug uart

Posted (edited)
5 hours ago, SteeMan said:

Booting armbian from SD on this box?  Or something else.

It was Armbian on a Vero 4k+ (so not exactly the same as my 4k non plus, but similar).

 

I'll open up the box as soon as I have the time and try to find the UART pins. Do you have any recommendations for a good USB-UART connector?

 

Edited by patientgamer
typo
Posted

Actually I just tried, but I can't seem to find any screws on the thing. I naively expected them to be under the bottom pads, or some sticker, but none. I carefully tried to separate the bottom side from the top box, to see if it unclicked or sth, but no dice yet.

Posted

Well, turns it did unclick after some more attempts. Nothing broke as far as I can see. Here's a picture of the insides: On the top right there's the toothpick button behind the audio jack.

image.png.9458a2360772827ae5b122bdca1b818a.png

Posted

I'm a complete noob on this, but I just looked up a tutorial online. Could this be the UART points? If so, that would be a very precise solder job: those dots are about 1mm in diameter.

image.thumb.png.dd805d019b5d5e180115bb992d516d6d.png

Posted

yes those pins should be the debug uart.  I don't have a recommendation on one, but two things to think about, 1) boards will generally either be 3.3v or 5v (so both types exist, although many allow you to switch the voltage with a jumper), if you don't know your voltage start with 3.3v.  Then some boards (Rockchip CPUs have a high baud rate that some adapters don't support), which wouldn't be an issue for this amlogic box, but if you might use it in the future for a rockchip based board you might want to make sure yours is capable of those higher speeds.

Posted

Thanks for following up and for your advice! I guess I have my work cut out for me. I'll try to find a way to solder those points to a UART connector and report back after.

Posted

It's been a while, but I have some results. It was quite the journey, because I started learning to solder, but this job was way too advanced for me. Then a friend of mine very generously offered to do it and now I have successfully made contact via UART! The power is not provided via the 3V3 cable (after taking this picture I disconnected the yellow jumper and it still works), but I can imagine it's powered via the Vero device itself?

 

The next step would be to find out what exactly what happens. I have no idea yet what the character string is, but I was pleasantly surprised I could just login to the Vero afterwards.

 

image.png.968f557322cfa6c74896a91187fd66e2.pngimage.thumb.png.52fa5d043e518c03c51928850e9ca314.png

Posted

Apparently I had the baud rate wrong, it should be 115200, which explains the gibberish.

 

Now it prints readable logs:

 

GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 136060

BL2 Built : 12:23:15, May 17 2019. gxl g3e531ea - luan.yuan@droid15-sz

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 2
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 912MHz
bist_test rank: 0 1f 03 3b 32 1a 4b 1c 00 39 34 1a 4e 1b 00 36 2f 17 48 1c 03 35 2f 17 48 623  rank: 1 1d 06 35 30 19 48 18 01 2f 34 1b 4e 19 03 2f 32 19 4b 1c 04 35 30 15 4b 623   - PASS

Rank0: 1024MB(auto)-2T-13

Rank1: 1024MB(auto)-2T-13
AddrBus test pass!
eMMC boot @ 0
sw8 s
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
emmc switch 0 ok
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000, part: 0
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x013c0000, size: 0x0000d600, part: 0
Load bl31 from eMMC, src: 0x00020200, des: 0x05100000, size: 0x0002b400, part: 0
Load bl32 from eMMC, src: 0x0004c200, des: 0x05300000, size: 0x0003f200, part: 0
Load bl33 from eMMC, src: 0x0008c200, des: 0x01000000, size: 0x0007d600, part: 0
NOTICE:  BL3-1: v1.0(release):53f813e
NOTICE:  BL3-1: Built : 15:51:23, May 22 2019
[BL31]: GXL CPU setup!
NOTICE:  BL3-1: GXL normal boot!
NOTICE:  BL3-1: BL33 decompress pass
mpu_config_enable:system pre init ok
dmc sec lock
[Image: gxl_v1.1.3389-92241b5 2019-07-02 17:22:35 luan.yuan@droid15-sz]
OPS=0x82
21 0b 82 00 1a 00 1b 93 91 16 e7 f0 06 d5 1b 2b
[0.678918 Inits done]
secure task start!
high task start!
low task start!
INFO:    BL3-2: ATOS-V2.4.2-27-g5888df8 #1 Fri Dec 13 14:14:13 2019 +0800 arm
INFO:    BL3-2: Chip: GXL Rev: B (21:B - 80:2)
INFO:    BL3-2: crypto engine DMA
INFO:    BL3-2: secure time TEE
INFO:    BL3-2: CONFIG_DEVICE_SECURE 0xb200000e


U-Boot 2015.01-gce79d13 (Mar 29 2024 - 16:55:50)

DRAM:  2 GiB
Relocation Offset is: 76e82000
register usb cfg[0][1] = 0000000077f4fb28
[CANVAS]canvas init
boot_device_flag : 1
Nand PHY Ver:1.01.001.0006 (c) 2013 Amlogic Inc.
init bus_cycle=6, bus_timing=7, system=5.0ns
reset failed
get_chip_type and ret:fffffffe
get_chip_type and ret:fffffffe
chip detect failed and ret:fffffffe
nandphy_init failed and ret=0xfffffff1
MMC:   aml_priv->desc_buf = 0x0000000073e826b0
aml_priv->desc_buf = 0x0000000073e849f0
SDIO Port B: 0, SDIO Port C: 1
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 40000000
[mmc_startup] mmc refix success
init_part() 297: PART_TYPE_AML
[mmc_init] mmc init success
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 2g
        dtb 1 soc: gxl   plat: p231   vari: 2g
      Find match dtb: 0
start dts,buffer=0000000073e87240,dt_addr=0000000073e87a40
get_partition_from_dts() 91: ret 0
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 2g
        dtb 1 soc: gxl   plat: p231   vari: 2g
      Find match dtb: 0
parts: 11
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: instaboot	0000000020000000 1
07:      boot	0000000002000000 1
set has_boot_slot = 0
08:    system	0000000040000000 1
09:     cache	0000000020000000 2
10:      data	ffffffffffffffff 4
init_part() 297: PART_TYPE_AML
eMMC/TSD partition table have been checked OK!
crc32_s:0x1577dad == storage crc_pattern:0x1577dad!!!
crc32_s:0xee152b83 == storage crc_pattern:0xee152b83!!!
crc32_s:0x79f50f07 == storage crc_pattern:0x79f50f07!!!
mmc env offset: 0x27400000
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
NAZARKO: repairing fb addrNAZARKO: repairing osd layerSaving Environment to aml-storage...
mmc env offset: 0x27400000
Writing to MMC(1)... done
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-3477: calc 38ccf836, store 38ccf836
_verify_dtb_checksum()-3477: calc 38ccf836, store 38ccf836
dtb_read()-3694: total valid 2
update_old_dtb()-3675: do nothing
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxl platform: p212 variant: 2g
        dtb 0 soc: gxl   plat: p212   vari: 2g
        dtb 1 soc: gxl   plat: p231   vari: 2g
      Find match dtb: 0
vpu: clk_level in dts: 7
vpu: vpu_power_on
vpu: set clk: 666667000Hz, readback: 666666667Hz(0x300)
vpu: vpu_module_init_config
vpp: vpp_init
cvbs: cpuid:0x21
hpd_state=0
vpp: vpp_matrix_update: 2
cvbs performance type = 6, table = 0
cvbs_config_hdmipll_gxl
cvbs_set_vid2_clk
Net:   dwmac.c9410000amlkey_init() enter!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0

CONFIG_AVB2: null
Start read misc partition datas!
info->magic =
info->version_major = 1
info->version_minor = 0
info->slots[0].priority = 15
info->slots[0].tries_remaining = 7
info->slots[0].successful_boot = 0
info->slots[1].priority = 14
info->slots[1].tries_remaining = 7
info->slots[1].successful_boot = 0
info->crc32 = -1075449479
active slot = 0
wipe_data=successful
wipe_cache=successful
upgrade_step=2
reboot_mode:::: cold_boot
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
[OSD]load fb addr from dts:/meson-fb
[OSD]fb_addr for logo: 0x7f800000
[OSD]load fb addr from dts:/meson-fb
[OSD]fb_addr for logo: 0x7f800000
[OSD]VPP_OFIFO_SIZE:0xfff00fff
[CANVAS]addr=0x7f800000 width=3840, height=2160
[Dbg imgread]L535:to read pic (bootup)
[Dbg imgread]L542:end read pic sz 8192
[Dbg imgread]L578:bootupOutmode <NULL>,<NULL>, bootup_720, bootup
[Dbg imgread]L594:found itemName bootup
[Dbg imgread]L621:pic sz 0x3f4b8
[Dbg imgread]L646:end read pic[bootup]
[OSD]osd_hw.free_dst_data: 0,719,0,575
[OSD]osd1_update_disp_freescale_enable
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
gpio: pin GPIOAO_2 (gpio 102) value is 1
Command: bcb uboot-command
Start read misc partition datas!
BCB hasn't any datas,exit!
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
card out
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
emmc/sd response timeout, cmd1, status=0x1ff2800
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
[Dbg imgread]L360:kernel_size 0x91aa1f, page_size 0x800, totalSz 0x91b800
[Dbg imgread]L361:ramdisk_size 0x2897b5, totalSz 0x289800
[Dbg imgread]L362:dtbSz 0x1c800, Total actualBootImgSz 0xbc1800
[Dbg imgread]L369:Left sz 0xac1800
[Dbg imgread]L376:totalSz=0xbc1800
avb2: 0
ee_gate_off ...
avb2: 0
## Booting Android Image at 0x01080000 ...
reloc_addr =73f074b0
copy done
No androidboot.dtbo_idx configuredStart read misc partition datas!
info->magic =
info->version_major = 1
info->version_minor = 0
info->slots[0].priority = 15
info->slots[0].tries_remaining = 7
info->slots[0].successful_boot = 0
info->slots[1].priority = 14
info->slots[1].tries_remaining = 7
info->slots[1].successful_boot = 0
info->crc32 = -1075449479
active slot = 0
active_slot is normal
get partition info failed !!
amlmmc - AMLMMC sub system

Usage:
amlmmc read  <partition_name> ram_addr addr_byte# cnt_byte
amlmmc write <partition_name> ram_addr addr_byte# cnt_byte
amlmmc erase <partition_name> addr_byte# cnt_byte
amlmmc erase <partition_name>/<device num>
amlmmc rescan <device_num>
amlmmc part <device_num> - show partition infomation of mmc
amlmmc list - lists available devices
amlmmc env -  display env partition offset
amlmmc switch <device_num> <part name> - part name : boot0, boot1, user
amlmmc status <device_num> - read sd/emmc device status
amlmmc ext_csd <device_num> <byte> - read sd/emmc device EXT_CSD [byte]
amlmmc ext_csd <device_num> <byte> <value> - write sd/emmc device EXT_CSD [byte] value
amlmmc response <device_num> - read sd/emmc last command response
amlmmc controller <device_num> - read sd/emmc controller register
amlmmc write_protect <partition_name> <write_protect_type>
        - set write protect on partition through power_on or temporary
amlmmc write_protect <addr_base16> <cnt_base10> <write_protect_type>
        - set write protect on specified address through power_on or temporary
amlmmc send_wp_status <partition_name> send protect status of partition
amlmmc send_wp_status <addr_base16> <cnt_base10> send protect status on specified address
amlmmc send_wp_type <partition_name> send protect type of partition
amlmmc send_wp_type <addr_base16> <cnt_base10> send protect type on specified address
amlmmc clear_wp <partition_name> clear write protect of partition
amlmmc clear_wp <addr_base16> <cnt_base10> clear write protect on specified addresst
amlmmc ds <dev_num> <val> set driver strength
amlmmc key - disprotect key partition

amlmmc cmd <NULL> failed
store - STORE sub-system

Usage:
store init flag
store read name addr off|partition size
    read 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store write name addr off|partition size
    write 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
store rom_write add off size.
	write uboot to the boot device
store erase boot/data:
	erase the area which is uboot or data
store erase partition <partition_name>:
	erase the area which partition in u-boot
store erase dtb
store erase key
store disprotect key
store rom_protect on/off
store scrub off|partition size
	scrub the area from offset and size
store dtb iread/read/write addr <size>
	read/write dtb, size is optional
store key read/write addr <size>
	read/write key, size is optional
store ddr_parameter read/write addr <size>
	read/write ddr parameter, size is optional
store mbr addr
   update mbr/partition table by dtb

No dtbo patitions found
load dtb from 0x1000000 ......
      Amlogic multi-dtb tool
      Single dtb detected
No valid dtbo image found
   Uncompressing Kernel Image ... OK
   kernel loaded at 0x01080000, end = 0x02a19a00
libfdt fdt_getprop(): FDT_ERR_NOTFOUND
   Loading Ramdisk to 73be6000, end 73e6f7b5 ... OK
   Loading Device Tree to 000000001ffef000, end 000000001ffff976 ... OK
signature:
fdt_instaboot: no instaboot image

Starting kernel ...

uboot time: 4083861 us
[    0.000000@0]d Booting Linux on physical CPU 0x0
[    0.000000@0]d Linux version 4.9.269-62-osmc (root@jenkins) (gcc version 10.2.1 20210110 (Debian 10.2.1-6) ) #1 SMP PREEMPT Thu Oct 17 19:52:38 UTC 2024
[    0.000000@0]d Based on OSMC upstream commit: b3101f80964a91322a822a1831932c1e3cc9deb8
[    0.000000@0]d Boot CPU: AArch64 Processor [410fd034]
[    0.000000@0]d earlycon: aml_uart0 at MMIO 0x00000000c81004c0 (options '')
[    0.000000@0]d bootconsole [aml_uart0] enabled
[    0.000000@0]d 	07400000 - 07500000,     1024 KB, ramoops@0x07400000
[    0.000000@0]d 	05000000 - 07400000,    36864 KB, linux,secmon
[    0.000000@0]d 	7f800000 - 80000000,     8192 KB, linux,meson-fb
[    0.000000@0]d 	7d800000 - 7f800000,    32768 KB, linux,di_cma
[    0.000000@0]d 	75c00000 - 7d800000,   126976 KB, linux,ion-dev
[    0.000000@0]d 	74c00000 - 75c00000,    16384 KB, linux,vdin1_cma
[    0.000000@0]d 	74c00000 - 74c00000,        0 KB, linux,ppmgr
[    0.000000@0]d 	5b800000 - 73800000,   393216 KB, linux,codec_mm_cma
[    0.000000@0]d 	74c00000 - 74c00000,        0 KB, linux,codec_mm_reserved
domain-0 init dvfs: 4
efuse_pw_en: 0x3
WARNING! efuse bits is disabled
Enable A53 JTAG to AO
[    0.000000@0]d 	07400000 - 07500000,     1024 KB, ramoops@0x07400000
[    0.000000@0]d 	05000000 - 07400000,    36864 KB, linux,secmon
[    0.000000@0]d 	7f800000 - 80000000,     8192 KB, linux,meson-fb
[    0.000000@0]d 	7d800000 - 7f800000,    32768 KB, linux,di_cma
[    0.000000@0]d 	75c00000 - 7d800000,   126976 KB, linux,ion-dev
[    0.000000@0]d 	74c00000 - 75c00000,    16384 KB, linux,vdin1_cma
[    0.000000@0]d 	74c00000 - 74c00000,        0 KB, linux,ppmgr
[    0.000000@0]d 	5b800000 - 73800000,   393216 KB, linux,codec_mm_cma
[    0.000000@0]d 	74c00000 - 74c00000,        0 KB, linux,codec_mm_reserved
[    0.488554@0]- codec_mm_module_init
[    0.497475@1]- clkmsr c110875c.meson_clk_msr: failed to get msr ring reg0
[    0.505097@1]- cvbs_out: chrdev devno 264241152 for disp
[    0.777614@1]- dmi: Firmware registration failed.
[    0.783572@1]- vout: error: dummy_venc_clktree_probe: get enci_top_gate error
[    1.257703@3]- mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.292423@3]- cpy 1 is not valid
[    1.296354@3]- cpy 0 is not valid
[    1.305908@3]- c81004c0.serial: clock gate not found
[    1.400652@3]- c11084c0.serial: clock gate not found
[    1.406457@3]- amlogic-new-usb3 d0078080.usb3phy: This phy has no usb port
[    1.421031@3]- ge2d: register address resource is not found
[    1.423804@3]- amvideocap_probe,amvideocap
[    1.425026@3]- use cma buf.
[    1.453406@0]h dil:err:DI_POST_REG_RD:not attach
[    1.473467@0]h dil:err:DI_POST_REG_RD:not attach
[    1.493395@0]h dil:err:DI_POST_REG_RD:not attach
[    1.513467@0]h dil:err:DI_POST_REG_RD:not attach
[    1.517048@3]- vdin0 get fclk_div5 fail
[    1.517149@3]- vdin_drv_probe: vdin0 cannot get msr clk
[    1.522156@3]- vdin1 get fclk_div5 fail
[    1.525331@3]- vdin_drv_probe: vdin1 cannot get msr clk
[    1.534730@3]- Reserved memory: failed to init DMA memory pool at 0x0000000074c00000, size 0 MiB
[    1.543208@3]- video_composer_module_init_1
[    1.543541@3]- video_composer_probe_3.1:ports[i].name=video_composer.0, i=0
[    1.550411@3]- video_composer_probe num=1
[    1.555351@3]- vlock clk not cfg
[    1.582890@3]- cectx c810023c.aocec: not find 'port_num'
[    1.583047@3]- cectx c810023c.aocec: no clock regs
[    1.587438@3]- cectx c810023c.aocec: not find 'arc_port_mask'
[    1.593160@3]- cectx c810023c.aocec: not find 'output'
[    1.601417@0]- cectx c810023c.aocec: wakeup_reason:0x0
[    1.603351@0]- cectx c810023c.aocec: wakeup_data: 0x0 0x0
[    1.612446@0]- request_irq error ret=-22
[    1.612586@0]- dev_pm_set_wake_irq failed: -22
[    1.619777@0]- page_trace_module_init, create sysfs failed
[    1.629319@0]- spdif-dit spdif_codec: audio_spdif_out_mute can't get pinctrl
[    1.630907@0]- spdif-dit spdif_codec: audio_spdif_in_mute can't get pinctrl
[    1.637905@0]- spdif-dit spdif_codec: audio_spdif_in can't get pinctrl
[    1.860977@0]- aml_meson_snd_card aml_sound_meson: ASoC: no source widget found for LOUTL
[    1.863652@0]- aml_meson_snd_card aml_sound_meson: ASoC: Failed to add route LOUTL -> direct -> Ext Spk
[    1.873002@0]- aml_meson_snd_card aml_sound_meson: ASoC: no source widget found for LOUTR
[    1.881221@0]- aml_meson_snd_card aml_sound_meson: ASoC: Failed to add route LOUTR -> direct -> Ext Spk
[    1.892112@0]- meson-gxl-pinctrl pinctrl@4b0: pin GPIOH_6 already requested by jtag; cannot claim for aml_sound_meson
[    1.901120@0]- meson-gxl-pinctrl pinctrl@4b0: pin-22 (aml_sound_meson) status -22
[    1.908339@0]- meson-gxl-pinctrl pinctrl@4b0: could not request pin 22 (GPIOH_6) from group i2s_am_clk  on device pinctrl-meson
[    1.919854@0]- aml_meson_snd_card aml_sound_meson: Error applying setting, reverse things back
[    1.944521@3]- hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    1.946477@3]- usb usb2: Unsupported the hub
[    2.072708@3]- pm-meson aml_pm: Can't get switch_clk81
[    2.151340@3]- hdmitx: s-val 2199 h_total 2200[    2.361831@0]- vfm_map_store:rm default
[    2.361831@0]-
[    2.362033@0]- vfm_map_store:add default decoder ppmgr deinterlace amlvideo amvideo
[    2.362033@0]-
ERROR SECURITY_KEY_READ 1
the package has 110 fws totally.
The TA version (v0.2) is lower than the pkg version (v0.3).
The TA version is too low that may affect the work please update asap.
The TA ver is v0.2
The fw ver is v0.3
the fw with 512 KB will be loaded.

OSMC: Open Source Media Center osmc ttyS0

osmc login:

 

Posted (edited)

I reflashed Armbian on an SD card and booted while connected to UART. Then I inspected the difference between the boot logs. Below is the diff (right is with SD card). It looks like the SD card is recognized and an attempt at booting is made, but it's unable to read a kernel.img file. Any help is much appreciated :)

 

<snip>

        Hit Enter or space or Ctrl+C key to stop autoboot -- :  0         │        Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
        card out                                                          │        card in
        co-phase 0x2, tx-dly 0, clock 400000                              │        co-phase 0x2, tx-dly 0, clock 400000
        co-phase 0x2, tx-dly 0, clock 400000                              │        co-phase 0x2, tx-dly 0, clock 400000
        co-phase 0x2, tx-dly 0, clock 400000                              │        co-phase 0x2, tx-dly 0, clock 400000
        emmc/sd response timeout, cmd8, status=0x1ff2800                  │        co-phase 0x2, tx-dly 0, clock 400000
        emmc/sd response timeout, cmd55, status=0x1ff2800                 │        co-phase 0x2, tx-dly 0, clock 40000000
        emmc/sd response timeout, cmd1, status=0x1ff2800                  │        [mmc_startup] mmc refix success
        ------------------------------------------------------------------│        init_part() 282: PART_TYPE_DOS
        ------------------------------------------------------------------│        [mmc_init] mmc init success
        ------------------------------------------------------------------│        Device: SDIO Port B
        ------------------------------------------------------------------│        Manufacturer ID: 27
        ------------------------------------------------------------------│        OEM: 5048
        ------------------------------------------------------------------│        Name: SD64G
        ------------------------------------------------------------------│        Tran Speed: 50000000
        ------------------------------------------------------------------│        Rd Block Len: 512
        ------------------------------------------------------------------│        SD version 3.0
        ------------------------------------------------------------------│        High Capacity: Yes
        ------------------------------------------------------------------│        Capacity: 58.2 GiB
        ------------------------------------------------------------------│        mmc clock: 40000000
        ------------------------------------------------------------------│        Bus Width: 4-bit
        ------------------------------------------------------------------│        reading kernel.img
        ------------------------------------------------------------------│        ** Unable to read file kernel.img **
        
<snip>

                                                                          │       
        Starting kernel ...                                               │        Starting kernel ...
                                                                          │       

<snip>

        - page_trace_module_init, create sysfs failed                     │        - page_trace_module_init, create sysfs failed
        ------------------------------------------------------------------│        - meson-mmc: card IN
        - spdif-dit spdif_codec: audio_spdif_out_mute can't get pinctrl   │        - spdif-dit spdif_codec: audio_spdif_out_mute can't get pinctrl

<snip until kernel boot is finished>

 

Edited by patientgamer
Remove relative line nrs from snippet
Posted

I went the naive approach and just copied `Image` as `kernel.img` in the boot partition. The "Unable to read file kernel.img" went away and it said "** Unable to read file dtb.img **". So then I copied meson-gxl-s905x-vero4k.dtb to dtb.img. Now it logs the following:

 

reading kernel.img
29127168 bytes read in 1578 ms (17.6 MiB/s)
reading dtb.img
40983 bytes read in 5 ms (7.8 MiB/s)
loaded DTB from SD
avb2: 0
ee_gate_off ...
avb2: 0
Wrong Image Format for bootm command
ERROR: can't get kernel image!
[rsvmem] get fdtaddr NULL!
rsvmem - reserve memory

 

I'm guessing the file format is not what it expects.

Posted

I see some references to bootm, kernel.img and dtb.img in fw_printenv, so tweaking with that may pave the way to booting Armbian properly. However I'm afraid to brick the device in the process. I vaguely remember that it's possible to backup the bootloader, but don't have any experience. Any pointers?

 

 

Here's the full fw_printenv:

EnableSelinux=enforcing
Irq_check_en=0
active_slot=normal
baudrate=115200
bcb_cmd=get_avb_mode;get_valid_slot;
boot_part=boot
bootcmd=run osmcfromsd; run osmcfromusb; run storeboot
bootdelay=1
cmdline_keys=if keyman init 0x1234; then if keyman read mac ${loadaddr} str; then setenv bootargs ${bootargs} mac=${mac};fi;fi;
colorattribute=444,8bit
cvbs_drv=0
cvbsmode=576cvbs
display_bpp=16
display_color_bg=0
display_color_fg=0xffff
display_color_index=16
display_height=1080
display_layer=osd0
display_width=1920
dtb_mem_addr=0x1000000
factory_reset_poweroff_protect=echo wipe_data=${wipe_data}; echo wipe_cache=${wipe_cache};if test ${wipe_data} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi; if test ${wipe_cache} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi;
fb_addr=0x7f800000
fb_height=1080
fb_width=1920
fdt_high=0x20000000
firstboot=0
fs_type=rootfstype=ramfs
gatewayip=10.18.9.1
hdmimode=1080p60hz
hostname=arm_gxbb
init_display=get_rebootmode;echo reboot_mode:::: ${reboot_mode};if test ${reboot_mode} = quiescent; then setenv reboot_mode_android quiescent;run storeargs;setenv bootargs ${bootargs} androidboot.quiescent=1;osd open;osd clear;else if test ${reboot_mode} = recovery_quiescent; then setenv reboot_mode_android quiescent;run storeargs;setenv bootargs ${bootargs} androidboot.quiescent=1;osd open;osd clear;else setenv reboot_mode_android normal;run storeargs;osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale; fi;fi;
initargs=init=/init console=ttyS0,115200 no_console_suspend earlycon=aml_uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000
jtag=apao
loadaddr=1080000
lock=10001000
netmask=255.255.255.0
osmcfromsd=if mmcinfo; then if fatload mmc 0 ${loadaddr} kernel.img; then run sddtb; setenv bootargs ${bootargs} osmc.bootsource=sd; bootm; fi; fi
osmcfromusb=if usb start 0; then if fatload usb 0 ${loadaddr} kernel.img; then run usbdtb; setenv bootargs ${bootargs} osmc.bootsource=usb; bootm; fi; fi
otg_device=1
outputmode=1080p60hz
page_trace=on
preboot=run bcb_cmd; run factory_reset_poweroff_protect;run upgrade_check;run init_display;run storeargs;run upgrade_key;bcb uboot-command;run switch_bootmode;
reboot_mode=cold_boot
reboot_mode_android=normal
recovery_from_flash=get_valid_slot;echo active_slot: ${active_slot};if test ${active_slot} = normal; then setenv bootargs ${bootargs} ${fs_type} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if itest ${upgrade_step} == 3; then if ext4load mmc 1:2 ${dtb_mem_addr} /recovery/dtb.img; then echo cache dtb.img loaded; fi;if ext4load mmc 1:2 ${loadaddr} /recovery/recovery.img; then echo cache recovery.img loaded; bootm ${loadaddr}; fi;else fi;if imgread kernel ${recovery_part} ${loadaddr} ${recovery_offset}; then bootm ${loadaddr}; fi;else setenv bootargs ${bootargs} ${fs_type} aml_dt=${aml_dt} recovery_part=${boot_part} recovery_offset=${recovery_offset};if imgread kernel ${boot_part} ${loadaddr}; then bootm ${loadaddr}; fi;fi;
recovery_from_sdcard=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload mmc 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload mmc 0 ${loadaddr} recovery.img; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; fi;setenv bootargs ${bootargs} ${fs_type};bootm ${loadaddr};fi;
recovery_from_udisk=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload usb 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload usb 0 ${loadaddr} recovery.img; then if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo udisk dtb.img loaded; fi;setenv bootargs ${bootargs} ${fs_type};bootm ${loadaddr};fi;
recovery_offset=0
recovery_part=recovery
rpmb_state=0
sdc_burning=sdc_burn ${sdcburncfg}
sdcburncfg=aml_sdc_burn.ini
sddtb=if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo loaded DTB from SD; else store dtb read $dtb_mem_addr; fi
sdr2hdr=0
stderr=serial
stdin=serial
stdout=serial
storeargs=setenv bootargs ${initargs} otg_device=${otg_device} reboot_mode_android=${reboot_mode_android} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} maxcpus=${maxcpus} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${cecconfig},${colorattribute} cvbsdrv=${cvbs_drv} irq_check_en=${Irq_check_en}  androidboot.firstboot=${firstboot} jtag=${jtag}; setenv bootargs ${bootargs} androidboot.veritymode=enforcing androidboot.hardware=amlogic;setenv bootargs ${bootargs} page_trace=${page_trace};setenv bootargs ${bootargs} androidboot.rpmb_state=${rpmb_state};run cmdline_keys;
storeboot=if imgread kernel ${boot_part} ${loadaddr}; then bootm ${loadaddr}; fi;run storeargs; run update;
switch_bootmode=get_rebootmode;if test ${reboot_mode} = factory_reset; then setenv reboot_mode_android normal;run storeargs;run recovery_from_flash;else if test ${reboot_mode} = update; then setenv reboot_mode_android normal;run storeargs;run update;else if test ${reboot_mode} = quiescent; then setenv reboot_mode_android quiescent;run storeargs;setenv bootargs ${bootargs} androidboot.quiescent=1;else if test ${reboot_mode} = recovery_quiescent; then setenv reboot_mode_android quiescent;run storeargs;setenv bootargs ${bootargs} androidboot.quiescent=1;run recovery_from_flash;else if test ${reboot_mode} = cold_boot; then setenv reboot_mode_android normal;run storeargs;else if test ${reboot_mode} = fastboot; then setenv reboot_mode_android normal;run storeargs;fastboot;fi;fi;fi;fi;fi;fi;
try_auto_burn=update 700 750;
update=run usb_burning; run sdc_burning; if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;
upgrade_check=echo upgrade_step=${upgrade_step}; if itest ${upgrade_step} == 3; then run init_display; run storeargs; run update;else fi;
upgrade_key=if gpio input GPIOAO_2; then echo detect upgrade key; sleep 3;if gpio input GPIOAO_2; then run update; fi;fi;
upgrade_step=2
usb_burning=update 1000
usbdtb=if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo loaded DTB from usb; else store dtb read $dtb_mem_addr; fi
v4kflash=verify
wipe_cache=successful
wipe_data=successful

 

Posted

All of this information is very helpful.  Here is what you need to try.

Look at the file aml_autoscript in your armbian /boot folder.  This is the script that should get run when the reset button is pressed during poweron on a regular amlogic based android tv box.

But since you now have access to the uboot console, you can enter these environment commands directly.

If you start with the 'setenv bootcmd...

and end with the 'saveenv'

you will have modified the uboot environment to run armbian from sd or usb first, and then fall back to your other os on emmc.

In looking at your current uboot environment, the only command that will be modified from what you have is the 'bootcmd'.  In looking at what you have both the armbian and your current bootcmd fall back to run 'storeboot'.  But by installing the armbian version you will loose the abiltiy to boot osmc from sd or usb, which you probably don't care about, but I thought I would mention it.

Posted

Thanks for your reply!

 

Just to be sure that I don't mess it up, these are the lines in aml_autoscript:

 

1. VS�cA|�#AlJ�if printenv bootfromsd; then exit; else setenv ab 0; fi;
2. setenv bootcmd 'run start_autoscript; run storeboot'
3. setenv start_autoscript 'if mmcinfo; then run start_mmc_autoscript; fi; if usb start; then run start_usb_autoscript; fi; run start_emmc_autoscript'
4. setenv start_emmc_autoscript 'if fatload mmc 1 1020000 emmc_autoscript; then autoscr 1020000; fi;'
5. setenv start_mmc_autoscript 'if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;'
6. setenv start_usb_autoscript 'for usbdev in 0 1 2 3; do if fatload usb ${usbdev} 1020000 s905_autoscript; then autoscr 1020000; fi; done'
7. setenv upgrade_step 2
8. saveenv
9. sleep 1
10. reboot
11. 
12. # Recompile with:
13. # mkimage -C none -A arm -T script -d aml_autoscript.cmd aml_autoscript

 

Do I need to enter line 2 through 8 in the uboot environment?

Posted (edited)
2 hours ago, SteeMan said:

But by installing the armbian version you will loose the abiltiy to boot osmc from sd or usb, which you probably don't care about, but I thought I would mention it.

That's right, I'm fine with only being able to boot armbian, although having the ability to boot other distros as well would be nice. But for now I'm happy if I succeed in booting armbian.

Edited by patientgamer
Posted

Just a thought, but since the current bootcmd is

bootcmd=run osmcfromsd; run osmcfromusb; run storeboot

Could I change it to this:

bootcmd=run start_autoscript; run osmcfromsd; run osmcfromusb; run storeboot

And keep the abillity to boot to osmc and osmc recovery? I assume here that when a "run" command succeeds it does not continue to the next.

 

Given that I set start_autoscript to the one in aml_autoscript.

Posted
33 minutes ago, patientgamer said:

And keep the abillity to boot to osmc and osmc recovery? I assume here that when a "run" command succeeds it does not continue to the next.

Yes I had thought of that, that should work.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines