JeffyCN / meta-rockchip

Yocto BSP layer for the Rockchip SOC boards
Other
114 stars 86 forks source link

use local source code and change uart debug #92

Closed Alvin-xie closed 7 months ago

Alvin-xie commented 7 months ago

1.搭建环境

~ $ mkdir yocto; cd yocto
~/yocto $ git clone git://git.yoctoproject.org/poky -b kirkstone
~/yocto $ git clone git://git.openembedded.org/meta-openembedded.git -b kirkstone

~/yocto $git clone https://github.com/JeffyCN/meta-rockchip -b kirkstone

~/yocto $ source poky/oe-init-build-env

2.修改配置

# build/conf/bblayers.conf
BBLAYERS ?= " \
  ${TOPDIR}/../meta-rockchip \
  ${TOPDIR}/../poky/meta \
  ${TOPDIR}/../poky/meta-poky \
  ${TOPDIR}/../poky/meta-yocto-bsp \
  ${TOPDIR}/../meta-openembedded/meta-oe \

# build/conf/loacal.conf
  MACHINE ??= "rockchip-rk3308-evb"

3.编译

$ bitbake core-image-minimal

build ok.

4.下载代码

git clone https://github.com/JeffyCN/mirrors -b u-boot
git clone https://github.com/JeffyCN/mirrors -b rkbin
git clone https://github.com/JeffyCN/mirrors -b kernel-4.4

修改 build/conf/local.conf


# build/conf/local.conf
SRC_URI:pn-linux-rockchip = " \
        git://${TOPDIR}/../kernel;protocol=file;usehead=1 \
        file://cgroups.cfg \
"
SRCREV:pn-linux-rockchip = "${AUTOREV}"
KBRANCH = "HEAD"

SRC_URI:pn-u-boot = " \
        git://${TOPDIR}/../u-boot;protocol=file;usehead=1 \
"
SRCREV:pn-u-boot = "${AUTOREV}"

SRC_URI:pn-rkbin = " \
        git://${TOPDIR}/../rkbin;protocol=file;usehead=1 \
"
SRCREV:pn-rkbin = "${AUTOREV}"

重新编译 $ bitbake core-image-minimal 重新编译发现未使用到对应的kernel,uboot,rkbin目录 想要使用本地下载下来的源码,同时更好调试打印串口,上面的操作哪里有问题吗?

Alvin-xie commented 7 months ago

尝试了 bitbake -c cleanall u-boot-rockchip 后重新 build :bitbake -D core-image-minimal 但是有报错,没有rkbin目录 | start=$(aarch64-poky-linux-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-poky-linux-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x00600000 $start $end | cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin | cp u-boot-dtb.bin u-boot.bin | truncate -s "%8" u-boot.bin | aarch64-poky-linux-objcopy --dump-section .rodata.default_environment=u-boot-initial-env env/common.o; sed --in-place -e 's/\x00/\x0A/g' u-boot-initial-env | make[1]: Leaving directory '/mnt/data/home/alvin/work/local-yocto/build/tmp/work/rockchip_rk3308_evb-poky-linux/u-boot-rockchip/1_2017.09-r0/build' | make: Leaving directory '/mnt/data/home/alvin/work/local-yocto/build/tmp/work/rockchip_rk3308_evb-poky-linux/u-boot-rockchip/1_2017.09-r0/git' | ERROR: No ../rkbin repository | WARNING: /mnt/data/home/alvin/work/local-yocto/build/tmp/work/rockchip_rk3308_evb-poky-linux/u-boot-rockchip/1_2017.09-r0/temp/run.do_compile.2253623:220 exit 1 from './make.sh' | WARNING: Backtrace (BB generated script): | #1: do_compile, /mnt/data/home/alvin/work/local-yocto/build/tmp/work/rockchip_rk3308_evb-poky-linux/u-boot-rockchip/1_2017.09-r0/temp/run.do_compile.2253623, line 220 | #2: main, /mnt/data/home/alvin/work/local-yocto/build/tmp/work/rockchip_rk3308_evb-poky-linux/u-boot-rockchip/1_2017.09-r0/temp/run.do_compile.2253623, line 275

JeffyCN commented 7 months ago

可以参考build/conf/include/rksdk。 u-boot.conf用git log -p查看改成dummy之前的版本

Alvin-xie commented 7 months ago

我这里改成了这样: ` SRC_URI:pn-linux-rockchip = " \ git://${TOPDIR}/../kernel;protocol=file;usehead=1 \ file://cgroups.cfg \ " SRCREV:pn-linux-rockchip = "${AUTOREV}" KBRANCH = "HEAD"

SRC_URI:pn-u-boot-rockchip = " \ git://${TOPDIR}/../u-boot;protocol=file;usehead=1 \ file://${TOPDIR}/../rkbin.tar.gz \ file://${TOPDIR}/../tools-e3cdef0084c4c12e73ebe672731c967fbf3f75f1.tar.gz \ " SRCREV:pn-u-boot-rockchip = "${AUTOREV}" ` 改好后的rkbin重新打包了一下也能编译通过,生成的镜像也ok