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.

Legacy project crashes when built with CCS 5.3

Other Parts Discussed in Thread: SYSBIOS

Hi

I have a legacy project that was developed using CCS 5.1 and Code Generation Tools 7.2.4.  The target is a TCI6618 DSP and we use SYSBIOS 6.

When I build this project with CCS 5.2 or 5.3 the application crashes.  The crash happens when a function returns that is called from main(), i.e. before any tasks are created.  Here is the console output:

A0=0x0 A1=0x30002a80
A2=0x15000000 A3=0x0
A4=0x1844004 A5=0x0
A6=0x400 A7=0x30
A8=0x1 A9=0x1844018
A10=0x81bb04 A11=0x81bb00
A12=0x8f3700 A13=0x513d28
A14=0x8f34ac A15=0x8f3680
A16=0x80 A17=0x30002a80
A18=0x400 A19=0x30002800
A20=0x81ba34 A21=0x81ba38
A22=0x81ba28 A23=0x81ba30
A24=0x0 A25=0x0
A26=0xc0 A27=0x81ba2c
A28=0x0 A29=0x81ba54
A30=0x34 A31=0x893dd8
B0=0x0 B1=0x50100
B2=0x855dd4 B3=0x0
B4=0x1 B5=0x4
B6=0x30003a80 B7=0x2640100
B8=0x1000 B9=0x1000
B10=0x8404032 B11=0x2020000b
B12=0xa0352024 B13=0xc01804
B14=0x894f68 B15=0x8952f4
B16=0x3521c000 B17=0x5
B18=0x30002b80 B19=0x3521a000
B20=0x4900c13a B21=0x6842
B22=0x24204008 B23=0x4050
B24=0xe890192 B25=0x40aed4f1
B26=0x40020900 B27=0x8c2
B28=0x400401 B29=0x2600045
B30=0x810021ac B31=0x3fff
NTSR=0x0
ITSR=0x1000c
IRP=0x8100246c
SSR=0x0
AMR=0x0
RILC=0x0
ILC=0x0
Exception at 0x8100246c
EFR=0x2 NRP=0x8100246c
Internal exception: IERR=0x8
Opcode exception
ti.sysbios.family.c64p.Exception: line 248: E_exceptionMin: pc = 0x8100246c, sp = 0x008952f4.
xdc.runtime.Error.raise: terminating execution

I don't know how to determine the reason for the crash.  Could it be simply that the stack space is too small?  Does the console output tell you anything that I am missing?  I would appreciate some advice for how to fix this please.

Best regards

David

  • David,

    In the register dump the value for the B3 register is zero, so I expect that function that was called in main() somehow cleared the B3 register, and then the return branch on the B3 register tried to branch to zero, which resulted in the internal exception.  

    Can you single step that function in CCS, before the exception is triggered, to see why the B3 register is getting zeroed?

    Scott

  • Hi Scott

    Thanks for your reply.  I tried stepping through the function that was called from main() as you suggested.  When I reach the end of the function register B3 has a non-zero value.  When I then click 'Step Return' (F7) I get the exception.

    If I click 'Assembly Step Into' instead of 'Step return' the debugger steps into code that is located in the next memory locations but is not the logical flow of code (which would be the return statement), i.e it steps into another function which is not the returned to function.  This is very odd and I don't understand the debugger behaviour.

    I wonder if it is relevant that the code is located by a pragma:

    #pragma CODE_SECTION( IpDomainFactory_InitIpDomain,".ipddr2pmem" );

    I am not the author of this code so I don't know why that pragma is required.

    Do you have any other suggestions please?

    Best regards

    David

  • Hi David,

    It is just a wild guess… but from the “.ipddr2pmem” code section mention it got me wondering if the DDR2 memory might not be properly initialized.  Maybe with the move to CCS 5.3 there is a change in a GEL file, so the DDR2 timing might not be set up properly?  Can you try placing the function in an on-chip memory region and see if anything changes?  Again this is just a wild guess…

    If that doesn’t change anything can you take a snapshot of the assembly code shown before and after the “B B3” return at the end of that function?

    Also, do you know if this IpDomainFactory_InitIpDomain() function is written in C or assembly?  And if there might be any special constraints or preconditions to calling it?

    Thanks,
    Scott

  • Hi Scott

    That was a good guess.  I replaced evmc6670l.gel supplied with CCS5.3 with that supplied with CCS5.1 and the code ran without failure under CCS5.3.  There seems to be some degradation in this gel file.

    Thanks very much for your help.

    Best regards

    David