Experiencing memory corruption issues when running camera capture on our custom
am5718 board. This board is the alpha version of a custom board our company is
developing using the AM5718 processor. We're using the kernel provided in the
2.00.02 version of the sdk plus a driver for the imagers we're using and the
necessary device tree changes to get it working. Overall the board's design is
fairly similar to the AM572X evm. We're using an Ubuntu 14.04 root filesystem.
Here are the tests we've done to pinpoint the problem and their results followed
by some example runs and their output.
Our board + Ubuntu rfs: Running our camera application + memtester - Failure
Our board + Ubuntu rfs: Running yavta + memtester - Failure
Our board + Ubuntu rfs: Running memtester by itself - Success
Evm + Arago rfs (all files and kernel are unchanged vanilla versions from the ti 2.00.02 sdk)
: Running yavta + memtester - Success
Our board + Arago rfs : Running yavta + memtester - Success
Evm + Kernel for our board + arago linux + normal evm dts
: Running yavta + memtester - Success
Our original theory was that for our board we had somehow missconfigured the
memory / CMA / DMA / video subsystem so that when we tried to use it it was
clobbering the rest of the memory for other applications. The testing with the
Arago filesystem seems to imply that its probably something missing in our
ubuntu root fileystem, some additional configuration needed to get everything
to work. Here is an example run that triggers the problem. On our board + Ubuntu RFS
root@arm:~# ps aux | grep yavta root 1528 0.3 0.1 11756 1088 ? S 17:26 0:00 yavta --capture /dev/video1 root 1601 0.0 0.1 3308 1596 pts/1 S+ 17:29 0:00 grep --color=auto yavta root@arm:~# memtester 512M memtester version 4.3.0 (32-bit) Copyright (C) 2001-2012 Charles Cazabon. Licensed under the GNU General Public License version 2 (only). pagesize is 4096 pagesizemask is 0xfffff000 want 512MB (536870912 bytes) got 512MB (536870912 bytes), trying mlock ...locked. Loop 1: Stuck Address : testing 0FAILURE: possible bad address line at offset 0x19c3a000. Skipping to next test... Random Value : / . . . FAILURE: 0x1deb84cb != 0x00000000 at offset 0x09dd7cd0. FAILURE: 0x12ea8de5 != 0x00000000 at offset 0x09dd7cd4. FAILURE: 0x61e9ceea != 0x00000000 at offset 0x09dd7cd8. FAILURE: 0x4ecf6c79 != 0x00000000 at offset 0x09dd7cdc. FAILURE: 0x0f42e110 != 0x00000000 at offset 0x09dd7ce0. FAILURE: 0xc6d237c2 != 0x00000000 at offset 0x09dd7ce4. FAILURE: 0x11e9b6ab != 0x00000000 at offset 0x09dd7ce8. FAILURE: 0xaec9220d != 0x00000000 at offset 0x09dd7cec. FAILURE: 0x91eb5445 != 0x00000000 at offset 0x09dd7cf0. FAILURE: 0x85c91dbb != 0x00000000 at offset 0x09dd7cf4. FAILURE: 0x8e78e872 != 0x00000000 at offset 0x09dd7cf8. Compare SUB : FAILURE: 0xec9760a2 != 0x00000000 at offset 0x096d57fc. FAILURE: 0xed89df5e != 0x00000000 at offset 0x096d5800. FAILURE: 0xa5fdb3f6 != 0x00000000 at offset 0x096d5804. FAILURE: 0xa9698292 != 0x00000000 at offset 0x096d5808. FAILURE: 0x3bcbae2a != 0x00000000 at offset 0x096d580c. FAILURE: 0x23d82f80 != 0x00000000 at offset 0x096d5810. FAILURE: 0xe18b90da != 0x00000000 at offset 0x096d5814. . . . The theres so many of those failures that it just goes on and on and scrolls the buffer so I cant show where they first start without logging the output. Without yavta or our application which is what we'd normally be running to
interface with the camera the memtester looks much more normal
root@arm:~# pkill yavta root@arm:~# ps aux | grep yavta root 1659 0.0 0.1 3308 1528 pts/1 S+ 17:31 0:00 grep --color=auto yavta root@arm:~# memtester 512M memtester version 4.3.0 (32-bit) Copyright (C) 2001-2012 Charles Cazabon. Licensed under the GNU General Public License version 2 (only). pagesize is 4096 pagesizemask is 0xfffff000 want 512MB (536870912 bytes) got 512MB (536870912 bytes), trying mlock ...locked. Loop 1: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : testing 6
Incase its important this is the current CMA configuration on our kernel 3 # 2 # Default contiguous memory area size: 1 # 1233 CONFIG_CMA_SIZE_MBYTES=128 1 CONFIG_CMA_SIZE_SEL_MBYTES=y 2 # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set 3 # CONFIG_CMA_SIZE_SEL_MIN is not set 4 # CONFIG_CMA_SIZE_SEL_MAX is not set 5 CONFIG_CMA_ALIGNMENT=8