How to generate software interrupts and what about CMSIS?

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

How to generate software interrupts and what about CMSIS?

Jump to solution
1,355 Views
zeal
Contributor II

Hi, I need to generate software interrupts and I'm using the K60 twr board.

I have previously done like this:

 

#include "MK60N512MD100.h"
#include "core_cm4.h"

 

NVIC_EnableIRQ((IRQn_Type) 94); //Enable Software interrupts

 

NVIC->STIR = 94; //Genarate the interrupt. 

 

 

How do I do this when using MQX?, the problem is that the include files conflicts with the MQX libraries.

 

0 Kudos
1 Solution
597 Views
c0170
Senior Contributor III

Hi zeal,

 

#include <mqx.h>
#include <bsp.h>

 

those 2 headers you have to include for MQX  (check examples) then board header (MK60DZ10.h) is included too.

Use bsp_int_init instead of your function NVIC_Enable_IRQ.

 

Regards,

MartinK

View solution in original post

0 Kudos
2 Replies
598 Views
c0170
Senior Contributor III

Hi zeal,

 

#include <mqx.h>
#include <bsp.h>

 

those 2 headers you have to include for MQX  (check examples) then board header (MK60DZ10.h) is included too.

Use bsp_int_init instead of your function NVIC_Enable_IRQ.

 

Regards,

MartinK

0 Kudos
597 Views
zeal
Contributor II

Thank you Kojto, I got it to work.

 

#include "mqx.h"

#include "bsp.h"


_int_install_isr(110, latency_isr, ptr);
_bsp_int_init(110, 64, 0, TRUE);

 

Then NVICSTIR = 94; generates the interrupt.

 

Thanks again.

0 Kudos