Installing a SVC handler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Installing a SVC handler

885 Views
MarkoPanger
Contributor III

Hi,

 

I'm using KSDK 1.1.0 and I'm trying to use my custom defined SVC handler.

 

According to the start up file the SVC_Handler is defined as weak and defining a C function with the same name should overwrite it. This seems not to be the case as I'm ending in the defaultISR handler when invoking a svc instruction.

 

Any idea how to install a SVC handler ?

 

Thanks, Marko

Labels (1)
0 Kudos
1 Reply

563 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Marko,

I think you can define the SVC_Handle() api function directly in the file with main() function, after you define the SVC_Handle() api function, the weak default ISR def_irq_handler will be replaced automatically.

I tried to call the SVC, I can enter the SVC_Handle() ISR.

BR

XiangJun Rong

#define SVC

int main (void)

{

    // RX buffers

    //! @param receiveBuff Buffer used to hold received data

    uint8_t receiveBuff;

    // Initialize standard SDK demo application pins

    hardware_init();

    // Call this function to initialize the console UART. This function

    // enables the use of STDIO functions (printf, scanf, etc.)

    dbg_uart_init();

#ifdef SVC

    SVC_Handler();

#endif

   

    // Print the initial banner

    PRINTF("\r\nHello World!\n\n\r");

}

#ifdef SVC

//Rong write

void SVCCall(void)

{

    __asm("SVC #2");

}

//Rong write

void  SVC_Handler(void)

{

    __asm("nop");

}

#endif