您尚未登录。

楼主 #1 2019-10-31 20:01:14

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

V3s SPI NAND u-boot @openwrt

您好所有赢家的策划者!

我在寻找此方式来编译u-boot时找到了这个论坛,我的V3可以直接从SPI-NAND引导。
我设法从SPI-NOR启动主线u-boot 2019.01,但不适用于SPI-NAND。 V3s BROM甚至不会启动u-boot SPL。

我已经找到了该视频 https://www.youtube.com/watch?v=IIbRWTCTslw ,但是所有链接都已消失。
我知道V3可以从此SPI-NAND进行引导,因为它在该nand上随附了boot0,boot1和一些u-boot 2011,并且可以引导。

我是否需要一些特殊的配置或其他补丁?

非常感谢!

您可以用中文回答,我将通过翻译进行:)

English:


Hello allwinner masterminds!

I found this forum while searching for a way to compile u-boot in such a way, that my V3s can boot directly from SPI-NAND.
I managed to boot mainline u-boot 2019.01 from SPI-NOR but it does not work with SPI-NAND. The V3s BROM does not even start the u-boot SPL.

I've found this video https://www.youtube.com/watch?v=IIbRWTCTslw but all links are dead.
I know the V3s can boot from this SPI-NAND because it was shipped with boot0, boot1 and some u-boot 2011 on this nand and it boots.

Do I need some special config or additional patches?

Many thanks!

You can answer in chinese, I will run it through a translator smile

离线

楼主 #3 2019-10-31 20:46:26

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

哦,所以我必须将spl块化为1k件? 非常感谢,将尝试!

Oh, so I have to chunk the spl to 1k pieces? Thank you very much, will try!

离线

楼主 #6 2019-10-31 22:33:45

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Thank you very much for the tipp with the 1k-chunked SPL! I wrote a script to chunk the spl for me and now the SPL comes up fine!

非常感谢您提供1k的SPL技巧! 我编写了一个脚本来为我分块spl,现在SPL正常了!

离线

楼主 #9 2019-11-01 03:33:17

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

晕哥 说:

可以分享你的脚本和烧录过程吗?

一旦设法使SPL和u-boot都运行,我将写一个不错的摘要。 不幸的是,我出差直到星期一。 但是,我保证我会尽快与您联系!

离线

楼主 #13 2019-11-02 14:37:50

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Im currently writing an SPL to load u-boot from spi-nand. Already made some great progress. My 1k-page chunking script for the SPL works fine, too. I hope I can finish my work on monday or tuesday. Then I will make my patches and scripts public and try to get it to mainstream.

我目前正在编写SPL以从spi-nand加载u-boot。 已经取得了很大的进步。 我的SPL 1k页分块脚本也可以正常工作。 我希望我能在星期一或星期二完成工作。 然后,我将公开我的补丁程序和脚本,并尝试使其成为主流。

离线

楼主 #15 2019-11-04 23:58:45

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Quick update: The spi-nand SPL works fine and loads u-boot perfectly. Im working on booting to linux tomorrow. Should be very easy and pretty straight forward.
I'll keep you updated.

快速更新:spi-nand SPL 工作正常,完美加载u-boot。 我正在明天启动到linux。 应该很容易和非常直截了当。
我会及时通知你

离线

楼主 #16 2019-11-06 20:57:19

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Success!
I finally booted everything from spi-nand.
My fork of openwrt (still a bit messy and not cleaned up) contains all changes: https://github.com/bhorn/openwrt/tree/dolphinpi-spinand
The SPL-chunking-script is embedded in the mach-sunxi generation process https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/target/linux/sunxi/image/gen_sunxi_spinand_img.sh and OpenWRT creates a ready-to-use image file to burn to the spi-nand.
The spi-nand-spl loader is located at https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/package/boot/uboot-sunxi/src/arch/arm/mach-sunxi/spl_spinand_sunxi.c and targets u-boot-2019.10
My development-board is the DolphinPi so just search for dolphinpi and you will find all other configs and customization done. If I can find some time the next days I will try to write an elaborate blog post with "how-to" compile everything correctly.
Don't hesitate to ask questions if you need help building or flashing. I just boot the board from SD and then burn the image with
gzip -cd /root/openwrt-[...]-squashfs.img.gz | mtd write - /dev/mtd0
When mtd0 is the whole spi-nand in one partition.

