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: MCASP driver is crashed

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

We use MCASP driver in DSP1, then the DSP codes is crashed.

void mcaspAppCallback(void* arg, MCASP_Packet *ioBuf)

{

if(ioBuf->cmd == MCASP_READ)

{

Semaphore_post(semR);

}

 

From interrupt dispatch jump to  assembly codes dispatchCRet1: 

 

In assembly code Hwi_disp_always.s64p:
line 227: mvc b1, IRP
or
line 246: mvc b1, IPR

then jump to C code exit.c\abort()

 

Registers dumping:

[C66xx_DSP1]
EDMA driver initialization successful.
A0=0x0 A1=0x0
A2=0x0 A3=0x4
A4=0x84021c18 A5=0x840c1934
A6=0xbd A7=0xff00
A8=0x801d A9=0x84021864
A10=0x18000a4 A11=0x1800044
A12=0x1800040 A13=0x8403f580
A14=0x840c77f4 A15=0x1
A16=0x200 A17=0x8403d274
A18=0x0 A19=0xd
A20=0x10 A21=0x0
A22=0x18 A23=0xc0
A24=0x40 A25=0x8401fa68
A26=0x8401f9e8 A27=0x8401f868
A28=0xa0 A29=0x84021410
A30=0xf8 A31=0x0
B0=0x40 B1=0x0
B2=0x1 B3=0x840488ac
B4=0x1f B5=0x0
B6=0x0 B7=0x20
B8=0x18000a4 B9=0x1800044
B10=0x840203e0 B11=0x20
B12=0x840203e0 B13=0x20
B14=0x1 B15=0x840cc489
B16=0x840b3b88 B17=0x8404f210
B18=0x84021ec4 B19=0x1e
B20=0x1 B21=0x1
B22=0x8405f744 B23=0x840b3b90
B24=0x1 B25=0x8402f198
B26=0x840b3b18 B27=0x2
B28=0x840cc4fb B29=0x84021410
B30=0x840cc520 B31=0xffef
NTSR=0x840b3b18
ITSR=0x0
IRP=0x0
SSR=0xffffffff
AMR=0xffffffff
RILC=0x0
ILC=0xfffffffe
Exception at 0x0
EFR=0x2 NRP=0x0
Internal exception: IERR=0x1
Instruction fetch exception
ti.sysbios.family.c64p.Exception: line 265: E_exceptionMax: pc = 0x840b3b18, sp = 0x840cc590.
xdc.runtime.Error.raise: terminating execution

  • Hi,

    Is "mcaspAppCallback()" your interrupt service routine (ISR) called by SYSBIOS HWI when interrupt is triggered?

    If yes, ISR function can only have one argument.

    Please refer to SYSBIOS API reference guide for the prototype as shown below.

    typedef Void (*FuncPtr)(UArg);

    You can find the below example code in the API reference guide as well. In the line where the argument is set, you will replace it with "ioBuf" pointer.

      #include <xdc/runtime/Error.h>
      #include <ti/sysbios/hal/Hwi.h>
      
      Hwi_Handle myHwi;
      
      Int main(Int argc, char* argv[])
      {
          Hwi_Params hwiParams;
          Error_Block eb;
       
          Hwi_Params_init(&hwiParams);
          Error_init(&eb);
      
          // set the argument you want passed to your ISR function
          hwiParams.arg = 1;        
       
          // set the event id of the peripheral assigned to this interrupt
          hwiParams.eventId = 10;   
       
          // don't allow this interrupt to nest itself
          hwiParams.maskSetting = Hwi_MaskingOption_SELF;
       
          // 
          // Configure interrupt 5 to invoke "myIsr".
          // Automatically enables interrupt 5 by default
          // set params.enableInt = FALSE if you want to control
          // when the interrupt is enabled using Hwi_enableInterrupt()
          //
       
          myHwi = Hwi_create(5, myIsr, &hwiParams, &eb);
       
          if (Error_check(&eb)) {
              // handle the error
          }
      }
       
      Void myIsr(UArg arg)
      {
          // here when interrupt #5 goes off
      }

    Regards,
    Stanley