# Dive into the LED blinky demo

First let's create a Workspace Folder. Launch workspace where you want to locate it. Keep in mind that workspace switching restarts IDE.

<figure><img src="/files/aESlWi9K63ed9FRc6NCi" alt=""><figcaption></figcaption></figure>

Close the Welcome page and select "Import SDK example(s)...". Select the correct MCXN947 board and press "Next".

<figure><img src="/files/zbP1ewjHI36mh9ohXmue" alt=""><figcaption></figcaption></figure>

Now from the Import Wizard, drop down on the demo\_apps section and select the "led\_blinky" application. Then press "Finish" and wait for the project to open.

<figure><img src="/files/RcIM4BrcGBWgjclg1iGr" alt=""><figcaption></figcaption></figure>

You can see what the project window is split into.

<figure><img src="/files/5yGXEF86gsKCCQHTCAGR" alt=""><figcaption></figcaption></figure>

Let's take a look at the code. The top part of the code contains the includes files present in the project tree and visible in the Project Explorer tab.

<figure><img src="/files/53p1019MLk3xkX7X8cTN" alt=""><figcaption></figcaption></figure>

The next section is the SysTick\_Handler function that toggles the red LED on the board.

<figure><img src="/files/VTjYHiJxsjAz0uxYmZHg" alt=""><figcaption></figcaption></figure>

This function will be periodically called to switch ON and OFF the LED. Ctrl + click on the GPIO\_PortToggle function opens the declaration present in fsl\_gpio.h header file.

<figure><img src="/files/0VvM5v5p1TlvylCiK5Cd" alt=""><figcaption></figcaption></figure>

The main function starts by calling the initialization function.

<figure><img src="/files/5ImHyFYl4UuAsZERnQeh" alt=""><figcaption></figcaption></figure>

The initialization function can be found in the hardware\_init.c file.

<figure><img src="/files/gBrEOYoqD5iZSZTGBJEz" alt=""><figcaption></figcaption></figure>

This function enables a clock and initializes the board pinds. Then the BOARD\_BootClockFRO12M() sets the clock frequency to 12 MHz. SysTick\_Config(12000000UL) sets a counter with a value of 12.000.000 that makes the LED blink once per second. More on timers will be covered later. Changing the counter value will increase/decrease the blinking frequency but note that it needs to be slow enough for the human eye to notice it. LED\_RED\_INIT(LOGIC\_LED\_OFF) calls GPIO\_PinWrite() that changes the output of the GPIO (in this case to the OFF state).

<figure><img src="/files/0qZoAnF0TyneBauZwJFL" alt=""><figcaption></figcaption></figure>

Now let's divo into how to build and download the code on your board.

In order to build a project, have it selected and then either click on the "build icon" in the shortcuts provided above or by clicking "Build" in the Quickstart Panel.

<figure><img src="/files/OJ5f2VMbwG7NZSEoOden" alt=""><figcaption></figcaption></figure>

The project should finish the build without any errors or warnings in the console.

<figure><img src="/files/aJ7Npwln4gQrDZH0bTzG" alt=""><figcaption></figcaption></figure>

For the download step, make sure your board is connected to the computer through the J17 'MCU-LINK' port.

<figure><img src="/files/nQIEJjoTIqR6luWh8bBr" alt=""><figcaption></figcaption></figure>

Download the application to your board by either cliking on the "debug" icon above or clicking "Debug" in the Quickstart Panel.

<figure><img src="/files/vP4ccNNdgGAMeRDEkSMC" alt=""><figcaption></figcaption></figure>

In the next window, select the MCU-LINK CMSIS-DAP debug probe.

<figure><img src="/files/62uRreQHzvBBI5pOJrN3" alt=""><figcaption></figcaption></figure>

To run the application, press the "run" icon.

<figure><img src="/files/U1UWuQ1JqXGklobUuIbm" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nxp.gitbook.io/nxp-cup/2025-fall-2026-nxp-cup-mcxn947/mcxn947-software-setup/dive-into-the-led-blinky-demo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