成功!
我终于从spi-nand引导了一切。
我的分叉openwrt(仍然有点凌乱,没有清理)包含所有更改:https://github.com/bhorn/openwrt/tree/dolphinpi-spinand
SPL-chunking-脚本嵌入在mach-sunxi生成过程中https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/target/linux/sunxi/image/gen_sunxi_spinand_img.sh 和OpenWRT创建一个随时可用的图像文件刻录到spi-nand。
Spi-nand-spl装载机位于https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/package/boot/uboot-sunxi/src/arch/arm/mach-sunxi/spl_spinand_sunxi.c 和目标u-boot-2019.10
我的开发板是DolphinPi,所以只需搜索dolphinpi,你会发现所有其他配置和定制完成。 如果我能在接下来的几天找到一些时间,我会尝试写一篇精心制作的博客文章,其中包含"how-to"正确编译所有内容。
如果您需要帮助建立或闪烁,请不要犹豫,提出问题。 我只是从SD启动主板,然后刻录图像
gzip-cd/root/openwrt-[...-squashfs.img。gz|mtd写入-/dev/mtd0
当mtd0是整个spi-nand在一个分区。

离线

楼主 #19 2019-11-06 22:29:53

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

@xgui

Like every other OpenWRT, clone the repo,

git clone https://github.com/bhorn/openwrt
cd openwrt
git checkout dolphinpi-spinand

run

make menuconfig

make sure your config targets the V3s and the "Dolphin Pi":

  │ │                             Target System (Allwinner A1x/A20/A3x/R40/V3s)  --->
  │ │                             Subtarget (Allwinner A20/A3x/R40/V3s)  --->
  │ │                             Target Profile (Petit-Miner Dolphin Pi)  --->

The devicetree of the dolpinpi
also activate

> Base System > mtd
> Kernel modules > SPI Support > kmod-spi-dev 

then run

make

one file shoud appear:

bin/targets/sunxi/cortexa7/openwrt-snapshot-r11418-9eef37be78-sunxi-cortexa7-sun8i-v3s-dolphinpi-squashfs-spinand.img.gz

Now you need an sd-card image for your V3s that can access the spi-nand. To build an image capable of burning to spi-nand, look at the next post.

Then copy the spinand.img.gz to the V3s file-system of the sd-card (e.g. to /root/spinand.img.gz) and boot the V3s from the sd-card.
Now you can run

gzip -cd /root/spinand.img.gz | mtd write - /dev/mtd0

Now you have burned the spinand image to the spi-nand and should be able to boot from it.

最近编辑记录 bamkrsde (2019-11-06 23:29:34)

离线

楼主 #20 2019-11-06 23:28:18

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Hey,

I updated the repository. I added an generic V3s device image that will boot from sd-card and can access the spi-nand for burning purposes (warning: output is on uart2!)
The ready-to-use-config is available in the repository, too: https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/sdwithspinandaccess.config

git clone https://github.com/bhorn/openwrt
cd openwrt
git checkout dolphinpi-spinand
cp sdwithspinandaccess.config .config
make menuconfig
# no need to change anything, just save and exit
make
# Image is located in bin/targets/sunxi/cortexa7/openwrt-snapshot-[...]-sunxi-cortexa7-sun8i-v3s-rawspinandaccessuart2-ext4-sdcard.img.gz

Build this image and burn it to the sd-card. With this sd-card you can run the command to burn the image like in the previous post.


To change uart2 to uart0 change:
* CONFIG_CONS_INDEX=3 to CONFIG_CONS_INDEX=0 in GenericV3sBoard_SPINAND_UART2_defconfig
* serial2 = &uart2; to serial2 = &uart0; in sun8i-v4s-rawspinandaccessuart2.dts (both u-boot and kernel)

最近编辑记录 bamkrsde (2019-11-06 23:37:45)

离线

楼主 #25 2019-11-07 17:24:34

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

我思故我在 说:

@bamkrsde 感谢分享!我看你用的是海豚派(dolphinpi)的V3s开发板, 请问板上的ESP8089驱动了吗?是不是用这个开发板做WIFI中继?

I havent tested it yet but it should be pretty straight forward.

https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/net/wireless/esp,esp8089.txt

I will try to implement it and will update the repository accordingly.

离线

楼主 #29 2019-11-07 21:22:18

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

I checked the datasheet. The GD5F1GQ4UCYIG is not compatible with the SPL. It uses a different cache-addressing scheme. Unfortunatly I won't be able to implement support for other chips currently. I have ordered some other SPI-NAND chips. When they arrive, I'll refactor the driver to easily implement other chips.
The next chip I'll implement to the SPL is the W25N01GV. However, this won't be until next week when the chips arrive.
For your error

[    1.131309] spi-nand spi0.0: unknown raw ID e458a464
[    1.137088] spi-nand: probe of spi0.0 failed with error -524

I don't know what this error means. Its something out of my scope, seems to be a problem with the linux-kernel mtd-driver.

最近编辑记录 bamkrsde (2019-11-07 21:42:46)

离线

楼主 #30 2019-11-07 21:34:25

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

我思故我在 说:

@bamkrsde 感谢分享!我看你用的是海豚派(dolphinpi)的V3s开发板, 请问板上的ESP8089驱动了吗?是不是用这个开发板做WIFI中继?

So there is no driver for the ESP8089 in mainline. The one driver I found won't compile. Sorry I don't have any more time to further dig down to this sad
However, I updated the devicetree to implement some more DolphinPi components. I also added the ESP8089 to the Devicetree. So it should be running if you manage to compile a kernel smile

离线

楼主 #35 2019-11-07 23:34:58

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:
U-Boot SPL 2019.10 (Nov 06 2019 - 15:22:33 +0000)
DRAM: 64 MiB
Trying to boot from sunxi SPI-NAND
sunxi SPI-NAND: Unknown chip aaef
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Great that you managed to burn the image! Thats the expected output smile
As I said, I will start refactoring the driver next week when my new spi-nand-chips arrive. My plan is to generalize the driver thus adding new chips is very easy to do. I will try to implement the GD5F1GQ4UCYIG, too. It seems like its just a matter of bit shifting for the address calculation.

When the chip is supported (just the mx35lf1ge atm) it will look something like this:

U-Boot SPL 2019.10 (Nov 07 2019 - 13:32:46 +0000)
DRAM: 64 MiB
Trying to boot from sunxi SPI-NAND
sunxi SPI-NAND: Found 1Gb Macronix MX35LF1GE4AB (12c2)


U-Boot 2019.10 (Nov 07 2019 - 13:32:46 +0000) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Dolphin Pi
DRAM:  64 MiB
MMC:   mmc@01c0f000: 0
In:    serial@01c28800
Out:   serial@01c28800
Err:   serial@01c28800
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Macronix SPI NAND was found.
128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
Reading 4194304 byte(s) (2048 page(s)) at offset 0x00110000
Reading 65536 byte(s) (32 page(s)) at offset 0x00100000
## Booting kernel from Legacy Image at 41000000 ...
   Image Name:   ARM OpenWrt Linux-4.19.81
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3045768 Bytes = 2.9 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Kernel Image
   Loading Device Tree to 42dfa000, end 42dff97e ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.81 (bam@bamdevsrv) (gcc version 8.3.0 (OpenWrt GCC 8.3.0 r11277-99e21ac05a)) #0 SMP PREEMPT Thu Nov 7 13:32:46 2019

...

[    1.144587] spi-nand spi0.0: Macronix SPI NAND was found.
[    1.150031] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    1.159658] 4 fixed-partitions partitions found on MTD device spi0.0
[    1.166472] Creating 4 MTD partitions on "spi0.0":
[    1.171304] 0x000000000000-0x000000100000 : "u-boot"
[    1.180135] 0x000000100000-0x000000110000 : "dtb"
[    1.187830] 0x000000110000-0x000000510000 : "kernel"
[    1.205698] 0x000000510000-0x000008000000 : "rootfs"
[    1.405708] mtd: device 3 (rootfs) set to be root filesystem

