Hardware:
Custom OMAP-L137 board
CGT 7.2.5
DSP/BIOS 5.41.09
dsplink 1.63
Linking pre-built c67xmathlib 2.01 FastMath library
We're getting an internal resource conflict exception during runtime that we're trying to understand. It can take anywhere from a few minutes to an hour before an exception occurs, after which the dsp ends up in UTL_halt indefinatley. We've traced the exceptions to two specific lines, but don't see why these would generate the type of exception that we're seeing.
What are the possible sources for a resource conflict exception? Any ideas about why we're seeing this?
Note that we're linking in the FastMath library rather than using the standard RTS.
== DETAILS ==
For some reason, the ROV log that should have the exception trace information only has "null value" in the fields, but by setting a breakpoint at hwi1, we're able to get the relavent exception information:
EFR = 0x2 (internal exception)
IERR = 0x10 (RCX, Resource conflict exception)
From what I understand, B3 is the function return pointer, and NRP is the execution pointer at the time of the interrupt. By following these back, we trace the source to one of two lines from the same function in the c code. Out of 7 runs, the dsp crashed here 4 times:
NRP = 0xC3E13BFC
B3 = 0xC3E13BEC
4616 eml_x_0 = 0.125 * sin(2.0 * eml_x);
0xC3E13BBC: 033DA3E6 LDDW.D2T2 *+SP[13],B7:B6
0xC3E13BC0: 0280A35A MVK.L2 0,B5
0xC3E13BC4: 0297DE8A SET.S2 B5,30,30,B5
0xC3E13BC8: 0200A35A MVK.L2 0,B4
0xC3E13BCC: 01F2AC28 MVK.S1 0xffffe558,A3
0xC3E13BD0: 0210C702 MPYDP.M2 B7:B6,B5:B4,B5:B4
0xC3E13BD4: 01E1F1E8 MVKH.S1 0xc3e30000,A3
0xC3E13BD8: 00008000 NOP 5
0xC3E13BDC: 000C1362 B.S2X A3
0xC3E13BE0: 01834162 ADDKPC.S2 C$RL424 (PC+12 = 0xc3e13bec),B3,2
0xC3E13BE4: 02101FD8 OR.L1X 0,B4,A4
0xC3E13BE8: 02941FD8 OR.L1X 0,B5,A5
C$RL424:
0xC3E13BEC: 0380A358 MVK.L1 0,A7
0xC3E13BF0: 039EDD89 SET.S1 A7,22,29,A7
0xC3E13BF4: 0300A358 || MVK.L1 0,A6
0xC3E13BF8: 02188700 MPYDP.M1 A5:A4,A7:A6,A5:A4
0xC3E13BFC: 00010000 NOP 9
0xC3E13C00: 023E23C4 STDW.D2T1 A5:A4,*+SP[17]
And here 3 times:
NRP = 0xC3E13E10
B3 = 0xC3E13DF8
4638 eml_a[2] = -((cos(2.0 * eml_x) + 1.0) / 2.0 + 0.75);
0xC3E13DC8: 023DA3E6 LDDW.D2T2 *+SP[13],B5:B4
0xC3E13DCC: 0380A35A MVK.L2 0,B7
0xC3E13DD0: 039FDE8A SET.S2 B7,30,30,B7
0xC3E13DD4: 0300A35A MVK.L2 0,B6
0xC3E13DD8: 01F12028 MVK.S1 0xffffe240,A3
0xC3E13DDC: 02188702 MPYDP.M2 B5:B4,B7:B6,B5:B4
0xC3E13DE0: 01E1F1E8 MVKH.S1 0xc3e30000,A3
0xC3E13DE4: 00008000 NOP 5
0xC3E13DE8: 000C1362 B.S2X A3
0xC3E13DEC: 01864162 ADDKPC.S2 C$RL428 (PC+24 = 0xc3e13df8),B3,2
0xC3E13DF0: 02101FD8 OR.L1X 0,B4,A4
0xC3E13DF4: 02941FD8 OR.L1X 0,B5,A5
C$RL428:
0xC3E13DF8: 0380A358 MVK.L1 0,A
0xC3E13DFC: 039E9D89 SET.S1 A7,20,29,A7
0xC3E13E00: 0300A359 || MVK.L1 0,A6
0xC3E13E04: 0302F02A || MVK.S2 0x05e0,B6
0xC3E13E08: 0210C319 ADDDP.L1 A7:A6,A5:A4,A5:A4
0xC3E13E0C: 0361F26A || MVKH.S2 0xc3e40000,B6
0xC3E13E10: 00180362 B.S2 B6
0xC3E13E14: 0280A35A MVK.L2 0,B5
0xC3E13E18: 0297DE8A SET.S2 B5,30,30,B5
0xC3E13E1C: 01892162 ADDKPC.S2 C$RL429 (PC+36 = 0xc3e13e24),B3,1
0xC3E13E20: 0200A35A MVK.L2 0,B4
eml_x, eml_x_0, and eml_a[2] are all doubles. We're using embedded matlab to generate the C code, so the names and style are somewhat strange. In both cases, it looks like the the exception is happening around the sin and cos calls.
The asm sections look like this:
;----------------------------------------------------------------------
; 4616 | eml_x_0 = 0.125 * sin(2.0 * eml_x);
;----------------------------------------------------------------------
LDDW .D2T2 *+SP(104),B7:B6 ; |4616|
ZERO .L2 B5
SET .S2 B5,0x1e,0x1e,B5
ZERO .L2 B4 ; |4616|
MVKL .S1 _sin,A3
MPYDP .M2 B7:B6,B5:B4,B5:B4 ; |4616|
MVKH .S1 _sin,A3
NOP 5
$C$DW$2335 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$2335, DW_AT_low_pc(0x00)
.dwattr $C$DW$2335, DW_AT_name("_sin")
.dwattr $C$DW$2335, DW_AT_TI_call
CALL .S2X A3 ; |4616|
ADDKPC .S2 $C$RL424,B3,2 ; |4616|
MV .L1X B4,A4 ; |4616|
MV .L1X B5,A5 ; |4616|
$C$RL424: ; CALL OCCURS {_sin} {0} ; |4616|
ZERO .L1 A7
SET .S1 A7,0x16,0x1d,A7
|| ZERO .L1 A6 ; |4616|
MPYDP .M1 A5:A4,A7:A6,A5:A4 ; |4616|
NOP 9
STDW .D2T1 A5:A4,*+SP(136) ; |4616|
.dwpsn file "sourcefile.c",line 4617,column 3,is_stmt
;----------------------------------------------------------------------
; 4638 | eml_a[2] = -((cos(2.0 * eml_x) + 1.0) / 2.0 + 0.75);
;----------------------------------------------------------------------
LDDW .D2T2 *+SP(104),B5:B4 ; |4638|
ZERO .L2 B7
SET .S2 B7,0x1e,0x1e,B7
ZERO .L2 B6 ; |4638|
MVKL .S1 _cos,A3
MPYDP .M2 B5:B4,B7:B6,B5:B4 ; |4638|
MVKH .S1 _cos,A3
NOP 5
$C$DW$2339 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$2339, DW_AT_low_pc(0x00)
.dwattr $C$DW$2339, DW_AT_name("_cos")
.dwattr $C$DW$2339, DW_AT_TI_call
CALL .S2X A3 ; |4638|
ADDKPC .S2 $C$RL428,B3,2 ; |4638|
MV .L1X B4,A4 ; |4638|
MV .L1X B5,A5 ; |4638|
$C$RL428: ; CALL OCCURS {_cos} {0} ; |4638|
ZERO .L1 A7
SET .S1 A7,0x14,0x1d,A7
|| ZERO .L1 A6 ; |4638|
|| MVKL .S2 __divd,B6
ADDDP .L1 A7:A6,A5:A4,A5:A4 ; |4638|
|| MVKH .S2 __divd,B6
$C$DW$2340 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$2340, DW_AT_low_pc(0x00)
.dwattr $C$DW$2340, DW_AT_name("__divd")
.dwattr $C$DW$2340, DW_AT_TI_call
CALL .S2 B6 ; |4638|
ZERO .L2 B5
SET .S2 B5,0x1e,0x1e,B5
ADDKPC .S2 $C$RL429,B3,1 ; |4638|
ZERO .L2 B4 ; |4638|
$C$RL429: ; CALL OCCURS {__divd} {0} ; |4638|
ZERO .L1 A7
MVKH .S1 0x3fe80000,A7
|| ZERO .L1 A6 ; |4638|
ADDDP .L1 A7:A6,A5:A4,A5:A4 ; |4638|
ZERO .L2 B4 ; |4638|
SET .S2 B4,31,31,B5 ; |4638|
NOP 5
XOR .L2X A5,B5,B5 ; |4638|
MV .L2X A4,B4 ; |4638|
STDW .D2T2 B5:B4,*+SP(168) ; |4638|
.dwpsn file "sourcefile.c",line 4639,column 8,is_stmt
compiler options: cl6x -g -d"_DEBUG" --no_compress -ss -al -q -pdr -pden -ml3 -mv6740 --disable:sploop
linker options: cl6x -pdr -z -w -i/opt/TI/bios/packages/ti/bios/lib -i/opt/TI/c6000cgt/lib -i/opt/TI/bios/packages/ti/rtdx/lib/c6000 -i/opt/TI/bios/packages/ti/psl/lib -c -q -x -l/opt/TI/c67xmathlib_2_01_00_00/lib/c674xfastMath.lib
ROV shows that the c and task stacks are large enough.
Possible relate issues:
http://e2e.ti.com/support/development_tools/compiler/f/343/t/120757.aspx
http://e2e.ti.com/support/embedded/f/355/p/61925/314208.aspx#314208