我的玩客云设备,在做绝育测试的时候,刷机过多把emcc刷坏了。在网上买了个芯片,在取旧芯片的时候把触点焊掉了。




本想着,这下这玩客云彻底罢工了。带着折腾的精神,很多设备不是可以使用SD卡启动吗,就尝试把玩客云绝育后备份出来的磁盘镜像写入SD卡。

启动玩客云后在ttl里能跑码但会报错,如下:

    QA5:B;SVN:B72;POC:1FF;STS:0;BOOT:0;INIT:10;BOOT:1;INIT:0;READ:41;USB:3;SERIAL:4;STS:0;BOOT:0;INIT:10;BOOT:1;INIT:0;READ:41;USB:3;SERIAL:4;STS:0;BOOT:0;INIT:10;BOOT:1;INIT:0;READ:41;USB:3;SERIAL:4;STS:0;BOOT:0;INIT:10;BOOT:1;INIT:0;READ:0;CHECK:0;PASS:1;
    no sdio debug board detected!U?n??j
                                       BT : 16:10:19 Sep 25 2017
    PMU:NONE
    ##### VDDEE voltage = 0x046a1130
    
    CPU clock is 792MHz
    
    DDR mode: 32 bit mode
    DDR size: 1GB (auto)
    DDR check: Pass!
    DDR clock: 636MHz with 2T mode
    DDR pll bypass: Disabled
    DDR init use : 16889 us
    
    HHH
    SD_boot_type: 00000001
    card_type: 00000001
    0x0000009f
    check SD_boot_type:0x1     card_type:0x1
    ucl decompress...pass
    0x12345678
    Boot from external device 
    TE : 31725598
    
    System Started
    
    
    U-boot(m8b_m201_v1@) (Sep 25 2017 - 16:10:17)
    
    clr h-ram
    DRAM:  1 GiB
    relocation Offset is: 2feb0000
    show partition table: 
    part: 0, name :       logo, size : 2000000
    part: 1, name :   recovery, size : 2000000
    part: 2, name :       misc, size : 2000000
    part: 3, name :  instaboot, size : 20000000
    part: 4, name :     kernel, size : 2000000
    part: 5, name :       boot, size : 2000000
    part: 6, name :     system, size : 40000000
    part: 7, name :     backup, size : 40000000
    part: 8, name :      cache, size : 20000000
    part: 9, name :       app0, size : 10000000
    part: 10, name :       app1, size : 10000000
    part: 11, name :       data, size : end 
    aml_card_type=0x200
    MMC:   [mmc_register] add mmc dev_num=0, port=1, if_type=6
    [mmc_register] add mmc dev_num=1, port=2, if_type=6
    SDIO Port B: 0, SDIO Port C: 1
    power init
    out reg=c110804c,value=dfffffff
    IR init done!
    register usb cfg[0][1] = 3ff645d8
    register usb cfg[2][0] = 3ff67888
    enter emmc boot
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    EMMC boot, but emmc init failed
    SF: Unsupported manufacturer ff
    *** Warning - bad CRC, using default environment
    
    EMMC boot, spi init failed
    NAND BOOT: boot_device_flag 1
    Nand PHY driver Version: 2.01.001.0004 (c) 2013 Amlogic Inc.
    amlnf_phy_init : amlnf init flag 5
    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
    EMMC boot, nand init failed
    device_boot_flag=3
    CARD BOOT: not init nand
    do not init nand : cause boot_device_flag without nand 
    BOOT FROM CARD? env_relocate_spec
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init deviceset_storage_device_flag: store 0
    set_storage_device_flag: set  store to 3
    BOOT FROM CARD?
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init devices, saveenv fail
    Err imgread(L129):Fmt unsupported!genFmt 0x0 != 0x3
    check dts: FDT_ERR_BADMAGIC, load default vpu parameters
    vpu clk_level = 3
    set vpu clk: 182150000Hz, readback: 182150000Hz(0x701)
    Net:   Meson_Ethernet
    msg:====>upgrade_step=2<=====
    msg:reboot_mode=0x0
    init suspend firmware done. (ret:0)
    cvbs trimming.1.v5: 0xa0, 0x0
    reboot_mode=charging
    hdmi tx power init
    TV mode 1080p selected.
    mode = 8  vic = 16
    set HDMI vic: 16
    mode is: 8
    viu chan = 1
    config HPLL
    config HPLL done
    reconfig packet setting done
    Err imgread(L526):head magic error
    There is no valid bmp file at the given address
    bmp scale:  mode=1080p , x=0, y=0, w=1920, h=1080
    info data len is 1
    efuse version has been written [20] 
    out reg=c8100024,value=bffb3fff
    out reg=c8100024,value=bff33ffb
    out reg=c8100024,value=bfe33ff3
    out reg=c8100024,value=bfeb3fe3
    Hit Enter key to stop autoboot -- :  0 
    exit abortboot: 0
    Enter USB burn
    Try connect time out 701, 700, 35010
    Booting...
    There is no valid bmp file at the given address
    bmp scale:  mode=1080p , x=0, y=0, w=1920, h=1080
    Saving Environment to None...
    BOOT FROM CARD?
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init devices, saveenv fail
     error: image data is not a fdt
    key_unify_init:375,unify key config table parse fail
    Err key(L48):fail in key_drv_init
     error: image data is not a fdt
    key_unify_init:375,unify key config table parse fail
    Err key(L48):fail in key_drv_init
    Err imgread(L330):Fmt unsupported!genFmt 0x0 != 0x3
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    Saving Environment to None...
    BOOT FROM CARD?
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init devices, saveenv fail
    Enter USB burn
    Try connect time out 701, 700, 37606
    Booting...
    There is no valid bmp file at the given address
    bmp scale:  mode=1080p , x=0, y=0, w=1920, h=1080
    Saving Environment to None...
    BOOT FROM CARD?
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init devices, saveenv fail
     error: image data is not a fdt
    key_unify_init:375,unify key config table parse fail
    Err key(L48):fail in key_drv_init
     error: image data is not a fdt
    key_unify_init:375,unify key config table parse fail
    Err key(L48):fail in key_drv_init
    Err imgread(L330):Fmt unsupported!genFmt 0x0 != 0x3
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    Saving Environment to None...
    BOOT FROM CARD?
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init devices, saveenv fail
    