...

最近编辑记录 bamkrsde (2019-11-07 23:38:53)

离线

楼主 #39 2019-11-08 15:10:41

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:

还有一个问题我没有明白, 在 Linux driver 里面已经支持了市面上所有spi nand 芯片, 为什么你的固件只支持 mx35lf1ge 这一个呢?

shaoxi2010 说:

你们频率配的多少哦,这个问题我遇到过,一般是没焊好,降频应该是没问题的

That might be possible! We have a very clean layout on the DolphinPi layout. 100mhz SPI clock is no problem here. But you may need to tweak the clock for you board! Maybe tweak https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/target/linux/sunxi/files-4.19/arch/arm/boot/dts/sun8i-v3s-rawspinandaccessuart2.dts#L111 down to 50mhz or 24mhz. egon is working with 6mhz and the SPL is working with 24mhz. Looking at you output, 24mhz seems to work fine for you. You could try that!

离线

楼主 #42 2019-11-08 22:18:58

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

shaoxi2010 说:

这个问题我之前在群上问过大佬,现象和你的是一样的,经过我测试到最高频率只能设置到75M,高于这个就玩蛋,用的芒果派。
改的华邦的SPI NAND。

xgui 说:

有道理,SPI 时钟频率是有可能的,怪不得 SPI NAND 的芯片 ID与datasheet有点相似.

