hwh132 发表于 2022-4-28 17:15:52

ubuntu18.04源码编译问题(ROC-RK3328-PC板子)

本帖最后由 hwh132 于 2022-4-28 17:36 编辑

采用 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, Nov3 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 TEE-CORE:init_primary_helper:337: Initializing (1.1.0-266-gee81607c #3 Mon Aug 17 09:29:38 UTC 2020 aarch64)

INF TEE-CORE:init_primary_helper:338: Release version: 1.4

INF 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
    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 ...

895816513 发表于 2022-6-21 14:33:42

_____ _         __ _
|___(_)_ __ ___ / _| |_   _
| |_| | '__/ _ \ |_| | | | |
|_| | | | |__/_| | |_| |
|_|   |_|_|\___|_| |_|\__, |
                        |___/

* 固件名称 ROC-RK3328-PC_Ubuntu18.04-r21156_v2.5.1b_220615.img
* MD5 6bcaa5a877cf08b44775255f6edb3bf9
* 官网 www.t-firefly.com|www.t-chip.com.cn
* 技术支持 service@t-firefly.com
* 开源社区 https://dev.t-firefly.com/portal.php?mod=topic&topicid=11

获取固件的升级方法和板子的开发指南,请查看官方Wiki:
https://wiki.t-firefly.com/zh_CN/ROC-RK3328-PC/


因为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

pjdu 发表于 2022-5-10 09:19:15

楼主问题解决了吗

hwh132 发表于 2022-5-10 15:37:21

pjdu 发表于 2022-5-10 09:19
楼主问题解决了吗

我是换了 32G的EMMC后出现的,现在换回8G EMMC烧录原固件是可以的,但还没来得及再试自己编译的是否可以。

pjdu 发表于 2022-5-11 11:59:58

hwh132 发表于 2022-5-10 15:37
我是换了 32G的EMMC后出现的,现在换回8G EMMC烧录原固件是可以的,但还没来得及再试自己编译的是否可以 ...

自己编译的,我是用的8G EMMC,TF卡两种方式都没法正常进入系统

hwh132 发表于 2022-5-15 10:11:16

pjdu 发表于 2022-5-11 11:59
自己编译的,我是用的8G EMMC,TF卡两种方式都没法正常进入系统

我换回原来的8G EMMC后编译可以进入,但是还是一样没有 WIFI的功能。烧录官方原来的IMG固件有WIFI,还在找原因。

895816513 发表于 2022-6-21 14:34:27

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

Sterben 发表于 2022-9-6 14:18:18

895816513 发表于 2022-6-21 14:34
你好,发现是发现recovery时候要打开串口才行。rk的程序的bug

你好 我也是换了EMMC 烧写官方提供的固件也无法开机 连开机LOGO都看不到

895816513 发表于 2022-9-6 16:20:32

Sterben 发表于 2022-9-6 14:18
你好 我也是换了EMMC 烧写官方提供的固件也无法开机 连开机LOGO都看不到

怎么就把emmc换料了

Sterben 发表于 2022-9-6 17:29:01

895816513 发表于 2022-9-6 16:20
怎么就把emmc换料了

自己打的板子 有些没货就把emmc和ddr都换了 现在烧firefly的固件起不来
页: [1] 2
查看完整版本: ubuntu18.04源码编译问题(ROC-RK3328-PC板子)