这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » 国产MCU » 基于RK3328的ubuntu系统开机黑屏是怎么回事

共2条 1/1 1 跳转至

基于RK3328的ubuntu系统开机黑屏是怎么回事

工程师
2024-02-01 22:33:44     打赏

1.jpg

问题描述及复现步骤:

采用 ROC-RK3328-PC 源码的地址,下载了 rk3328_linux_release_v2.5.1_20210301_split_dir ubuntu18.04源码包;

按维基的教程,更改了ROOTFS.IMG的路径,用下面的两套指令编译,用ROC-RK3328-CC-UBUNTU.MK的可以开机(但是没有WIFI模块);
用 ROC-RK3328-PC-UBUNTU.MK 的不能开机,开机第一画面正常,卡在第二画面并黑屏。UART LOG 日志卡在 Starting kernel ... 这里。

编译 CC 固件,可以开机,但没有WIFI模块,有线可以用。
./build.sh roc-rk3328-cc-ubuntu.mk
./build.sh

编译 PC 固件,不能开机。
./build.sh roc-rk3328-pc-ubuntu.mk
./build.sh

请大家帮忙指导下,新手刚学习中,谢谢了!

UART LOG:
Boot1 Release Time: May 13 2019 17:34:36, version: 2.50
ChipType = 0x11, 231
mmc2:cmd19,100
SdmmcInit=2 0
BootCapSize=2000
UserCapSize=29820MB
FwPartOffset=2000 , 2000
SdmmcInit=0 NOT PRESENT
StorageInit ok = 179410
Raw SecureMode = 0
SecureInit read PBA: 0x4
SecureInit read PBA: 0x404
SecureInit read PBA: 0x804
SecureInit read PBA: 0xc04
SecureInit read PBA: 0x1004
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT part:  0, name:            uboot, start:0x4000, size:0x2000
GPT part:  1, name:            trust, start:0x6000, size:0x2000
GPT part:  2, name:             misc, start:0x8000, size:0x2000
GPT part:  3, name:             boot, start:0xa000, size:0x10000
GPT part:  4, name:         recovery, start:0x1a000, size:0x10000
GPT part:  5, name:           backup, start:0x2a000, size:0x10000
GPT part:  6, name:           rootfs, start:0x5a000, size:0x600000
GPT part:  7, name:         userdata, start:0x65a000, size:0x33e3fdf
find part:uboot OK. first_lba:0x4000.
find part:trust OK. first_lba:0x6000.
LoadTrust Addr:0x6000
No find bl30.bin
Load uboot, ReadLba = 4000
Load OK, addr=0x200000, size=0xd1a30
RunBL31 0x40000
INFO:    Preloader serial: 2
NOTICE:  BL31: v1.3(release):3be52e9
NOTICE:  BL31: Built : 14:51:38, Nov  3 2020
NOTICE:  BL31:Rockchip release version: v1.3
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
INFO:    BL31: Initializing BL32
INF [0x0] TEE-CORE:init_primary_helper:337: Initializing (1.1.0-266-gee81607c #3 Mon Aug 17 09:29:38 UTC 2020 aarch64)

INF [0x0] TEE-CORE:init_primary_helper:338: Release version: 1.4

INF [0x0] TEE-CORE:init_teecore:83: teecore inits done
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9

U-Boot 2017.09-gc56bc3a030-dirty #h (Apr 28 2022 - 15:37:52 +0800)

Model: Firefly ROC-RK3328-CC
PreSerial: 2
DRAM:  2 GiB
Sysmem: init
Relocation Offset: 7dbf5000, fdt: 7bdea578
Using default environment

rksdmmc@ff500000: 1, rksdmmc@ff520000: 0
Bootdev(atags): mmc 0
MMC0: High Speed, 52Mhz
PartType: EFI
boot mode: recovery (misc)
Found DTB in recovery part
DTB: rk-kernel.dtb
HASH(s): OK
Android header version 0
use default hdmi phy table
Warn: can't find connect driver
In:    serial
Out:   serial
Err:   serial
Model: Firefly ROC-RK3328-PC
Rockchip UBOOT DRM driver version: v1.0.1
use default hdmi phy table
xfer: num: 2, addr: 0x50
xfer: num: 2, addr: 0x50
Monitor has basic audio support
Could not find baseparameter partition
mode:1920x1080
Detailed mode clock 148500 kHz, flags[5]
H: 1920 2008 2052 2200
V: 1080 1084 1089 1125
bus_format: 100a
CEA mode used vic=16
final pixclk = 148500000 tmdsclk = 148500000
start Inno HDMI PHY Power On
tmdsclock = 148500000; chipversion = 2
Inno HDMI PHY Power On
sink has audio support
hdmi_set_clk_regenerator: fs=48000Hz ftdms=148.500MHz N=6144 cts=148500
CLK: (sync kernel. arm: enter 600000 KHz, init 600000 KHz, kernel 0N/A)
apll 400000 KHz
dpll 664000 KHz
cpll 1200000 KHz
gpll 491009 KHz
npll 600000 KHz
armclk 600000 KHz
aclk_bus 150000 KHz
hclk_bus 75000 KHz
pclk_bus 75000 KHz
aclk_peri 150000 KHz
hclk_peri 75000 KHz
pclk_peri 75000 KHz
Net:
Warning: ethernet@ff540000 (eth0) using random MAC address - 82:ba:f6:7c:4b:11
eth0: ethernet@ff540000
Hit key to stop autoboot('CTRL+C'):  3  2  1  0
ANDROID: reboot reason: "recovery"
Booting IMAGE kernel at 0x00280000 with fdt at 0x08300000...

Fdt Ramdisk skip relocation

## Booting Android Image at 0x0027f800 ...

Kernel load addr 0x00280000 size 21393 KiB
RAM disk load addr 0x0a200000 size 8762 KiB

## Flattened Device Tree blob at 08300000

Booting using the fdt blob at 0x8300000
XIP Kernel Image from 0x00280000 to 0x00280000 ... OK
Using Device Tree in place at 0000000008300000, end 00000000083157e6
No file: logo_kernel.bmp
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x0a200000 - 0x80000000 (size: 0x75e00000)
Total: 4387.375 ms

Starting kernel ...






关键词: RK3328     ubuntu    

助工
2024-02-01 22:34:55     打赏
2楼

因为ROC-3328-PC的debug串口复用uart2与蓝牙串口通信,所以在kernel里关闭了debug串口,服用成UART2。
但是在后来的客户反馈和我们调试发现,我们之作出来的固件flash到板子上无法开,原因是第一次启动会进入recovery模式失败。
原因是rk的recovery模式与debug串口进行深度绑定,如果关闭debug串口会导致recovery启动异常,进而导致无法开机。
firefly也尝试过修改rk的recovery,但是由于绑定太深所以也影响后续代码迭代。所以之好让客户在编译固件的时候切换和修改kernel/。



以下为修改和编译方法:

1. 先编译recovery.img

修改kernel/ ,关闭UART2并打开debug串口

vim kernel/arch/arm64/boot/dts/rockchip/rk3328-roc-pc.dts
./build.sh recovery

生成 SDK/rockdev/recovery.img

--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-pc.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-pc.dts
@@ -2,7 +2,7 @@
#include "rk3328-roc-pc.dtsi"

&fiq_debugger {
-       status = "disabled";
+       status = "okay";
};

&wireless_bluetooth {
@@ -11,5 +11,5 @@

&uart2 {
        dma-names = "tx", "rx";
-       status = "okay";
+       status = "disabled";
};

2. 去除之前的kernel/修改,编译uboot和kernel

cd kernel/
git co arch/arm64/boot/dts/rockchip/rk3328-roc-pc.dts
cd ../
./build.sh uboot kernel

3. 打包固件

./mkfirmware.sh
./build.sh updateimg 

发现是发现recovery时候要打开串口才行。rk的程序的bug


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]