Hey! I updated the repository! I already refactored the SPI-NAND-SPL to accept new chips and also added support for generic chips with a page size of 2K. I also added the support for W25N01 and GD5F1GQ4UCYIG, but wasn't able to test it.
So W25N01, GD5F1GQ4UCYIG and other chips with 2k page size should work now! @xgui it would be very nice of you if you could test those chips if you have any. My W25N01 won't arrive till next week...

I also clocked down the SPI clock for the SD-Card image to 50mhz. Thus more sketchy layouts should be no problem!

最近编辑记录 bamkrsde (2019-11-08 22:19:09)

离线

楼主 #48 2019-11-10 00:49:34

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:
[    6.977190] mount_root: Could not open mtd device: /dev/mtd3
[    6.982987] mount_root: reading rootfs failed
[    6.987684] mount_root: mounting /dev/root
...

second board log:

[    1.421965] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.429716] Please append a correct "root=" boot option; here are the available partitions:

请问是我这种烧录方法不对吗?

First board: There seems to be something wrong with the ext4-fs image. I've never tested ext4. I don't know if its a general problem, bug or board-problem.

Second board: There seems to be the kernel-commandline missing. Try aborting u-boots start and run
(i hope i remember correctly)

env set bootargs "root=/dev/mtd3"
env save
boot

离线

楼主 #49 2019-11-10 00:55:33

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:

我克隆了最新的代码,编译,烧录到 w25n01, 发现spl 已经识别,但是u-boot还是无法启动:

unknown raw ID 43d60da0
MTD device spi-nand0 not found, ret -19
unknown raw ID 43d60d68
MTD device spi-nand0 not found, ret -19
Wrong Image Format for bootm command
ERROR: can't get kernel image!
=>

Is this the DolphinPi image? I only changed the MHZ for the generic sd-card config. Still seems to be the clock since the w25n01 correctly responds to the SPL which is running with 24mhz.
Change this https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/target/linux/sunxi/files-4.19/arch/arm/boot/dts/sun8i-v3s-dolphinpi.dts#L171 to 60mhz and try again smile If it still wont work, try 24mhz.
But I'm a bit worried that the mx35 runs fine with ~100mhz but the w25n01 not. The w25n01 is the only spi-nand we can get at reasonable prices here in germany...

离线

楼主 #50 2019-11-10 00:57:03

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:

写入MX35LF1GE4AB 成功,但是校验失败(verified error).

[    1.692454] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.700263] Please append a correct "root=" boot option; here are the available partitions:
[    1.708928] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Its the kernel-commandline problem from #48

最近编辑记录 bamkrsde (2019-11-10 00:57:16)

离线

楼主 #53 2019-11-11 17:38:57

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:

... 接着,继续按楼上的操作, 烧录: openwrt-sunxi-cortexa7-sun8i-v3s-dolphinpi-squashfs-spinand.img

芯片是: W25N01

U-Boot SPL 2019.10 (Nov 06 2019 - 15:22:33 +0000)
DRAM: 64 MiB
Trying to boot from sunxi SPI-NAND
sunxi SPI-NAND: Unknown chip aaef
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

直接出错了.

Thats the output of the old SPL which does not support other chips. Please use the updated version you used in #51

最近编辑记录 bamkrsde (2019-11-11 17:39:10)

离线

楼主 #55 2019-11-11 20:26:46

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:
[    1.709119] squashfs: SQUASHFS error: unable to read inode lookup table
[    1.721311] F2FS-fs (mtdblock3): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    1.728794] F2FS-fs (mtdblock3): Can't find valid F2FS filesystem in 1th superblock
...

Hm, I don't know why your squashfs isn't found.
However, I received my W25N01 chips and already soldered one on.

unknown raw ID 43d60da0
MTD device spi-nand0 not found, ret -19
unknown raw ID 43d60d68
MTD device spi-nand0 not found, ret -19

I get the same error. I will dig down on this.

离线

楼主 #56 2019-11-11 21:55:15

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

unknown raw ID 43d60da0
MTD device spi-nand0 not found, ret -19
unknown raw ID 43d60d68
MTD device spi-nand0 not found, ret -19

