cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable interrupt without OSAL and HAL component

Hank Im
Associate II
Posted on August 10, 2017 at 10:54

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!
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
3 REPLIES 3
Erwan YVIN
ST Employee
Posted on August 11, 2017 at 10:36

Hello ,

I do not see your ivor.s of your project

Anyway , you can use our ivor.s like inspiration

you have to create a sort of prolog to create the stack frame (Save the context)

and an epilog (Restore the context)

Best regards

Erwan

________________

Attachments :

ivor.s : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyWM&d=%2Fa%2F0X0000000b8y%2F1i8GmT10YAId6zh.BqyRwDTxTpbwCgpXHtLcvuK0K.8&asPdf=false
Posted on August 16, 2017 at 02:49

Hello!

Thank you for your reply.

I attached ivor.s file and my vector file

ivor.s file is copy from SPC5 studio.

Could you provide me example code about the interrupt enable that don't using OSAL and HAL component with my vector table?

Posted on August 22, 2017 at 11:20

Hello Hank ,

We have no example on SPC5Studio (without OSAL (HAL))

you have to create your project from scratch 

RLA could be a good compromise for you.

         Best regards

                           Erwan