自用rk3568-firefly-itx-3568q核心板+fpga+自研底板,因底板所需外设、功能与原厂有较大差异,故裁剪相应sdk,编译新的内核进行烧写。然而在更改设备树过程中kernel/drivers/media/i2c/fpga.c中的像素格式MEDIA_BUS_FMT_YUYV8_2X8误改成MEDIA_BUS_FMT_YUYV8_1X16,故导致开发板上电挂掉,需重新烧写原厂镜像启动板子,再通过ssh进行传输更改后的正确镜像。在烧写过程中遇到很多问题,差一点板子就变砖,简单总结一下,便于后期备用,有遇到相同情况的也可以尝试一下~
一、模式问题
需准备硬件:USB双公头一根(一端在PC机,另外一端在开发板的USB OTG口),12v电源
1.连接好电源和USB线后,电源灯亮,但是RKDevTool.exe显示“识别不到设备”,换了一根usb也没用,后来按了一下reset键,可以进maskrom模式(但是这种情况我几个月才遇到过一次,太偶然了)
2.MaskRom
模式是设备变砖的最后一条防线。强行进入 MaskRom
涉及硬件操作,有一定风险,因此仅在设备进入不了 Loader
模式的情况下,方可尝试 MaskRom
模式。进入 MaskRom
的原理是人为的把 EMMC 的数据脚与地线短接,系统会认为 EMMC 数据出错,从而清除 EMMC 数据。
连接好电源和USB线后,电源灯亮,但是RKDevTool.exe显示“识别不到设备”,用firefly官方提供的说法,将EMMC附近的D0和GND 测试点对接,官方是要用镊子短接,这边为了方便焊出两根线。
操作步骤如下:
-
设备断开电源
-
使用双公头USB数据线连接设备和电脑
-
将两根线的头部接触
-
设备插入电源
-
稍候片刻,之后松开线。
此时就会进入maskrom模式
二、烧写问题
1.进入maskrom模式之后 ,首先尝试直接固件升级,但是大概率会显示“固件升级失败”,如果遇到这种情况,可以在RKDevTool.exe----->高级功能中下载对应的MiniLoaderAll.bin,而后选中读取存储列表,一般会显示“SPINOR(√)”,再“擦除所有”,最后点一下emmc,选中“切换存储”。便会显示如下界面,即从emmc烧写。
回到升级固件界面,选中对应的E:\3568资料\firefly_official\Ubuntu20.04\Public\kernel-5.10\ITX-3568Q_Ubuntu20.04-Xfce-r31113_v1.4.0a_240307\ITX-3568Q_Ubuntu20.04-Xfce-r31113_v1.4.0a_240307.img进行升级,片刻便会升级成功,如下
2.如果makrom模式烧写不成功,有可能是emmc空间已满,而系统镜像太大,烧不进去,这种情况可以选择直接下电,再上电,过30-60s后会自动识别为loader设备,此时进行烧写便可以了
3.如果loader模式也烧写不进去,可以选择擦除flash,再烧RK356x_NorFlash2eMMCLoader_20211209.img和系统镜像便可
4.当烧写进去显示
Bootdev(atags): mtd 2
GUID Partition Table Header signature is wrong: 0xA9425BF5A94153F3 != 0x5452415020494645
*** ERROR: Can't write GPT header ***
Backup GPT repair fail!
PartType: EFI
boot mode: recovery (misc)
FIT: No fdt blob
boot mode: None
Android 11.0, Build 2021.4, v2
Found DTB in boot part
Failed to read resource hdr
Failed to create resource list
Failed to load DTB
Failed to get kernel dtb, ret=-19
io-domain: OK
Model: Rockchip RK3568 Evaluation Board
rockchip_set_ethaddr: vendor_storage_write failed -5
rockchip_set_serialno: could not find efuse/otp device
no recovery key node
CLK: (sync kernel. arm: enter 816000 KHz, init 816000 KHz, kernel 0N/A)apll 816000 KHzdpll 780000 KHzgpll 1188000 KHzcpll 1000000 KHznpll 24000 KHzvpll 24000 KHzhpll 24000 KHzppll 100000 KHzarmclk 816000 KHzaclk_bus 150000 KHzpclk_bus 50000 KHzaclk_top_high 300000 KHzaclk_top_low 200000 KHzhclk_top 150000 KHzpclk_top 50000 KHzaclk_perimid 300000 KHzhclk_perimid 150000 KHzpclk_pmu 50000 KHz
Net: No ethernet found.
Hit key to stop autoboot('CTRL+C'): 0
## Booting FIT Image FIT: No fit blob
FIT: No FIT image
ANDROID: reboot reason: "(none)"
optee api revision: 2.0
TEEC: blk_dread fail
TEEC: OpteeClientRkFsInit fail!
Can't read vboot flag
Android boot failed, error -1.
no mmc device at slot 1
no mmc device at slot 0
starting USB...
Bus dwc3@fcc00000: usb maximum-speed not found
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus dwc3@fd000000: usb maximum-speed not found
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus dwc3@fcc00000 for devices... 1 USB Device(s) found
scanning bus dwc3@fd000000 for devices... cannot reset port 1!?
1 USB Device(s) foundscanning usb for storage devices... 0 Storage Device(s) foundDevice 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-rockchip
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
No ethernet found.
=>
这种情况是因为nor flash不为空,nor flash有一部分不完整的固件,通常是直接把固件烧到nor flash引起的
解决方法:
此uboot命令行中直接把nor flash擦除
=> mtd erase nor0
Erasing 0x00000000 ... 0x01ffffff (8192 eraseblock(s))
=> reboot
再重启。
注:还有一种情况 是上电maskrom模式,而后按住recovery,再按一下reset,便可以进入loader模式。