It was a bug in u-boot! I thought the u-boot spi-nand is in the same state as the linux spi-nand state. But I was wrong. The u-boot spi-nand winbond-implementation missed the W25N01 (however it embedded the W25M02 which is basically two W25N01 in one package). I updated the repo to include the W25N01.

离线

楼主 #67 2019-11-14 00:26:45

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Hey @all,

first of all sorry for being inactive at the moment, I worked hard to implement UBI and UBIFS for SPI-NAND (since the other fs did not work properly) and here it is.
I updated the repository once more, now everything works fine with an UBI image.
The UBI contains the dtb, kernel, u-boot-env and a UBIFS-rootfs thus we have a proper wear-leveling for all relevant parts. It takes some time to boot but this is an OK trade for a reliable filesystem.

However I think the sd-card-image is broken, at least I havent tested it on this version.

离线

楼主 #69 2019-11-14 14:55:13

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

xgui 说:

Hey bamkrsde, 我刚刚重新git pull,编译,发现bin/targets/sunxi/cortexa7这个目录并没有生成UBI相关的文件,是我的操作有错误吗?我第一次使用openwrt, 请多多指教。

The image should now be in bin/targets/sunxi/openwrt-snapshot-r(git-revision)-sunxi-cortexa7-v3s-sun8i-v3s-dolphinpi-ubifs-ubispinand.img.gz. Thats a side effect of the refactoring I did in the sunxi-target Makefiles. Sorry I forgot to mention that!

The UBI is tweaked to a 128KiB block-size and 2048 page-size spi-nand. So all prior mentioned chips should run perfectly.
If not, this can be tweaked with make menuconfig in images (or something like that).

还有, 你说
实际上我并没有使用sd card image了,都是使用 spi nand image.

I have to fix it either way some time because I need it for development reasons. But its not my priority .

离线

楼主 #71 2019-11-14 16:59:53

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Use the new spinand.config (cp spinand.config .config; make menuconfig)! The Targets changed! The make menuconfig should look like:

Target Systems (Allwinner A1x/A20/A3x/R48/V3s)
Subtarget (Allwinner V3s)
Target Profile (Petit-Miner Dolphin Pi)

离线

楼主 #73 2019-11-14 18:33:08

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Hey @xgui: I found a little bug that u-boot is not correctly build after the refactoring (it used an old one the whole time!) I fixed that.
So please run

git pull
cp spinand.config .config

again before building so you get a working newly-build u-boot.
And the Image was moved again (sorry! its all work in progress) this time to bin/targets/sunxi/cortexa7v3sspinand/openwrt-snapshot-r(git-revision)-sunxi-cortexa7v3sspinand-sun8i-v3s-dolphinpi-ubifs-ubispinand.img.gz

离线

楼主 #75 2019-11-15 22:32:47

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Again, you have a timing problem.
Again, alter https://github.com/bhorn/openwrt/blob/dolphinpi-spinand/target/linux/sunxi/files-4.19/arch/arm/boot/dts/sun8i-v3s-dolphinpi.dts#L159 to a lower and suitable mhz (i.e. 24mhz)

离线

楼主 #77 2019-11-18 15:23:57

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Did you completly erase the spi-nand before writing to it? It looks like you didn't. Please read the UBI/UBIFS manuals.

离线

楼主 #83 2019-12-05 05:54:27

bamkrsde
会员
注册时间: 2019-10-31
已发帖子: 29
积分: 29

Re: V3s SPI NAND u-boot @openwrt

Sorry for not replying earlier. Please understand that I can only help you with generic problems. I wasn't able to tell you how you are able to erase your spi-nand because I don't know what tools and workflow you are using.

xgui 说:

终于启动, 泪水都快流出来了。


现在还是百思不得其解, 为什么一定要用 mtd erase ubi0 这个擦除命令呢?明明我用win32diskimager校验是正确的!

Its a bit difficult to explain. I'll try to make it as simple as possible.

Ubi stores some meta-data at every physical erase block (PEB). For example, your spi-nand has a PEB-size of 128K and a page-size of 2K.
The first 2 pages of each PEB is used to store metadata (erase-cycle-count and other data).
At every start, the ubi-driver iterates over all PEBs and tries to read the meta-data.
When you write your image to the spi-nand, all data is stored in the front of the spi-nand. After your image there is the free space to use that isn't touched while writing your image.
When the ubi-driver iterates over this free space, it sees some garbage meta-data, complains about it and throws an error.
Thus you have to delete the free space entirely so ubi actually identifies it as free space and not as used data-blocks with garbage meta-data.

I hope this explanation was good enough to understand the ubi-problem.

离线

页脚

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

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