这个可能得改UBOOT,可惜我不会。在网上找了一圈也没找到相关资料。最后找到一个支持SD卡启动linux系统的UBOOT,使用Win32DiskImager写入SD卡,下面是启动信息
    QA5:B;SVN:B72;POC:1FF;STS:0;BOOT:0;INIT:10;BOOT:1;INIT:0;READ:0;CHECK:0;PASS:1;
    no sdio debug board detected 
    TE : 633434
    BT : 10:08:50 Jun  7 2022
    PMU:NONE
    ##### VDDEE voltage = 0x044c
    
    CPU clock is 792MHz
    
    DDR mode: 32 bit mode
    DDR size: 1GB (auto)
    DDR check: Pass!
    DDR clock: 636MHz with 2T mode
    DDR pll bypass: Disabled
    DDR init use : 16594 us
    
    HHH
    SD_boot_type: 00000001
    card_type: 00000000
    0x0000009f
    check SD_boot_type:0x1     card_type:0x0
    ucl decompress...pass
    0x12345678
    Boot from external device 
    TE : 998548
    
    System Started
    
    
    U-boot(m8b_m201_v1@) (Jun 07 2022 - 10:08:46)
    
    clr h-ram
    DRAM:  1 GiB
    relocation Offset is: 2feb8000
    show partition table: 
    part: 0, name :       logo, size : 2000000
    part: 1, name :   recovery, size : 2000000
    part: 2, name :       misc, size : 2000000
    part: 3, name :  instaboot, size : 20000000
    part: 4, name :     kernel, size : 2000000
    part: 5, name :       boot, size : 2000000
    part: 6, name :     system, size : 40000000
    part: 7, name :     backup, size : 40000000
    part: 8, name :      cache, size : 20000000
    part: 9, name :       app0, size : 10000000
    part: 10, name :       app1, size : 10000000
    part: 11, name :       data, size : end 
    aml_card_type=0x200
    MMC:   [mmc_register] add mmc dev_num=0, port=1, if_type=6
    [mmc_register] add mmc dev_num=1, port=2, if_type=6
    SDIO Port B: 0, SDIO Port C: 1
    power init
    out reg=c110804c,value=dfffffff
    IR init done!
    register usb cfg[0][1] = 3ff67fb0
    register usb cfg[2][0] = 3ff6b124
    out reg=c8100024,value=bfff3fff
    enter emmc boot
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    EMMC boot, but emmc init failed
    SF: Unsupported manufacturer ff
    *** Warning - bad CRC, using default environment
    
    EMMC boot, spi init failed
    NAND BOOT: boot_device_flag 1
    Nand PHY driver Version: 2.01.001.0004 (c) 2013 Amlogic Inc.
    amlnf_phy_init : amlnf init flag 5
    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
    EMMC boot, nand init failed
    device_boot_flag=3
    CARD BOOT: not init nand
    do not init nand : cause boot_device_flag without nand 
    BOOT FROM CARD? env_relocate_spec
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init deviceset_storage_device_flag: store 0
    set_storage_device_flag: set  store to 3
    BOOT FROM CARD?
    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:2
    Unknown command 'nand' - try 'help'
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    error init devices, saveenv fail
    vpu clk_level = 3
    set vpu clk: 182150000Hz, readback: 182150000Hz(0x701)
    Net:   Meson_Ethernet
    init suspend firmware done. (ret:0)
    cvbs trimming.1.v5: 0xa0, 0x0
    hdmi tx power init
    TV mode 1080p selected.
    mode = 8  vic = 16
    set HDMI vic: 16
    mode is: 8
    viu chan = 1
    config HPLL
    config HPLL done
    reconfig packet setting done
    Err imgread(L526):head magic error
    There is no valid bmp file at the given address
    reboot_mode=charging
    Hit Enter key to stop autoboot -- :  0 
    exit abortboot: 0
    (Re)start USB(0)...
    USB0:   dwc_usb driver version: 2.94 6-June-2012
    USB (1) peri reg base: c1108820
    USB (1) use clock source: XTAL input
    USB (1) base addr: 0xc90c0000
    Force id mode: Host
    dwc_otg: No USB device found !
    lowlevel init failed
    USB error: all controllers failed lowlevel init
    
    ** Invalid boot device **
    
    ** Invalid boot device **
    [mmc_init] SDIO Port B:0, if_type=7, initialized OK!
    MMC init part
    
    Partition Map for SD device 0  --   Partition Type: DOS
    
    Partition     Start Sector     Num Sectors     Type
        1             16065       7711200     b
    Device: SDIO Port B
    Manufacturer ID: 0
    OEM: 0
    Name: Tran Speed: 20000000
    Rd Block Len: 512
    SD version 2.0
    High Capacity: No
    Capacity: 2021654528
    Boot Part Size: 0
    Bus Width: 4-bit
    
    ** Unable to use mmc 0:1 for fatload **
    [mmc_init] SDIO Port C:1, eMMC: Card did not respond to voltage select! mmc->block_dev.if_type=6
    Enter USB burn
    Try connect time out 701, 700, 7821
    Booting...
     error: image data is not a fdt
    key_unify_init:375,unify key config table parse fail
    Err key(L47):fail in key_drv_init
    Err imgread(L330):Fmt unsupported!genFmt 0x0 != 0x3
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    enter recovery
    Device: SDIO Port B
    Manufacturer ID: 0
    OEM: 0
    Name: Tran Speed: 20000000
    Rd Block Len: 512
    SD version 2.0
    High Capacity: No
    Capacity: 2021654528
    Boot Part Size: 0
    Bus Width: 4-bit
    
    ** Unable to use mmc 0:1 for fatload **
    (Re)start USB(0)...
    USB0:   dwc_usb driver version: 2.94 6-June-2012
    USB (1) peri reg base: c1108820
    USB (1) use clock source: XTAL input
    USB (1) base addr: 0xc90c0000
    dwc_otg: usb_lowlevel_init: Bad value for SNPSID: 0x00000000
    
    lowlevel init failed
    USB error: all controllers failed lowlevel init
    
    ** Invalid boot device **
    Err imgread(L330):Fmt unsupported!genFmt 0x0 != 0x3
    no recovery in flash
    m8b_m201_1G#<INTERRUPT>
    m8b_m201_1G#
    
    
