Assigning vector interrupts outside of MQX

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Assigning vector interrupts outside of MQX

619 次查看
MatthewScott_DE
Contributor II

I am running a project that uses a kinetis k60_100 along with MQX because of the need for Ethernet communication and webpage hosting. The main function of the device is to use a setup of ADCs with automatic comparison and hardware triggering of the ADCs and DMA to measure transient and RMS voltages. I am much more comfortable writing this code without the use of the MQX IO subsystem and need to figure out how to assign the vector interrupts for the ADCs to code that I have written.

标记 (2)
1 回复

262 次查看
Martin_
NXP Employee
NXP Employee

Hello,

for MQX managed isr:

(hardware vector table for all MQX managed isrs points to MQX kernel function _int_kernel_isr()). This function invokes user isr by jumping into instruction pointed by "isr_ptr" installed by _int_install_isr():

  _int_install_isr(vector, isr_ptr, isr_data);

  _bsp_int_init(vector, priority, subpriority, enable);

for a user kernel isr (bypasses MQX kernel system):

_int_install_kernel_isr(Vector, isr_ptr);

if vector table is located in RAM; or in case of vector table in flash, you can hook your isr function directly into the vectors.c in BSP source code directory. then:

  _bsp_int_init(vector, priority, subpriority, enable);

see section 3.9 in MQX User's Guide. VERY IMPORTANT:

- priority of MQX managed isr must not be greater than MQX_HARDWARE_INTERRUPT_LEVEL_MAX

- from a user kernel isr the application must not call MQX API.