Part Number: SK-AM62
Hello,
I'm using the default image of PROCESSOR-SDK-LINUX-RT-AM62X 09.00.00.03 (tisdk-default-image-am62xx-evm) on the SK-AM62.
I tried to access the OSPI flash using UBIFS following this URL.
root@am62xx-evm:~# modprobe ubi root@am62xx-evm:~# cat /proc/mtd dev: size erasesize name mtd0: 00080000 00040000 "ospi.tiboot3" mtd1: 00200000 00040000 "ospi.tispl" mtd2: 00400000 00040000 "ospi.u-boot" mtd3: 00040000 00040000 "ospi.env" mtd4: 00040000 00040000 "ospi.env.backup" mtd5: 037c0000 00040000 "ospi.rootfs" mtd6: 00040000 00040000 "ospi.phypattern" root@am62xx-evm:~# ubiformat /dev/mtd5 ubiformat: mtd5 (nor), size 58458112 bytes (55.7 MiB), 223 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 16 bytes libscan: scanning eraseblock 222 -- 100 % complete ubiformat: 223 eraseblocks have valid erase counter, mean value is 3 ubiformat: formatting eraseblock 222 -- 100 % complete root@am62xx-evm:~# ubiattach -p /dev/mtd5 [ 418.477433] ubi0: attaching mtd5 [ 418.499562] ubi0: scanning is finished UBI device number 0, total 223 LEBs (58429568 bytes, 55.7 MiB), [ 418.518764] ubi0: attached mtd5 (name "ospi.rootfs", size 55 MiB) available 219 LEBs (57381504 bytes, 54.7 MiB), LEB size 262016 b[ 418.518786] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes ytes (255.8 KiB) [ 418.518792] ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16 [ 418.518797] ubi0: VID header offset: 64 (aligned 64), data offset: 128 [ 418.518803] ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0 [ 418.518807] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128 root@am62xx-evm:~# [ 418.518813] ubi0: max/mean erase counter: 8/4, WL threshold: 4096, image sequence number: 1799411425 [ 418.518820] ubi0: available PEBs: 219, total reserved PEBs: 4, PEBs reserved for bad PEB handling: 0 [ 418.518858] ubi0: background thread "ubi_bgt0d" started, PID 1914 root@am62xx-evm:~# ubimkvol /dev/ubi0 -N flash_fs -s 20MiB Volume ID 0, size 81 LEBs (21223296 bytes, 20.2 MiB), LEB size 262016 bytes (255.8 KiB), dynamic, name "flash_fs", alignment 1 root@am62xx-evm:~# mkdir /mnt/flash root@am62xx-evm:~# mount -t ubifs ubi0:flash_fs /mnt/flash/ [ 450.767895] UBIFS (ubi0:0): default file-system created [ 450.769598] UBIFS (ubi0:0): Mounting in unauthenticated mode [ 450.769824] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1996 root@am62xx-evm:~# [ 451.082991] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "flash_fs" [ 451.083015] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes [ 451.083023] UBIFS (ubi0:0): FS size: 18603136 bytes (17 MiB, 71 LEBs), max 81 LEBs, journal size 2096129 bytes (1 MiB, 6 LEBs) [ 451.083033] UBIFS (ubi0:0): reserved for root: 878671 bytes (858 KiB) [ 451.083039] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID BF07F616-C65F-42E2-A365-846BA321768B, small LPT model
Then, the below error occurs when I executed the ls command right after the first file is created.
There seems to be no problem with subsequent accesses.
root@am62xx-evm:~# cd /mnt/flash/ root@am62xx-evm:/mnt/flash# ls -al total 4 drwxr-xr-x 2 root root 160 Jan 1 00:07 . drwxr-xr-x 3 root root 4096 Jan 1 00:05 .. root@am62xx-evm:/mnt/flash# echo hello > hello.txt root@am62xx-evm:/mnt/flash# ls -al total 4 [ 488.459521] UBIFS error (ubi0:0 pid 2076): ubifs_read_node [ubifs]: bad node type (255 but expected 2) drwxr-xr-x 2 root root 232 Jan 1 00:08 . [ 488.459605] UBIFS error (ubi0:0 pid 2076): ubifs_read_node [ubifs]: bad node at LEB 11:160, LEB mapping status 1 [ 488.459642] Not a node, first 24 bytes: drwxr-xr-x 3 root root 4096 Jan 1 00:05 ..[ 488.459649] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........................ [ 488.459659] CPU: 1 PID: 2076 Comm: ls Tainted: G O 6.1.33-rt11-g685e771524 #1 [ 488.459667] Hardware name: Texas Instruments AM625 SK (DT) [ 488.459672] Call trace: [ 488.459676] dump_backtrace.part.0+0xdc/0xf0 [ 488.459697] show_stack+0x18/0x30 [ 488.459704] dump_stack_lvl+0x68/0x84 [ 488.459715] dump_stack+0x18/0x34 [ 488.459721] ubifs_read_node+0x234/0x260 [ubifs] root@am62xx-evm:/mnt/flash# [ 488.459753] ubifs_read_node_wbuf+0xbc/0x2b0 [ubifs] [ 488.459785] ubifs_tnc_read_node+0x48/0xbc [ubifs] [ 488.459816] tnc_read_hashed_node+0xb0/0x1e4 [ubifs] [ 488.459847] ubifs_tnc_next_ent+0x190/0x1e0 [ubifs] [ 488.459877] ubifs_readdir+0x2d4/0x390 [ubifs] [ 488.459908] iterate_dir+0x168/0x1b4 [ 488.459919] __arm64_sys_getdents64+0x68/0x150 [ 488.459927] invoke_syscall+0x48/0x114 [ 488.459936] el0_svc_common.constprop.0+0xd4/0xfc [ 488.459944] do_el0_svc+0x30/0xd0 [ 488.459951] el0_svc+0x2c/0x84 [ 488.459958] el0t_64_sync_handler+0xbc/0x140 [ 488.459965] el0t_64_sync+0x18c/0x190 [ 488.459975] UBIFS error (ubi0:0 pid 2076): ubifs_readdir [ubifs]: cannot find next direntry, error -22 root@am62xx-evm:/mnt/flash# echo $? 0 root@am62xx-evm:/mnt/flash# ls -al total 8 drwxr-xr-x 2 root root 232 Jan 1 00:08 . drwxr-xr-x 3 root root 4096 Jan 1 00:05 .. -rw-r--r-- 1 root root 6 Jan 1 00:08 hello.txt root@am62xx-evm:/mnt/flash# cat hello.txt hello root@am62xx-evm:/mnt/flash# echo world >> hello.txt root@am62xx-evm:/mnt/flash# ls -al total 8 drwxr-xr-x 2 root root 232 Jan 1 00:08 . drwxr-xr-x 3 root root 4096 Jan 1 00:05 .. -rw-r--r-- 1 root root 12 Jan 1 00:24 hello.txt root@am62xx-evm:/mnt/flash# cat hello.txt hello world
Do you know why this error occurs?
Regards,
Numata