How to modify the interrupt vectors, using FRDM K64, sdk 2.0 with freertos ?

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

How to modify the interrupt vectors, using FRDM K64, sdk 2.0 with freertos ?

跳至解决方案
1,527 次查看
RaAolCortAcsMat
Contributor III

Do you have some examples using SW buttons in FRDMK64 with interrupts, SDK2.0 and freertos ?

标签 (1)
0 项奖励
回复
1 解答
1,124 次查看
Jmart
NXP Employee
NXP Employee

Raul,

Here's a simple example that will read the SW2 input and then change the color and frequency of the LED flash. This example builds off of the FrerRTOS hello world example that is shipped with SDK 2.0. You should be able to replace the freertos_hello.c file, build, and download to your target board.

The key points to enable the SW interrupt functionality can be round in the init_sw2() function.

This function will:

  • enable the clock for the SW2 port
  • setup the pin mux as GPIO
  • enable the port and system interrupts
  • set the GPIO as an input.

Once all of these steps are complete, the only step left is to add the IRQ handler to override the default weak implementation in the startup file. Don't forget to clear the interrupt before leaving your interrupt function.

Jason

在原帖中查看解决方案

2 回复数
1,125 次查看
Jmart
NXP Employee
NXP Employee

Raul,

Here's a simple example that will read the SW2 input and then change the color and frequency of the LED flash. This example builds off of the FrerRTOS hello world example that is shipped with SDK 2.0. You should be able to replace the freertos_hello.c file, build, and download to your target board.

The key points to enable the SW interrupt functionality can be round in the init_sw2() function.

This function will:

  • enable the clock for the SW2 port
  • setup the pin mux as GPIO
  • enable the port and system interrupts
  • set the GPIO as an input.

Once all of these steps are complete, the only step left is to add the IRQ handler to override the default weak implementation in the startup file. Don't forget to clear the interrupt before leaving your interrupt function.

Jason

1,124 次查看
RaAolCortAcsMat
Contributor III

Jason

I was missing

  • setup the pin mux as GPIO

Thanks

Raul

0 项奖励
回复