您尚未登录。

楼主 #1 2018-10-10 04:58:56

阿黄
会员
注册时间: 2018-10-03
已发帖子: 299
积分: 134

调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

问题较多,一个一个说。
主要参照了nano.lichee.pro, zero.lichee.pro和晕哥的帖子。 按照步骤编译了uboot、内核和rootfs。
问题1、编译uboot。
使用了配置
git clone https://github.com/Lichee-Pi/u-boot.git -b nano-v2018.01
cd u-boot
#拷贝默认配置文件
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- licheepi_nano_spiflash_defconfig
并配置了LCD之后
编译后 uboot只有320K,而看V4里面的tf-uboot有1M,拷贝到uboot/480272目录,改名后 执行
./clear_partion.sh /dev/sdb
./pack_tf_img.sh /dev/sdb
./write_dd.sh /dev/sdb
实测无法进入到TF卡的uboot,一直报SPL: Unsupported Boot Device! 估计原因是使用了spiflash的defconfig,
但实在不清楚tf卡的配置和spi的配置哪里应该有区别,启动参数应该是boot.scr决定的呀。

问题2:编译内核,
#克隆linux
git clone https://github.com/Lichee-Pi/linux.git --depth=1 -b nano-4.14-exp
cd linux
#下载配置文件
wget /files/members/3/lichee_nano_linux_config.zip
mv lichee_nano_linux_config.zip .config
#再配置
CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm make menuconfig
#编译
CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm make

由于自己编译的uboot无法启动。使用V4版本的uboot,并拷贝并改名了内核文件到p1文件夹,重复
./clear_partion.sh /dev/sdb
./pack_tf_img.sh /dev/sdb
./write_dd.sh /dev/sdb
上电后,可以进uboot,但是启动内核时卡在 Starting kernel ...
下面是启动log
U-Boot 2018.01-05676-g00188782ee (Apr 08 2018 - 16:10:25 +0800) Allwinner Technology

CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

Setting up a 480x272 lcd console (overscan 0x0)
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
280 bytes read in 16 ms (16.6 KiB/s)

Executing script at 80c50000

reading suniv-f1c100s-licheepi-nano.dtb
8553 bytes read in 27 ms (308.6 KiB/s)
reading zImage
3801104 bytes read in 270 ms (13.4 MiB/s)

Flattened Device Tree blob at 80c00000

Booting using the fdt blob at 0x80c00000
Loading Device Tree to 80e60000, end 80e65168 ... OK

Starting kernel ...

问题3: 使用主线的rtp触摸驱动文件sun4i-ts.c编译内核模块ko,系统采用V4版本,但是无法加载,报错如下

insmod sun4i-ts.ko

[ 32.197009] sun4i_ts: Unknown symbol devm_hwmon_device_register_with_groups (err 0)
[ 32.213188] sun4i_ts: Unknown symbol devm_hwmon_device_register_with_groups (err 0)
insmod: can't insert 'sun4i-ts.ko': unknown symbol in module, or unknown parameter
查看了编译选项,需要有HWMON选中才行,估计是由于V4版本内核默认没有选中的原因。 但是我自己编译内核没法工作。。。。

离线

#2 2018-10-10 08:28:33

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,481
积分: 9207

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

第一个问题, u-boot-sunxi-with-spl.bin 这个文件 300k 后面的填充了无用的 0xFF.

SPL: Unsupported Boot Device! 这个问题一般出现在 spi flash 启动上面,
如果你用TF卡应该是不会的,
把更详细的log贴出来看下.





离线

#3 2018-10-10 08:38:25

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,481
积分: 9207

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

第二个问题, 可能 zImage 文件不完整导致解压失败,因为内核编译的时没有合理配置,导致有个解压失败的信息没有打印出来.

当时我用笨办法解决的: https://whycan.cn/t_728.html

这个方法比较好: https://blog.csdn.net/ooonebook/article/details/52654120

打开以下宏:

CONFIG_DEBUG_LL
CONFIG_EARLY_PRINTK

在cmdline(也可以在u-boot的bootargs)中添加“earlyprintk”字符串,如下:

"console=ttySAC0,115200n8 root=/dev/mmcblk0p1 rw rootwait ignore_loglevel earlyprintk"





离线

#4 2018-10-10 08:42:30

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,481
积分: 9207

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

先把前面两个问题解决再弄第三个问题吧.





离线

楼主 #5 2018-10-10 10:17:52

阿黄
会员
注册时间: 2018-10-03
已发帖子: 299
积分: 134

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

晕哥 wrote:

/files/members/3/QQ20181010082728.png

第一个问题, u-boot-sunxi-with-spl.bin 这个文件 300k 后面的填充了无用的 0xFF.

SPL: Unsupported Boot Device! 这个问题一般出现在 spi flash 启动上面,
如果你用TF卡应该是不会的,
把更详细的log贴出来看下.

log只有下面这些
U-Boot SPL 2018.01-05676-g00188782ee-dirty (May 16 2018 - 17:22:52)
DRAM: 32 MiB
SPL: Unsupported Boot Device!
Trying to boot from sunxi SPI

由于我SPI FLASH里面也有系统,接着就自动从SPI 启动了。我待会

通过对比V4版本的u-boot-spi-flash.bin和u-boot-tf.bin,大段大段的不同,除开填充的部分,本身长度也不一样。
FluxBB bbcode
FluxBB bbcode

我开始尝试直接将编译出来的填充FF使得大小到0xF6000试试。

实在不清楚官方的这个是什么配置编译的,似乎改写了很多?

离线

#6 2018-10-10 10:24:36

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,481
积分: 9207

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

你现在是想从 TF卡,还是flash 启动?
如果TF卡,就先擦除 TF卡吧.





离线

楼主 #7 2018-10-10 10:31:39

阿黄
会员
注册时间: 2018-10-03
已发帖子: 299
积分: 134

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

晕哥 wrote:

你现在是想从 TF卡,还是flash 启动?
如果TF卡,就先擦除 TF卡吧.

我是想从TF启动,而且每次dd烧写固件前,都是执行擦除分区命令的。 难道要低格?

离线

#8 2018-10-10 10:35:23

晕哥
管理员
所在地: wechat: whycan_cn
注册时间: 2017-09-06
已发帖子: 9,481
积分: 9207

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

阿黄 wrote:

晕哥 wrote:

你现在是想从 TF卡,还是flash 启动?
如果TF卡,就先擦除 TF卡吧.

我是想从TF启动,而且每次dd烧写固件前,都是执行擦除分区命令的。 难道要低格?

不用,其他操作都可以不用做,只要用 dd 命令把 u-boot 烧到8k偏移就可以启动 u-boot.

其他可以参考这里:
https://whycan.cn/t_561.html
https://whycan.cn/t_547.html

Bilibili视频分享地址:
https://www.bilibili.com/video/av16458056/





离线

楼主 #9 2018-10-12 00:22:43

阿黄
会员
注册时间: 2018-10-03
已发帖子: 299
积分: 134

Re: 调了几天,特来请教nano编译TF卡用的uboot、zImage的问题,启动报 SPL: Unsupported Boot Device!

更新下,问题1是因为用的配置是 licheepi_nano_spiflash_defconfig ,应该直接用 licheepi_nano_defconfig,
问题2估计哪里配置还是有问题,.config里面没有CONFIG_EARLY_PRINTK相关配置。后来重新git了 git clone --depth=1 -b f1c100s-480272lcd-test https://github.com/Icenowy/linux.git 就没问题了,估计是哪里配置还是不对,先向下搞了

离线

页脚

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

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


东莞哇酷科技有限公司开发