您尚未登录。

楼主 #1 2017-12-01 10:30:39

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

v3s U-boot启动界面分享

参考:  主线Uboot

主线Uboot
Uboot基础编译
安装交叉编译器
网盘地址:http://pan.baidu.com/s/1hsf22fq
国外用户:https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/

wget https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xvf gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
mv gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf /opt/
vim /etc/bash.bashrc
# add: PATH="$PATH:/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin"
arm-linux-gnueabihf-gcc -v
sudo apt-get install device-tree-compiler
下载编译Uboot
git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-current
#or git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-spi-experimental
cd u-boot
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero_800x480LCD_defconfig
#or make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero480x272LCD_defconfig
#or make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero_defconfig
make ARCH=arm menuconfig
time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 2>&1 | tee build.log
编译完成后,在当前目录下生成了u-boot-sunxi-with-spl.bin,可以烧录到8K偏移处启动。

Uboot结构简介
下面来看看该uboot中的目录结构
├── api                存放uboot提供的API接口函数
├── arch               平台相关的部分我们只需要关心这个目录下的ARM文件夹
│   ├──arm
│   │   └──cpu
│   │   │   └──armv7
│   │   └──dts   
│   │   │   └──*.dts 存放设备的dts,也就是设备配置相关的引脚信息
├── board              对于不同的平台的开发板对应的代码
├── cmd                顾名思义,大部分的命令的实现都在这个文件夹下面。
├── common             公共的代码
├── configs            各个板子的对应的配置文件都在里面,我们的Lichee配置也在里面
├── disk               对磁盘的一些操作都在这个文件夹里面,例如分区等。
├── doc                参考文档,这里面有很多跟平台等相关的使用文档。
├── drivers            各式各样的驱动文件都在这里面
├── dts                一种树形结构(device tree)这个应该是uboot新的语法
├── examples           官方给出的一些样例程序
├── fs                 文件系统,uboot会用到的一些文件系统
├── include            头文件,所有的头文件都在这个文件夹下面
├── lib                一些常用的库文件在这个文件夹下面 
├── Licenses           这个其实跟编译无关了,就是一些license的声明
├── net                网络相关的,需要用的小型网络协议栈
├── post              上电自检程序
├── scripts           编译脚本和Makefile文件
├── spl               second program loader,即相当于二级uboot启动。
├── test              小型的单元测试程序。
└── tools             里面有很多uboot常用的工具。
了解了uboot的基本结构,我们可以知道一些相关的配置在什么地方了。

lichee的uboot配置文件放在confgs文件目录下面,名称为
LicheePi_Zero_480x272LCD_defconfig
LicheePi_Zero_800x480LCD_defconfig
LicheePi_Zero_defconfig
这3个配置是根据不同的Zero显示设备进行的配置,使用其中之一即可,可以在uboot目录下执行命令
make LicheePi_Zero_defconfig
这样配置就生效了。
开机logo替换
Uboot的开机logo默认情况(只定义了CONFIG_VIDEO_LOGO)是企鹅logo,这个是存在于uboot代码中的一个头文件(include/video_logo.h或 bmp_logo.h),这个是一个巨大的结构体,其中保存着图片每个像素点的色彩数据。:

准备一张jpeg图片,通过命令行处理为8bit BMP图片。
#!/bin/sh
#install Netpbm first
jpegtopnm $1 | ppmquant 31 | ppmtobmp -bpp 8 > $2
使用方法: (脚本名) ( 待处理的JPG图片名) (输出文件名)

将bmp文件放入/tools/logos中,并修改/tools/下的Makefile
# Generated LCD/video logo
LOGO_H = $(OBJTREE)/include/bmp_logo.h
LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_H)
LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H)
ifeq ($(LOGO_BMP),)
LOGO_BMP= logos/mylogo.bmp
endif
ifeq ($(VENDOR),atmel)
LOGO_BMP= logos/atmel.bmp
endif
ifeq ($(VENDOR),esd)
LOGO_BMP= logos/esd.bmp
endif
ifeq ($(VENDOR),freescale)
LOGO_BMP= logos/freescale.bmp
endif
ifeq ($(VENDOR),ronetix)
LOGO_BMP= logos/ronetix.bmp
endif
ifeq ($(VENDOR),syteco)
LOGO_BMP= logos/syteco.bmp
endif
将mylogo.bmp替换成你生成的logo

