AnsweredAssumed Answered

How to enable interrupt without OSAL and HAL component

Question asked by Hank Im on Aug 10, 2017
Latest reply on Aug 22, 2017 by Erwan Y

Hello!

I made new project only using SPC560Bxx Platform Component in SPC5 studio.
When I add OSAL component, Interrupt does work well.
At present, I am trying to enable interrupt without OSAL and any HAL component. But it doesn't work.
How do I enable interrupt without the OSAL and any HAL component?

Note :  ivor.s copy my project folder.

 

My code is as below.

[Vector.c]

const dword u32_IsrVectorTable_SW_Table[] =
{
    ( dword )&Cpu_Interrupt, ( dword )&Cpu_Interrupt, /* ISRs 000 - 001 */
      ...
      ( dword )&STM_Ch0_ISR, ( dword )&Cpu_Interrupt, /* ISRs 030 - 031 */

      ...

      ( dword )&ADC_Ch0_ISR, ( dword )&Cpu_Interrupt, /* ISRs 062 - 063 */

       ...

}

[main.c]

void INTC_Init ( void )
{
 INTC.MCR.R = 0;
 INTC.CPR.R = 0;
 INTC.IACKR.R = ( dword )&u32_IsrVectorTable_SW_Table[ 0 ];

 return;
}

int main ( void )
{

   ...

    INTC_Init();

    asm("wrteei 1");
    for(;;)
    {
     ....
    }

    return ( ERR_OK );
}


Thank you!

Attachments

Outcomes