# How to Run and Add a HelloWorld Application

This document covers two parts:

- First, run the HelloWorld already provided by the SDK (quickest way to verify your environment)
- Then, add or modify your own HelloWorld application

## Run the Built-in HelloWorld (Recommended First)

The SDK provides a sample directory: `src/applications/helloworld`

```bash
cd <sdk_root>
ls src/applications/helloworld
```

If the directory contains `Kconfig`, `Makefile`, and `main.c`, the sample is ready to use.

### Enable the HelloWorld Build Switch

```bash
make menuconfig
```

Enable the following option in the menu:

```text
Application Configuration > Enable Application HelloWorld
```

### Build and Flash

```bash
make
```

After flashing, the application will be packaged into the `/sdcard/app/` directory on the board.

### Run on the Board

```bash
/sdcard/app/helloworld
```

## Add / Modify HelloWorld

You can modify the existing `src/applications/helloworld` directly, or copy it as a new application directory.

## Build

### Build Standalone

```bash
cd <sdk_root>/src/applications/helloworld
make
ls
```

This produces an executable `helloworld` that you can manually copy to the board and run.

### Build as Part of the Full Image

1. Edit `src/applications/apps.mk` to add the corresponding directory to the build system.

```bash
cat src/applications/apps.mk
-include $(SDK_SRC_ROOT_DIR)/.config

subdirs-$(CONFIG_APP_ENABLE_HELLOWORLD) += helloworld
```

1. Enable the APP build feature in menuconfig.

```bash
make menuconfig
```

```text
Application Configuration > Enable Application HelloWorld
```

Then run `make` or `make app` to build the applications under `src/applications`.

```bash
make
```

Flash the resulting image to the development board.
The application will be packaged into the image's `/sdcard/app/` directory, where it can be set to auto-start on boot or run manually for testing.
