Interrupt handling with KSDK and Kinetis Design Studio

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

Interrupt handling with KSDK and Kinetis Design Studio

Interrupt handling with KSDK and Kinetis Design Studio

Hello KSDK community:

 

The Kinetis Software Development Kit is intended to ease evaluation, prototyping and development with Kinetis MCUs. Apart from the Peripheral Drivers, HAL layer, System Services, RTOS abstraction and software stacks, KSDK implements a robust hardware interrupt mechanism.

 

The attached document is intended to explain the interrupt handling mechanism of KSDK platform and how to use it for baremetal KSDK or "MQX for KSDK" projects. Some of the topics covered are:

 

>> Interrupt manager

>> Installing vector table in Flash or RAM

>> Interrupt priorities

>> Peripheral IRQ files (fsl_<peripheral>_irq.c)

>> Installing, defining or registering ISRs

>> Callbacks

>> MQX hardware interrupts system

>> Interrupts and callbacks with Processor Expert

 

The last chapter explains the considerations of interrupt handling when using Kinetis Design Studio in 4 different cases:

 

1) KSDK baremetal project

2) KSDK baremetal + Processor Expert project

3) MQX for KSDK project

4) MQX for KSDK + Processor Expert project

 

I hope this document is useful for all of you who have already adopted KSDK as development solution.

 

 

/*** UPDATE July 1, 2015 ***/

 

Document updated for KSDK v1.2 and KDS v3.0.0

 

 

Regards!

Jorge Gonzalez

Labels (1)
Attachments
Comments

Jorge, this is great information!  Thanks a bunch for writing it up and sharing it here.

Yes thank you for this! I just attempted to add a couple of pin interrupts using INT_SYS_InstallHandler on a platform running MQX which did not work. I found this post and found that I should be using OSA_InstallHandler and now it works.

Is this still relevant for KSDK v1.3?

Hello Luciano:

Yes, the document is still valid, just pay attention to the KSDK installation path (v1.3 instead of v1.2) whenever mentioned.

Regards!

Jorge Gonzalez

Hi,

I tried to add UART1 Rx interrupt based on Section 4.2 in your document using KL25Z Freedom board. However, if I follow to uncheck "Vector table copy in RAM", my program hang at HW initi. Do I necessary to follow that step? If I check, my interrupt was not triggered. Is it supposed to be also? I may missed some important steps.

Thanks,

Bryan

Hello Kyui Zaw Win:

It is optional to copy or not the vectors to RAM. Usual reasons to copy vectors in RAM:

- Faster access to vectors in RAM than in Flash.

- Updating a vector in runtime.

You should not have any issues either way. Are you using MQX? If then you need to check the Install interrupt option for every module.

Regards!
Jorge Gonzalez

Hello Jorge,

First of all congratulation for this great document! Is this valid also with KSDK 2.0? I'm asking that because this version has changed a lot compared to KSDK 1.3.0.

Thanks a lot

Drugo

Hello Drugo Drughi,

Thank you for your feedback.

Actually the KSDK v2.0 uses a different interrupt handling technique, so this document does not apply completely. There is a brief about interrupt handling in the KSDK v2.0 API Reference Manual, included in the KSDK package or in the web:

http://www.nxp.com/files/soft_dev_tools/doc/support_info/KSDK20APIRM.pdf 

You can also take a look to the example projects to see how interrupts are treated.

Regards!

Jorge Gonzalez

Thanks so much Jorge, this is actually the only way  I am following to understand how interrupt handling works in KSDK 2.0.

If you or a colleague of your could write a document about interrupt as good as the one you wrote (attached to this webpage, it would be really great for NXP community :-)

Thanks again

Drugo

Hello Jorge Gonzalez,

I'm trying to handle my WDOG interrupts with KSDK2.0 in KDS3.2 using Freertos, but even declaring everything just like the example of ADC16_Interrupt it won't capture the interruption. As my colleague said, it would be great if there's a document "about interrupt as good as the one you wrote".

Thank you for your time.

Best Regards

Gustavo Costa

No ratings
Version history
Last update:
‎03-25-2015 03:17 PM
Updated by: