AnsweredAssumed Answered

BF561: Crash during initialization of C-runtime

Question asked by Rai on Apr 2, 2014
Latest reply on May 28, 2014 by CraigG

Hi all,

I'm porting VDSP++ project for the BF561 to CCES. The project currently compiles and links fine, but crashes immediately during the initialization of the C-runtime, specifically the heap. Here's the error I get from CCES:

 

A fatal error or exception has occurred.
  Description:   An illegal data memory access has occurred.
  General Type:  RunTimeError
  Specific Type: DCPLBProtectionViolation
  General Code:  0x8
  Specific Code: 0x330
  Error Value:   0xfeb1ebc0
  Error PC:      0xfeb131f2

 

At the point of the RETX register (0xfeb131f2), I find this:

 

adi_osal_HeapInstall:
feb13180:   LINK 0x0 ;
feb13184:   [ -- SP ] = ( R7:4 , P5:5 ) ;
feb13186:   CC = R0 == 0 ;
feb13188:   R6 = R0 ;
feb1318a:   R7 = R1 ;
feb1318c:   SP += -12 ;
feb1318e:   P5.L = 0xebc0 ;
feb13192:   P5.H = 0xfeb1 ;
feb13196:   IF CC JUMP 92 /*0xFEB131F2*/ ;
feb13198:   R5 = -1 ;
feb1319a:   R5 >>= 0x1 ;
feb1319c:   R4 = -11 ;
feb1319e:   R4.H = 32767 ;
feb131a2:   R2 = R5 ;
feb131a4:   R5 += -1 ;
feb131a6:   R1 = R7 ;
feb131a8:   R0 = R6 ;
feb131aa:   CALL __heap_install ;
feb131ae:   CC = R0 == -1 ;
feb131b0:   R1 = R1 - R1 ( NS )  || [ P5 ] = R0  || NOP ;
feb131b8:   IF ! CC JUMP 32 /*0xFEB131D8*/ ;
feb131ba:   CC = R4 < R5 ;
feb131bc:   IF CC JUMP -26 /*0xFEB131A2*/ ( BP ) ;
feb131be:   R0 = [ P5 ] ;
feb131c0:   SP += 12 ;
feb131c2:   P0 = [ FP + 0x4 ] ;
feb131c4:   ( R7:4 , P5:5 ) = [ SP ++ ] ;
feb131c6:   CC = R0 == -1 ;
feb131c8:   R0 = 23 ;
feb131ca:   UNLINK ;
feb131ce:   IF ! CC R0 = R1 ;
feb131d0:   JUMP ( P0 ) ;
feb131d2:   NOP ;
feb131d4:   NOP ;
feb131d6:   NOP ;
feb131d8:   R1 = R1 - R1 ( NS )  || R0 = [ P5 ]  || NOP ;
feb131e0:   SP += 12 ;
feb131e2:   P0 = [ FP + 0x4 ] ;
feb131e4:   ( R7:4 , P5:5 ) = [ SP ++ ] ;
feb131e6:   CC = R0 == -1 ;
feb131e8:   R0 = 23 ;
feb131ea:   UNLINK ;
feb131ee:   IF ! CC R0 = R1 ;
feb131f0:   JUMP ( P0 ) ;
feb131f2:   [ P5 ] = R0 ;
feb131f4:   SP += 12 ;
feb131f6:   P0 = [ FP + 0x4 ] ;
feb131f8:   ( R7:4 , P5:5 ) = [ SP ++ ] ;
feb131fa:   UNLINK ;
feb131fe:   JUMP ( P0 ) ;

 

 

And at the address given as the "Error Value" (0xfeb1ebc0, I don't know which register this comes from), I find this:

_osal_snHeapIndex:
feb1ebc0:   FFFF *illegal opcode*;
feb1ebc2:   FFFF *illegal opcode*;

 

I've seen a similar thing in VDSP before, when the heap would start at an address not divisible by 4. However, as far as I can see, this should not be a problem here. The relevant part of the link map looks like this:

mem_l2_sram.png

 

Any help will be greatly appreciated.

Outcomes