可以从SD卡启动,还能从USB启动。在网上找到一个写好了UBOOT的系统Armbian_21.02.0-trunk_Aml-s812_bullseye_current_5.15.0-aml-s812-sd.7z直接用Win32DiskImager写入SD卡(文末提供下载)就可以使用了,当然为了速度快,可用用容量小的SD卡写入UBOOT-SD.bin,把系统写入U盘,这样运行速度要快些。当然也可以用UBOOT-SD.bin合成自己的镜像,可以作TV盒子,安卓系统,游戏系统。
合成方法:
linux下dd命令
dd if=UBOOT文件 of=镜像文件 conv=fsync,notrunc bs=1 count=444
dd if=UBOOT文件 of=镜像文件 conv=fsync,notrunc bs=512 skip=1 seek=1

可以正常使用Docker,那这可以玩性就多了。我先安装了个1panel面板。
1panel部署方法:
```
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && bash quick_start.sh
```




我安装的甜糖,看能不能赚点网费。如果有刷甜糖的,邀请码是527536
部署甜糖方法:

```
docker run -d  -v /mnt/mmcblk0p1:/mnt/data/ttnode  -v /var/run/docker.sock:/var/run/docker.sock  -v /proc:/host/proc:ro   --name ttnode  --hostname ttnode --device /dev/mem --cap-add SYS_RAWIO --privileged  --net=host  --restart=always -e container_name=ttnode  registry.cn-hangzhou.aliyuncs.com/tiptime/ttnode:latest
```
[![玩客云Docker]
参数解释

    -v /mnt/mmcblk0p1:/mnt/data/ttnode/mnt/host/dir

这里的/mnt/mmcblk0p1改为你的设备的缓存目录

     -v /var/run/docker.sock:/var/run/docker.sock

支持自动更新,不设置则需要手动更新镜像

    --name ttnode
    
容器名称,建议自行修改个比较独特的容器名称,尽量不与他人重复,避免冲突

    -e container_name=ttnode
    
容器名称,需与上面的name保持一致,否则可能有启动业务失败
查看 ttnode 状态

    docker container ls # 查看所有容器

浏览器

    docker inspect 容器名 -f "{{json .NetworkSettings.Networks.macnet.IPAddress }}" # 查看容器ip     http://容器IP:1024  # 浏览器 查看二维码  端口

命令行

    docker logs -f 容器名 # 查看二维码  端口

删除 ttnode

    docker rm -f 容器名  # 删除容器

检查 ttnode 挂载

    docker inspect -f '{{ .Mounts }}'  容器名

预期 [{bind  /mnt/host/dir /mnt/data/ttnode   true rprivate} ......]
左边是本机挂载目录 /mnt/host/dir ,右边必须是 /mnt/data/ttnode 

还有很多功能可以用,可以在1panel面板应用中心安装Home Assistant做一个自己的智能家居自动化平台,断网也能自动控制家里的智能设备。比去卖一台控制中心性价比强多了。
相关下载:
[wv]
<a href="http://download.nctoro.com/f/21340179-1011562432-6219dc" target="_blank">Win32DiskImager2.0.1.8.rar</a><br/>
<a href="http://download.nctoro.com/f/21340179-1011562426-ebabb7" target="_blank">u-boot-sd.bin</a><br/>
<a href="http://download.nctoro.com/f/21340179-1011562633-8e48c5" target="_blank">Armbian_21.02.0-trunk_Aml-s812_bullseye_current_5.15.0-aml-s812-sd</a><br/>


[/wv]