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.

TDA4AL-Q1: Heap-Related Issue on Custom TDA4AL Board with vision apps

Part Number: TDA4AL-Q1

Hi TI Experts,

We've encountered a heap-related problem on our custom TDA4AL board when executing run_app_multi_cam.sh and run_app_single_cam.sh. The issue involves abnormal behavior in the heap's linked list nodes, leading to an infinite loop during performance statistics printing.

Here's the error message:

heap info after run_app_multi_cam.sh


Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(StaticHeap_t *) 0xa2e77434 <gOsalHeapPFreeRtosPool+4>
(gdb) p *heap
$40 = {
xStart = {
pxNextFreeBlock = 0xd90add00 <g_ddr_local_mem+711936>,
xBlockSize = 0
},
pxEnd = 0xd9ffff00 <g_ddr_local_mem+16776960>,
xFreeBytesRemaining = 16065024,
xMinimumEverFreeBytesRemaining = 16065024,
xNumberOfSuccessfulAllocations = 19,
xNumberOfSuccessfulFrees = 0,
xBlockAllocatedBit = 2147483648,
pvHeap = 0xd9000000 <g_ddr_local_mem>,
xTotalHeapSize = 16777216
}
p /x *heap->xStart->pxNextFreeBlock
$45 = {
pxNextFreeBlock = 0x0,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Getting stuck after Print performance statistics: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
HeapBlockLink_t * g_pxBlcok;//Brandon
void vHeapGetHeapStats( StaticHeap_t *heap, HeapMemStats_t * pxHeapStats )
{
HeapBlockLink_t * pxBlock;
size_t xBlocks = 0, xMaxSize = 0, xMinSize = 0xFFFFFFFFu;
{
pxBlock = heap->xStart.pxNextFreeBlock;
/* pxBlock will be NULL if the heap has not been initialised. The heap
* is initialised automatically when the first allocation is made. */
if( pxBlock != NULL )
{
do
{
/* Increment the number of blocks and record the largest block seen
* so far. */
xBlocks++;
if( pxBlock->xBlockSize > xMaxSize )
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Vision apps log:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@j721s2-evm:/opt/vision_apps# ^C
root@j721s2-evm:/opt/vision_apps# source ./vision_apps_init.sh
root@j721s2-evm:/opt/vision_apps# [MCU2_0] 3.855606 s: CIO: Init ... Done !!!
[MCU2_0] 3.855658 s: ### CPU Frequency = 1000000000 Hz
[MCU2_0] 3.855688 s: CPU is running FreeRTOS
[MCU2_0] 3.855709 s: APP: Init ... !!!
[MCU2_0] 3.855728 s: SCICLIENT: Init ... !!!
[MCU2_0] 3.855857 s: SCICLIENT: DMSC FW version [8.6.3--1-g2249f (Chill Capybara]
[MCU2_0] 3.855890 s: SCICLIENT: DMSC FW revision 0x8
[MCU2_0] 3.855917 s: SCICLIENT: DMSC FW ABI revision 3.1
[MCU2_0] 3.855948 s: SCICLIENT: Init ... Done !!!
[MCU2_0] 3.855970 s: UDMA: Init ... !!!
[MCU2_0] 3.856861 s: UDMA: Init ... Done !!!
[MCU2_0] 3.856897 s: UDMA: Init ... !!!
[MCU2_0] 3.857414 s: UDMA: Init for CSITX/CSIRX ... Done !!!
[MCU2_0] 3.857473 s: MEM: Init ... !!!
[MCU2_0] 3.857507 s: MEM: Created heap (DDR_LOCAL_MEM, id=0, flags=0x00000004) @ d9000000 of size 16777216 bytes !!!
[MCU2_0] 3.857567 s: MEM: Created heap (L3_MEM, id=1, flags=0x00000000) @ 60000000 of size 524288 bytes !!!
[MCU2_0] 3.857618 s: MEM: Init ... Done !!!
[MCU2_0] 3.857639 s: IPC: Init ... !!!
[MCU2_0] 3.857685 s: IPC: 5 CPUs participating in IPC !!!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

We've also gathered relevant memory map information:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
R5F_TCMA_VECS 00000000 00000040 00000040 00000000 X
R5F_TCMA 00000040 00007fc0 00000dc0 00007200 X
R5F_TCMB0 41010000 00008000 00000000 00008000 RWIX
MAIN_OCRAM_MCU2_0 60000000 00080000 00080000 00000000 RWIX
r5f-dma-memory a0000000 00100000
r5f-memory a0100000 00f00000
r5f-dma-memory a1000000 00100000
r5f-memory a1100000 00f00000
r5f-dma-memory a2000000 00100000
r5f-memory a2100000 00f00000
r5f-dma-memory a3000000 00100000
r5f-memory a3100000 00f00000
c71-dma-memory a6000000 00100000
c71-memory a6100000 00f00000
c71-dma-memory a7000000 00100000
c71-memory a7100000 00f00000
ipc-memories a8000000 01c00000
vision-apps-r5f-dma-memory a0000000 00100000
vision-apps-r5f-memory a0100000 00f00000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Could you provide guidance on resolving this heap-related problem?

Best regards, 
Brandon

  • SDK Version:

    ti-processor-sdk-rtos-j721s2-evm-08_06_01_03.tar.gz  

    ti-processor-sdk-linux-j721s2-evm-08_06_01_02-Linux-x86-Install.bin

  • Hi,

    The assigned engineer is on a business travel. Please expect a delay of 1~2 days in response.

    Regards,
    Parth

  • Hi Brandon,

    From your application, i see the below logs

    [MCU2_0]    165.421225 s:  max96712_cfgScript
    [MCU2_0]    165.421263 s: Get CSI 0 i2c addr 0@73
    [MCU2_0]    165.421287 s: MAX96712 config start
    [MCU2_0]    165.421464 s: write max96712_cfgScript 1@0x49: 0x08a2=0x00f4 -1
    [MCU2_0]    165.421511 s:  max96712 Error: Reg Write Failed for regAddr 8a2, cnt = 0
    [MCU2_0]    165.421542 s: End of MAX96712 config
    [MCU2_0]    165.421567 s: max96712_cfgScript
    [MCU2_0]    165.421603 s: Get CSI 1 i2c addr 0@107
    [MCU2_0]    165.421625 s: MAX96712 config start
    [MCU2_0]    165.421793 s: write max96712_cfgScript 1@0x6b: 0x08a2=0x00f4 -1
    [MCU2_0]    165.421839 s:  max96712 Error: Reg Write Failed for regAddr 8a2, cnt = 0
    [MCU2_0]    165.421869 s: End of MAX96712 config
    [MCU2_0]    165.421904 s: Error : Failed to start sensor at channel Id 0

    Could you please confirm if you able to smoothly exit the single cam application before executing multicam? is that the scenario where you see a hang in the perf stats?

    Regards,

    Nikhil