页次: 1
我在闲鱼掏了一块板子,没有资料,拆开看了看主控是F1C200SFlash是mx35lf1GE4AB这是一块nand flash,我在网上看到芒果派r3也是用的nand flash于是就找到了相关的sdk就是这个 buildroot-mangopi-r根据里边的说明成功编译但是烧录进去后报错:
烧录教程是这个wiki.dfrobot.com.cn烧录过程没有报错,应该是没有问题.
设备树也改了把uboot和kernel的norflash相关的都注释了.
串口打印日志如下:
U-Boot SPL 2020.07 (Jul 20 2024 - 20:54:39 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from MMC2
Card did not respond to voltage select!
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
然后就卡死了,有没有人也遇到过这个问题能指导一下.
uboot设备树
路径.\buildroot-mangopi-r\board\widora\mangopi\r3\devicetree\uboot
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
status = "okay";
// spi-nor@0 {
// #address-cells = <1>;
// #size-cells = <1>;
// reg = <0>;
// compatible = "winbond,w25q128", "jedec,spi-nor";
// spi-max-frequency = <50000000>;
// status = "disabled";
// };
spi-nand@1 {
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
compatible = "spi-nand";
spi-max-frequency = <50000000>;
status = "okay";
};
};
路径:.\opt\buildroot-mangopi-r\board\widora\mangopi\r3\devicetree\linux
内核设备树
&spi0 {
status = "okay";
// spi-nor@0 {
// #address-cells = <1>;
// #size-cells = <1>;
// compatible = "winbond,w25q128", "jedec,spi-nor";
// reg = <0>;
// spi-max-frequency = <50000000>;
// status = "disabled";
//
// partitions {
// compatible = "fixed-partitions";
// #address-cells = <1>;
// #size-cells = <1>;
//
// partition@0 {
// label = "u-boot";
// reg = <0x000000 0x70000>;
// read-only;
// };
//
// partition@1 {
// label = "kernel";
// reg = <0x70000 0x590000>;
// read-only;
// };
//
// partition@2 {
// label = "rom";
// reg = <0x600000 0x700000>;
// read-only;
// };
//
// partition@3 {
// label = "overlay";
// reg = <0xd00000 0x300000>;
// };
// };
// };
//
spi-nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <50000000>;
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x100000>;
read-only;
};
partition@1 {
label = "kernel";
reg = <0x100000 0x500000>;
read-only;
};
partition@2 {
label = "rom";
reg = <0x600000 0x2a00000>;
read-only;
};
partition@3 {
label = "vendor";
reg = <0x3000000 0x1000000>;
};
partition@4 {
label = "overlay";
reg = <0x4000000 0x3000000>;
};
};
};
};
问题解决了,原来是Page size设置错了,一不小心多打了一个0导致编译的sunxi-spl-with-ecc.bin体积大了很多.....
应该是上位机的不同命令决定的吧
我也遇到了这个问题,按照厂家的配置,结果显示会有条纹出现,换了一块还是 应该是配置问题
闲鱼掏了一块板子 主控是用的全志A13 不能插TF卡,只有板载的NandFlash型号是H27UBG8T2BTR查到了规格书是4G的,原来上边的系统跑的是Tina Linux,后来自己提取了设备树,想着自己刷一个u-boot,结果烧录了以后不能启动,串口没有输出.u-boot版本是sunxi哪个论坛下载的 分支是nano-v2018.01,烧录方法就是先用sunxi-tools工具把相应bin加载到内存然后启动
sudo sunxi-fel spl spl/sunxi-spl.bin
sudo sunxi-fel write 0x4a000000 u-boot-dtb.bin
sudo sunxi-fel write 0x43000000 spl/sunxi-spl-with-ecc.bin
sudo sunxi-fel exe 0x4a000000
使用工具可以启动进入uboot打印日志如下:
U-Boot SPL 2018.01-05679-g013ca457fd-dirty (Jan 10 2024 - 11:04:07)
DRAM: 512 MiB
Failed to set core voltage! Can't set CPU frequency
Trying to boot from FEL
U-Boot 2018.01-05679-g013ca457fd-dirty (Jan 10 2024 - 11:04:07 +0800) Allwinner Technology
CPU: Allwinner A13 (SUN5I)
Model: YCDL Xiaobai
I2C: ready
DRAM: 512 MiB
NAND: 4096 MiB
In: serial
Out: serial
Err: serial
Allwinner mUSB OTG (Peripheral)
Net: eth0: usb_ether
Hit any key to stop autoboot: 0
hello boy
=>
使用nand相关命令可以看到NandFlash的相关信息
=> nand info
Device 0: nand0, sector size 2048 KiB
Page size 8192 b
OOB size 640 b
Erase size 2097152 b
subpagesize 8192 b
options 0x40007200
bbt options 0x00070000
=> mtd
device nand0 <sunxi-nand.0>, # parts = 4
#: name size offset mask_flags
0: spl 0x00200000 0x00000000 0
1: uboot-env 0x00200000 0x00200000 0
2: uboot 0x00200000 0x00400000 0
3: UBI 0xffa00000 0x00600000 0
先擦除再写入
=> nand erase.part spl
NAND erase.part: device 0 offset 0x0, size 0x200000
Erasing at 0x0 -- 100% complete.
OK
=> nand write.raw.noverify 0x43000000 0x0 20
NAND write: 282624 bytes written: OK
=>
根据NandFlash的规格书,一页是8K,bin文件大小是132k所以写16页就够了,这里我写了20页
- Page size : (8K+640spare)bytes
- Block size : (2048K+160K)bytes
- Plane size : 1024blocks
- Device size : 2048blocks
按道理讲这不就是已经把spl写入了nand了吗,可是重启以后控制台没有输出,直接进入fel模式了.有没有大佬能指点一下,小白一个很多东西都不懂.....
下面是我修改过的文件
1.添加了一条内容在uboot/drivers/mtd/nand/nand_ids.c
{"H27UBG8T2BTR-BC 32G 3.3V 8-bit",
{ .id = {0xad, 0xd7, 0x94, 0xda, 0x74, 0xc3} },
SZ_8K, SZ_4K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640, NAND_ECC_INFO(40, SZ_1K), 0 },
2.设备树的nfc节点内容主要是修改了nand-ecc-strength nand-ecc-step-size
&nfc {
pinctrl-names = "default";
pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>;
status = "okay";
nand@0 {
#address-cells = <2>;
#size-cells = <2>;
reg = <0>;
allwinner,rb = <0>;
nand-ecc-mode = "hw";
nand-on-flash-bbt;
onfi,nand-timing-mode = <0x1f>;
nand-ecc-strength = <40>;
nand-ecc-step-size = <1024>;
partitions {
compatible = "fixed-partitions";
#address-cells = <2>;
#size-cells = <2>;
partition@0 {
label = "spl";
reg = <0x0 0x0 0x0 0x200000>;
};
partition@200000 {
label = "uboot-env";
reg = <0x0 0x200000 0x0 0x200000>;
};
partition@400000 {
label = "uboot";
reg = <0x0 0x400000 0x0 0x200000>;
};
partition@600000 {
label = "UBI";
reg = <0x0 0x600000 0x1 0xff000000>;
};
};
};
};
我查了一下感觉问题可能是出在ecc校验的环节 但是不知道怎么改....
这一波我支持司徒大佬
页次: 1