MQX with IAR and MK66

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

MQX with IAR and MK66

Jump to solution
738 Views
ararat_adamian
Contributor I

Hi, I'm having some trouble getting any of the MQX examples working for the FRDM-K66 board (i.e. i2c_rtos or power_manager_rtos_demo in KSDK_1.3.0\examples\frdmk66f\demo_apps\).

Have any of these examples been tested with IAR/MQX? There is an immediate error when: "OSA_InstallIntHandler(BSP_SYSTIMER_INTERRUPT_VECTOR, HWTIMER_SYS_SystickIsrAction))"

is called from init_bsp.c, because BSP_SYSTIMER_INTERRUPT_VECTOR is -1, and OSA_InstallIntHandler (in int.c) does bounds checking to make sure the vector passed in is between kernel_data->FIRST_USER_ISR_VECTO (which is 0) and kernel_data->LAST_USER_ISR_VECTOR (which is something in the 100s).

I'm trying to work around this issue but am having trouble getting any isr to work... I just end up in the default handler. Does nxp have any working MQX example for IAR I can use for the FRDM-K66 board?

Tags (3)
1 Solution
560 Views
ararat_adamian
Contributor I

For anybody else who has as difficult as a time actually using MQX in IAR with a FRDM-K66F board - the main issue is the IRQ table in MK66F18.h is made to be used with baremetal examples, which call INT_SYS_InstallHandler (this adds 16 to the numbers defined in the enum IRQn). MQX uses a different OS abstraction file which calls _int_install_isr.

If your using MQX, you need to update the IRQ numbers to the vector numbers for the examples to work. To make matters worse, there are functions buried in some of the drivers (I just got done bringing up the USB) that enable the interrupt with the IRQ number, then you need the vector number to set up the handler.

Good luck!

View solution in original post

3 Replies
561 Views
ararat_adamian
Contributor I

For anybody else who has as difficult as a time actually using MQX in IAR with a FRDM-K66F board - the main issue is the IRQ table in MK66F18.h is made to be used with baremetal examples, which call INT_SYS_InstallHandler (this adds 16 to the numbers defined in the enum IRQn). MQX uses a different OS abstraction file which calls _int_install_isr.

If your using MQX, you need to update the IRQ numbers to the vector numbers for the examples to work. To make matters worse, there are functions buried in some of the drivers (I just got done bringing up the USB) that enable the interrupt with the IRQ number, then you need the vector number to set up the handler.

Good luck!

560 Views
danielchen
NXP TechSupport
NXP TechSupport

Yes, this is true for all Kinetis devices in KSDK for MQX.

Regards

Daniel

0 Kudos
560 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi ararat:

I just did a quick check with this vector,  the vector in my side is 15, not -1.   Please check below picture.

int.c   _int_install_isr

pastedImage_1.png

My IAR version is 7.70.  

Regards

Daniel

0 Kudos