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

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

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

Jump to solution
856 Views
RaAolCortAcsMat
Contributor III

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

Labels (1)
0 Kudos
1 Solution
453 Views
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

View solution in original post

2 Replies
454 Views
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

453 Views
RaAolCortAcsMat
Contributor III

Jason

I was missing

  • setup the pin mux as GPIO

Thanks

Raul

0 Kudos