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.

Help:Stack, registers dump during Exception

HI,

I am using BIOS 5.4 over TI DSP 6487 and got stuck while developing a crash handler for any generated exception.

I have following queries:-

1) Does DSP-BIOS provide any API which can be used to detect the HWI StackBottom value?

2) How can I access the Core General Purpose Bank Registers in order to create dump in C ?

3) If any exception occurs, the context of interrupted task got saved on HWI Stack; is it true?

I have already enabled the EXC module of BIOS and able to generate exception using asm(" SWE"); call.

Also using "EXC_Status EXC_getLastStatus(Void);" api I can able to dump Exception related registers value.

please help.

Thanks

Akash Bhatnagar

  • Akash,

    Some replies to your questions below...

    Scott

    ----------

    1) No, there isn’t an API to query for the address of the bottom of the HWI stack.  

    2) To access the general purpose registers you’ll need to call an assembly routine that does the direct register access.  But you can use the compiler’s “cregister” keyword to access control registers.

    3) Yes, the exception context is pushed to the bottom of the HWI stack.

    Yes, you can call EXC_getLastStatus() to get the EFR, NRP, NTSR, and IERR register values.

    Have you seen the EXC sources that ship with DSP/BIOS?  For example, at: C:\ti\bios_5_41_12_40\packages\ti\bios\src\exc 

    These should be a good starting point for you.  For example, even though there is no API to query the stack bottom, you can see how EXC does it in the file exc_asm.s64P:

    <snip>
            mvd     a1, a1
    ||      mvkl    _HWI_data, a1
            mvkh    _HWI_data, a1
            ldw     *a1(HWI_DataObj.stkBottom), b15
            nop     3                       ; original A1 lands during NOPs
            mvd     b15, a1                 ; juggle original SP, catch in A1
            stdw    a1:a0, *b15--[1]        ; save original A1 & A0
            stdw    a3:a2, *b15--[1]
    ...

  • HI Scott,

    Thanks for that, I am manage to take a dump of stack, taking HWI_DataObj.stkBottom in a local variable; and then dump in a loop using a decrement operator.