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.

AM5728 Code Restart with SPLOOP

Other Parts Discussed in Thread: AM5728

I am running a project on AM5728 DSP core, TI-RTOS, Compiler 8.1.0, PDK 1.0.2, Sys/Bios 6.45.1.29, XDC 3.32.0.06.

I am calling Memory_calloc with a very large size.  When I do the code restart at the entry point.  No exception, just seems to jump to the entry point and start to run again.

I've traced it down to the SPLOOP in the memset function called from Memory_valloc.

The calling sequence would look like this:

Memory_calloc() -> Memory_valloc() -> Memory_alloc() -> memset().  All from xcdtools_3_32_00_06_core\packages\xdc\runtime\Memory.c

When you look in memset.c (ccsv6\tools\compiler\ti-cgt-c6000_8.1.0\lib\src\memset.c) you will see the loop:

for (i = 0; i < len >> 4; i++)

{

_amemd8(dst1) = dfill1; dst1 += 16;

_amemd8(dst2) = dfill2; dst2 += 16;

post_bytes -= 16;

}

This is implemented in assembly as

841faf40:   00038001            SPLOOP        1
841faf44:   0210145A ||         DADD.L2X        0,A5:A4,B5:B4
78                    _amemd8(dst1) = dfill1; dst1 += 16;
          $C$L2:
841faf48:   2CE6                SPMASK        L2
841faf4a:   FB71     ||         ADD.L1        A0,A0,A0
841faf4c:   020C5745 ||         STDW.D1T1     A5:A4,*A3++[2]
841faf50:   3D45     ||         STDW.D2T2     B5:B4,*B6++[2]
841faf52:   1C67                ADD.L1        A0,A0,A0

When that loop is long, memset is clearing 9,953,280 bytes or 622080 loops, this problem occurs, the code just jumps back to the entry point.

Since the alloc was successful, there is no reason the memset should overwrite any data or anything, so the best I can figure is the processor is stuck in the SPLOOP too long and something bad happens.  But I don't know what or how to tell since no exception occurs. 

I tried to disable interrupts around the Memory_calloc call, but that did not seem to help.

Any ideas on where to go from here?