Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

How to Run Example Programs#

This document details how to enable, compile, and run example programs in the K230 RTOS SDK, and configure them to start automatically on boot.

Enabling Example Programs#

Entering the Configuration Menu#

Execute the following command in the SDK root directory (~/rtos_k230) to enter the interactive configuration interface:

make menuconfig

Enabling Build Examples#

The current SDK has refactored the example configuration, and the unified entry is:

RT-Smart UserSpace Examples Configuration

It is recommended to configure in the following order:

  1. First enable the master switch:

    RT-Smart UserSpace Examples Configuration
    

    You need to disable CanMV Components Configuration

  2. Then enable sub-switches by category (select as needed):

    Enable 3rd-party examples
    Enable build peripheral examples
    Enable MPP examples
    Enable build ai examples
    Enable build integrated examples
    
  3. If a certain category is enabled (for example, Enable MPP examples), continue to enter that submenu to check specific samples (such as sample_venc, sample_vdec, etc.).

Notes:

  • The old paths RT-Smart Configuration > Enable build Rtsmart examples and MPP Configuration > Enable build MPP samples are no longer the main example entries.

  • The example master switch depends on !SDK_ENABLE_CANMV; if you use the CanMV solution, you need to switch to the RTOS path according to the build guide before this menu will appear.

Compile Example Programs#

Individual Build (Debug Scenarios)#

If you need to compile a specific example individually, navigate to the corresponding directory and run the build:

cd src/rtsmart/examples/integrated_poc  # Example path
make clean && make                      # Clean and rebuild

make smart_ipc

Notes:

  • The ELF file generated by individual compilation needs to be manually copied to the development board (see Step 3.2).

  • Make sure the corresponding category and specific sample have been enabled in RT-Smart UserSpace Examples Configuration before compiling.

Running Example Programs#

Automatic Deployment via Image#

If you use make for the overall compilation, RT-Smart examples will be packaged by default into the /sdcard/app/examples/ directory of the image. After logging into the development board via serial port, you can directly execute:

cd /sdcard/app/examples

# Run example (example)
./integrated_poc/smart_ipc.elf

Manually Deploying Individually Compiled Examples#

  1. Copy the generated ELF file (such as integrated_poc.elf) to the development board via a card reader or mtp:

  2. Run via serial port terminal:

    /sdcard/app/examples/integrated_poc.elf
    

run smart ipc

Serial Port Connection Tips:

  • Use PuTTY or Minicom to connect to the development board’s serial port (baud rate is 115200).

  • The serial port device name is usually /dev/ttyUSB0 on Linux, and COMx on Windows.

Configure Boot Auto-Start Example#

Set Startup Command#

  1. In make menuconfig, navigate to:

    RT-Smart Configuration > Startup command
    
  2. Startup command is the runtime command string. It is recommended to enter the absolute path of the example program (e.g. /sdcard/app/examples/integrated_poc/smart_ipc.elf).

  3. If Fast Boot Configuration > Fast boot file path is configured, an absolute path can be used, or the ${SDK_*} variables exported by tools/mkenv.mk (e.g. ${SDK_BUILD_IMAGES_DIR}) can be used. At the same time, the auto-start command also needs to be modified, replacing the elf path with /bin/preload.

Verify Auto-Start#

After restarting the development board, the example program will run automatically. You can check the logs or peripheral indicators to confirm whether it is effective.

Frequently Asked Questions#

  1. Examples not appearing in /sdcard/app/examples directory

    • Check whether the RT-Smart UserSpace Examples Configuration main switch has been enabled.

    • Check whether the corresponding category (e.g., MPP/AI/Integrated) and specific samples have been selected.

    • Re-run make and ensure there are no compilation errors.

  2. No serial port output

    • Confirm that the serial cable is properly connected.

    • Check whether the baud rate matches the terminal configuration.

By following the steps above, you can quickly master the complete operation workflow of the K230 RTOS SDK example programs.

Comments list
Comments
Log in