setup interrupts KDS

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

setup interrupts KDS

跳至解决方案
1,914 次查看
mjg8t
Contributor IV

Hi There,

 

I am switching over to using KDS.  I am trying to figure out how user interrupt vectors are supposed to be setup in KDS.  In codewarrior there was the kinetis_sysinit.c file where the user interrupts could be define.  But, the structure seems to have changed in KDS. 

 

Can someone point me to any documentation on how KDS should be properly setup? 

 

It appears that maybe vectors are defined in the "startup_MK20D5.s" file and I would just need to define my intertupt vector in user code with the same names here?

 

Are there any project examples for KDS?

 

snippet of "startup_MK20D5.S" code

 

    .section .isr_vector, "a"

    .align 2

    .globl __isr_vector

__isr_vector:

...

    .long   DMA0_IRQHandler                                 /* DMA channel 0 transfer complete interrupt*/

    .long   DMA1_IRQHandler                                 /* DMA channel 1 transfer complete interrupt*/

    .long   DMA2_IRQHandler                                 /* DMA channel 2 transfer complete interrupt*/

    .long   DMA3_IRQHandler                                 /* DMA channel 3 transfer complete interrupt*/

    .long   DMA_Error_IRQHandler                            /* DMA error interrupt*/

...

 

Thanks.

标签 (1)
0 项奖励
回复
1 解答
883 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello M J:

You are correct, vectors are defined in the startup_xxx.S file, then you only have to declare your Interrupt Service Routine (ISR) with the same name as in that file, or change it if you wish. Apart from this everything is the same as in CW, enabling the peripheral interrupt and the NVIC manager. For the NVIC you count with some helpful files in the "Includes" folder:

- core_cm0plus.h

- core_cm4.h

- core_cmFunc.h

If you are not familiar with the NVIC you can download the K20_50 MHz sample code and compare it with the Reference Manual:

Freescale Freedom Development Platform for th|Freescale


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
883 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello M J,

There is (the attachment )a demo about KDS interrupt (GPIO interrupt ),  this is create on k60, you can refer to it .

Best Regards,

Alice

------------------------------------------------------------------------------------------

If this post answers your question, please click the Correct Answer button.

883 次查看
mjg8t
Contributor IV

Thank you for the verification and the example!

0 项奖励
回复
884 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello M J:

You are correct, vectors are defined in the startup_xxx.S file, then you only have to declare your Interrupt Service Routine (ISR) with the same name as in that file, or change it if you wish. Apart from this everything is the same as in CW, enabling the peripheral interrupt and the NVIC manager. For the NVIC you count with some helpful files in the "Includes" folder:

- core_cm0plus.h

- core_cm4.h

- core_cmFunc.h

If you are not familiar with the NVIC you can download the K20_50 MHz sample code and compare it with the Reference Manual:

Freescale Freedom Development Platform for th|Freescale


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复