确认配置文件
在include/configs/sun8i.h中加入两个宏定义:

#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
编译的时候,你的bmp文件会被tools/bmp_logo.c编译出的工具bmp_logo
制作成include/bmp_logo.h,并编译进uboot中。

四、重新编译u-boot即可得到显示新logo的u-boot。





离线

楼主 #2 2017-12-01 10:35:31

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: v3s U-boot启动界面分享

参考1:  主线Uboot
参考2:  荔枝派Zero V3s开发板入坑教程

1. 安装arm linux 硬件浮点数工具链, 因为V3s支持VFPv4 浮点单元: sudo apt-get install gcc-arm-linux-gnueabihf
2. 安装git源码管理软件:  sudo apt-get install git
3. 支持spi flash的u-boot:   git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-spi-experimental
4. 制作一张256(8位)颜色的bmp图片, 制作方法参考:  export-file-as-palleted-8bit-per-pixel-bmp-from-gimp
5. 拷贝制作的bmp图片到toos/logos/sy.bmp【cp /mnt/hgfs/F/linuxlogo2.bmp tools/logos/sy.bmp】
6. 修改tools/Makefile:  【LOGO_BMP= $(srctree)/$(src)/logos/denx.bmp】 ==》 【LOGO_BMP= $(srctree)/$(src)/logos/sy.bmp】
7. 修改 include/configs/sun8i.h, 添加

#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_HIDE_LOGO_VERSION

从spi flash引导系统, 根文件系统位于spi flash, 添加:
#define CONFIG_BOOTCOMMAND   "sf probe 0 12000000; "                           \
                             "sf read 0x41800000 0x100000 0x10000; "  \
                             "sf read 0x41000000 0x110000 0x600000; " \
                             "bootz 0x41000000 - 0x41800000"

#define CONFIG_BOOTARGS      "console=ttyS0,115200 earlyprintk panic=5 rootwait " \
                              "mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,6M(kernel)ro,-(rootfs) root=/dev/mtdblock3 rw rootfstype=jffs2 vt.global_cursor_default=0"

从TF卡引导系统,根文件系统在TF卡第二个分区, 添加以下代码:
#define CONFIG_BOOTCOMMAND   "setenv bootm_boot_mode sec; " \
                            "load mmc 0:1 0x41000000 zImage; "  \
                            "load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb; " \
                            "bootz 0x41000000 - 0x41800000;"

#define CONFIG_BOOTARGS      "console=ttyS0,115200 panic=5 mtdparts=spi32766.0:1M(uboot),64k(dtb),4M(kernel),-(rootfs) rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0"

8. 执行编译: ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make
9. 烧写: sudo sunxi-fel -p spiflash-write 0 u-boot-sunxi-with-spl.bin





离线

楼主 #3 2017-12-01 10:49:54

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: v3s U-boot启动界面分享

其中 CONFIG_HIDE_LOGO_VERSION 这个是隐藏 u-boot启动时屏幕上显示的版本信息.

QQ20171201105418.jpg





离线

#4 2020-07-25 15:17:14

xiezonglin
会员
注册时间: 2020-03-07
已发帖子: 12
积分: 5

Re: v3s U-boot启动界面分享

我用nano的板子,用2018的uboot,tf卡启动,已经实现了开机显示图片,但是图片比较大的时候,编译uboot的时候提示下面这个,请问怎么处理呢?我看你可以显示整张图片啊
binman: Node '/binman/u-boot-img': Entry contents size is 0xa6fc9 (683977) but entry size is 0x7e000 (516096)

离线

#5 2020-07-27 23:24:18

zt
会员
注册时间: 2020-07-27
已发帖子: 2
积分: 2

Re: v3s U-boot启动界面分享

我什么时候才能成为这样的高手呀

离线

#6 2020-08-12 14:13:16

jkl
会员
注册时间: 2019-11-18
已发帖子: 251
积分: 139.5

Re: v3s U-boot启动界面分享

xiezonglin 说:

