Other Parts Discussed in Thread: AM68A
Tool/software:
Hello
I have a custom board with AM68A chip and a custom built Yocto image that is based on the one provided by TI. I am now in the process of movement the build from Processor SDK of version 8.6 to the newest version 10.1. I am using U-boot of version 2023.04 with the ti-linux-firmware of version 10.01.06 (also tried with 10.00.08 and result is the same) and Linux kernel 6.6.32 on an HS-FS device, and am experiencing a problem that when I try to use anything of vision_apps, it mostly doesn't work as expected.
For example, when I run vx_app_arm_mem.out, it just hangs after the following output:
APP: Init ... !!!
3224.738012 s: MEM: Init ... !!!
3224.738298 s: MEM: Initialized DMA HEAP (fd=5) !!!
3224.738465 s: MEM: Init ... Done !!!
3224.738488 s: IPC: Init ... !!!
3224.776023 s: IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
3224.784637 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
When I run it with strace, the last lines are as follows:
write(1, "APP: Init ... Done !!!\n", 23APP: Init ... Done !!!
) = 23
ioctl(5, DMA_HEAP_IOCTL_ALLOC, 0xfffffb2a44a8) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_SHARED, 23, 0) = 0xffff70c8d000
openat(AT_FDCWD, "/dev/remoteproc0", O_RDONLY|O_CLOEXEC) = 24
ioctl(24, _IOC(_IOC_READ|_IOC_WRITE, 0xb7, 0, 0x10), 0xfffffb2a4460) = ?
At the same time, the following message is displayed in dmesg:
[ 3248.253908] Unable to handle kernel paging request at virtual address ffff0008800b0000
[ 3248.261899] Mem abort info:
[ 3248.264708] ESR = 0x0000000096000145
[ 3248.268472] EC = 0x25: DABT (current EL), IL = 32 bits
[ 3248.273794] SET = 0, FnV = 0
[ 3248.276853] EA = 0, S1PTW = 0
[ 3248.279994] FSC = 0x05: level 1 translation fault
[ 3248.284877] Data abort info:
[ 3248.287752] ISV = 0, ISS = 0x00000145, ISS2 = 0x00000000
[ 3248.293235] CM = 1, WnR = 1, TnD = 0, TagAccess = 0
[ 3248.298276] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 3248.303581] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000082ff6000
[ 3248.310271] [ffff0008800b0000] pgd=18000008ffff8003, p4d=18000008ffff8003, pud=0000000000000000
[ 3248.318963] Internal error: Oops: 0000000096000145 [#8] PREEMPT SMP
[ 3248.325214] Modules linked in: xt_conntrack xt_MASQUERADE iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c xt_addrtype iptable_filter ip_tables x_tables br_netfilter bridge overlay cfg80211 rfkill 8021q garp mrp stp llc r8153_ecm cdc_ether usbnet r8152 mii rpmsg_ctrl rpmsg_char cdns_csi2rx cdns3 cdns_usb_common crct10dif_ce pwm_fan wave5 j721e_csi2rx at24 k3_j72xx_bandgap arducam(O) videobuf2_dma_contig v4l2_mem2mem videobuf2_memops v4l2_fwnode videobuf2_v4l2 videobuf2_common v4l2_async videodev ti_k3_dsp_remoteproc ti_k3_r5_remoteproc mc sa2ul rtc_rv3028 cdns3_ti pwm_tiehrpwm cdns_dphy_rx rti_wdt fuse drm drm_panel_orientation_quirks backlight ipv6
[ 3248.384701] CPU: 1 PID: 8457 Comm: vx_app_arm_mem. Tainted: G D W O 6.6.32-01389-g186e9c935e32 #1
[ 3248.394591] Hardware name: ... (DT)
[ 3248.399021] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 3248.405963] pc : dcache_clean_poc+0x20/0x38
[ 3248.410141] lr : arch_sync_dma_for_device+0x24/0x30
[ 3248.415004] sp : ffff800097e43bd0
[ 3248.418305] x29: ffff800097e43bd0 x28: 00000009000b0000 x27: 0000000000020000
[ 3248.425424] x26: ffff00082f66c5a0 x25: ffff00082da17838 x24: 0000000000000000
[ 3248.432542] x23: fffffc0000000000 x22: ffff800080f843c0 x21: 0000000000000000
[ 3248.439660] x20: 0000000000000001 x19: 0000000000000000 x18: 0000000000000000
[ 3248.446778] x17: 3461326266666666 x16: 667830202c293031 x15: 0000fffffb2a4460
[ 3248.453896] x14: 627830202c455449 x13: 0000000000000090 x12: 0000000000000000
[ 3248.461014] x11: 0000000000000000 x10: 00000000000009a0 x9 : ffff8000813c6968
[ 3248.468132] x8 : ffff00082f66c5c0 x7 : 0000000000000002 x6 : 0000000000000000
[ 3248.475249] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 000000000000003f
[ 3248.482367] x2 : 0000000000000040 x1 : ffff0008800d0000 x0 : ffff0008800b0000
[ 3248.489486] Call trace:
[ 3248.491921] dcache_clean_poc+0x20/0x38
[ 3248.495745] dma_direct_map_sg+0x280/0x2e4
[ 3248.499829] __dma_map_sg_attrs+0x28/0x94
[ 3248.503825] dma_map_sg_attrs+0x10/0x24
[ 3248.507647] dma_heap_map_dma_buf+0x40/0x5c
[ 3248.511818] __map_dma_buf+0x2c/0xa0
[ 3248.515383] dma_buf_map_attachment+0x9c/0x108
[ 3248.519812] rproc_attach_dmabuf+0xcc/0x1b4
[ 3248.523984] rproc_device_ioctl+0x124/0x2b4
[ 3248.528154] __arm64_sys_ioctl+0xac/0xf0
[ 3248.532065] invoke_syscall+0x48/0x114
[ 3248.535803] el0_svc_common.constprop.0+0xc0/0xe0
[ 3248.540492] do_el0_svc+0x1c/0x28
[ 3248.543794] el0_svc+0x2c/0x84
[ 3248.546839] el0t_64_sync_handler+0x120/0x12c
[ 3248.551182] el0t_64_sync+0x190/0x194
[ 3248.554834] Code: d2800082 9ac32042 d1000443 8a230000 (d50b7a20)
[ 3248.560909] ---[ end trace 0000000000000000 ]---
For a test, I tried using the image for an HS-FS device, provided by TI (the .wic one for j721s2-EVM) and completely replacing the U-boot there with the custom built one, and on that device all the vision_apps work as expected without any errors. I am using the same kernel with modules and devicetree and have verified that all the TI libraries needed by vision_apps are of exactly same version, as well as the firmware in /lib/firmware (I may have missed something important, however). Moreover, the output of vx_app_heap_stats.out and vx_app_arm_remote_log.out is identical on both devices (up to timestamps), indicating that all the remote processors started successfully.
I would be grateful for any hints on what can be causing the problem on the HS-FS device with custom yocto build and how to fix it