This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] SK-TDA4VM:如何从 OSPI 闪存引导

Guru**** 2328790 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1522002/sk-tda4vm-how-to-boot-from-ospi-flash

器件型号:SK-TDA4VM

工具/软件:

您好、

我创建了一个最小映像(tisdk-tiny-image)并将其转换为 UBIFS 映像、该映像可以成功从 OSPI 闪存引导。

sf probe
fatload mmc 1 ${loadaddr} tiboot3.bin
sf update ${loadaddr} 0x0 0x${filesize}
fatload mmc 1 ${loadaddr} tispl.bin
sf update ${loadaddr} 0x80000 0x${filesize}
fatload mmc 1 ${loadaddr} u-boot.img
sf update ${loadaddr} 0x280000 0x${filesize}
fatload mmc 1 ${loadaddr} sysfw.itb
sf update ${loadaddr} 0x6C0000 0x${filesize}

但是、在尝试加载根文件系统时、U-Boot 始终报告错误。
请按照下面概述的步骤操作。

mkfs.ubifs -r rootfs -m 16 -e 256KiB -c 256 -o rootfs.ubifs

cat > rootfs.ubi.cfg <<EOF
[rootfs]
mode=ubi
image=rootfs.ubifs
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
EOF

ubinize -o ubi.img -m 16 -p 256KiB -s 16 rootfs.ubi.cfg

我将映像刷写到 OSPI 闪存中。

flash_erase /dev/mtd6 0 0
ubiformat /dev/mtd6 -f ubi.img
ubiattach /dev/ubi_ctrl -m 6 <- Failed

root@j721e-sk:~# ubiattach /dev/ubi_ctrl -m 6
[  787.820510] ubi0: attaching mtd6
[  787.832703] ubi0: scanning is finished
[  787.836458] ubi0 error: ubi_read_volume_table: the layout volume was not found
[  787.843703] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd6, error -22
ubiattach: error!: cannot attach mtd6
           error 22 (Invalid argument)

mount -t ubifs ubi0:rootfs /mnt

因此、我重新引导至 U-Boot、并尝试手动加载根文件系统。

=> sf probe
k3-navss-ringacc ringacc@2b800000: Ring Accelerator probed rings:286, gp-rings[96,20] sci-dev-id:235
k3-navss-ringacc ringacc@2b800000: dma-ring-reset-quirk: disabled
jedec_spi_nor flash@0: non-uniform erase sector maps are not supported yet.
SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
=> sf erase 0x800000 0x37c0000
SF: 58458112 bytes @ 0x800000 Erased: OK
=> fatload mmc 1 ${loadaddr} ubi.img
43778048 bytes read in 997 ms (41.9 MiB/s)
=> sf write ${loadaddr} 0x800000 ${filesize}
device 0 offset 0x800000, size 0x29c0000
SF: 43778048 bytes @ 0x800000 Written: OK
=> ubi part ospi.rootfs
ubi0: attaching mtd7
ubi0: scanning is finished
ubi0: volume 0 ("rootfs") re-sized from 165 to 219 LEBs
ubi0: attached mtd7 (name "ospi.rootfs", size 55 MiB)
ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1
ubi0: VID header offset: 64 (aligned 64), data offset: 128
ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 676530700
ubi0: available PEBs: 0, total reserved PEBs: 223, PEBs reserved for bad PEB handling: 0
jedec_spi_nor flash@0: flash operation timed out
ubi0 error: nor_erase_prepare: cannot invalidate PEB 0, write returned -110
ubi0: dumping 262144 bytes of data from PEB 0, offset 0
ubi0 error: erase_worker: failed to erase PEB 0, error -5
ubi0 error: erase_worker: bad physical eraseblock 0 detected
ubi0 warning: ubi_ro_mode: switch to read-only mode
ubi0 error: do_work: work failed with error code -5
ubi0 error: ubi_do_worker: ubi_bgt0d: work failed with error code -5
ubi0 error: ubi_io_sync_erase: read-only mode
ubi0 error: erase_worker: failed to erase PEB 1, error -30
ubi0 error: do_work: work failed with error code -30
ubi0 error: ubi_do_worker: ubi_bgt0d: work failed with error code -30

您对解决问题有什么建议吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    让我尝试一下、然后回到您的身边。

    此致、
    Tanmay