我用nano的板子,用2018的uboot,tf卡启动,已经实现了开机显示图片,但是图片比较大的时候,编译uboot的时候提示下面这个,请问怎么处理呢?我看你可以显示整张图片啊
binman: Node '/binman/u-boot-img': Entry contents size is 0xa6fc9 (683977) but entry size is 0x7e000 (516096)

你好,请问这个问题解决了吗?

离线

#7 2020-08-12 16:56:44

jkl
会员
注册时间: 2019-11-18
已发帖子: 251
积分: 139.5

Re: v3s U-boot启动界面分享

晕哥 说:

其中 CONFIG_HIDE_LOGO_VERSION 这个是隐藏 u-boot启动时屏幕上显示的版本信息.

https://whycan.cn/files/members/3/QQ20171201105418.jpg

晕哥,您这个图片怎么显示的是全屏,是另外修改了什么配置吗?我这边图片大了,uboot就编译出错:

binman: Node '/binman/u-boot-img': Entry contents size is 0xb6cd8 (748760) but entry size is 0x7e000 (516096)
Makefile:1149: recipe for target 'u-boot-sunxi-with-spl.bin' failed
make: *** [u-boot-sunxi-with-spl.bin] Error 1
make: 离开目录“/home/le/jkl/a33/x3-pack/u-boot”
compile x3 u-boot error.

离线

#8 2020-09-13 08:50:22

shawn.d
会员
注册时间: 2020-09-12
已发帖子: 164
积分: 100

Re: v3s U-boot启动界面分享

感谢大佬分享

离线

#9 2020-12-23 17:59:51

L_max
会员
注册时间: 2020-12-08
已发帖子: 33
积分: 33

Re: v3s U-boot启动界面分享

酷友们问个开机logo问题

U-boot配置勾选 Enable graphical uboot console on HDMI, LCD or VGA ,内核就启动不了,uboot启动完之后就不动,但是屏幕logo显示正常,
配置里去掉这个选项就能正常启动,但是屏幕背光有亮,不显示logo,这是什么原因啊(Kernel也使能了logo)

ARM architecture  ---> 
      [勾选] Enable graphical uboot console on HDMI, LCD or VGA 

去掉上面这个配置,uboot启动后屏幕有亮,没有logo,系统也能正常启动,启动内核之后,kernel的logo也能正常显示,
正常应该是uboot和kernel启动都有logo显示

离线

#10 2022-05-01 15:34:08

LinuxGo
会员
注册时间: 2021-01-07
已发帖子: 88
积分: 120

Re: v3s U-boot启动界面分享

@xiezonglin
你好 老哥,请问这个问题解决了吗?

离线

#11 2022-05-01 15:35:36

LinuxGo
会员
注册时间: 2021-01-07
已发帖子: 88
积分: 120

Re: v3s U-boot启动界面分享

@jkl
你好老哥,这个问题解决了吗?
binman: Node '/binman/u-boot-img': Entry contents size is 0xa6759 (681817) but entry size is 0x7e000 (516096)
make: *** [Makefile:1148: u-boot-sunxi-with-spl.bin] Error 1

离线

#12 2022-06-25 18:22:39

diancity
会员
注册时间: 2022-02-14
已发帖子: 4
积分: 4

Re: v3s U-boot启动界面分享

大佬,buildroot怎么添加uboot启动图片呢

离线

#13 2022-06-27 16:05:40

ahejn
会员
注册时间: 2022-06-27
已发帖子: 3
积分: 3

Re: v3s U-boot启动界面分享

这个有点酷!!

离线

#14 2022-08-20 14:00:54

tevada2010
会员
注册时间: 2022-07-23
已发帖子: 54
积分: 69

Re: v3s U-boot启动界面分享

我跟随每一步 但徽标图像未显示

离线

#15 2022-08-26 13:31:13

ronz
会员
注册时间: 2021-11-19
已发帖子: 31
积分: 31

Re: v3s U-boot启动界面分享

期待2022 uboot - spi nand flash版本,折腾了半天没搞起来

离线

#16 2022-08-26 14:48:49

jing liu
会员
注册时间: 2022-08-26
已发帖子: 1
积分: 1

Re: v3s U-boot启动界面分享

这种编译器安装的版本是多少

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn