How to Run Sample Programs#
This document explains in detail how to enable, build, and run sample programs in the K230 RTOS SDK, and how to configure auto-start on boot.
Enable Sample Programs#
Enable Compilation of Samples#
The SDK has been refactored so that all sample configurations are accessed through a unified entry point:
RT-Smart UserSpace Examples Configuration
Configure in the following order:
Enable the master switch first:
RT-Smart UserSpace Examples Configuration
You need to disable
CanMV Components Configuration.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
If you enable a category (e.g.
Enable MPP examples), go into its submenu to check specific samples (e.g.sample_venc,sample_vdec, etc.).
Notes:
The old paths
RT-Smart Configuration > Enable build Rtsmart examplesandMPP Configuration > Enable build MPP samplesare no longer the primary entry points for samples.The master sample switch depends on
!SDK_ENABLE_CANMV. If you are using the CanMV solution, switch to the RTOS path as described in the build guide before this menu appears.
Build Sample Programs#
Full Build (Recommended)#
Run make from the root directory to build all enabled samples and package them into the image in one step:
make
Standalone Build (For Debugging)#
To build a single sample independently, go into its directory and run:
cd src/rtsmart/examples/integrated_poc # example path
make clean && make # clean and rebuild
Notes:
ELF files produced by a standalone build must be manually copied to the board (see step 3.2).
Ensure the corresponding category and specific sample are enabled in
RT-Smart UserSpace Examples Configurationbefore building.
Run Sample Programs#
Automatic Deployment via Image#
When using make for a full build, RT-Smart samples are packaged into the image at /sdcard/app/examples/ by default. After logging in to the board via serial port, run them directly:
cd /sdcard/app/examples
# Run a sample (example)
./integrated_poc/smart_ipc.elf
Manual Deployment of Standalone-Built Samples#
Copy the generated ELF file (e.g.
integrated_poc.elf) to the board using a card reader or MTP.Run it via the serial terminal:
/sdcard/app/examples/integrated_poc.elf
Serial Connection Tips:
Use
PuTTYorMinicomto connect to the board’s serial port (baud rate:115200).On Linux the serial device is usually
/dev/ttyUSB0; on Windows it isCOMx.
Configure Auto-Start on Boot#
Set the Startup Command#
In
make menuconfig, navigate to:RT-Smart Configuration > Startup command
Startup commandis a runtime command string. Enter the absolute path to the sample program (e.g./sdcard/app/examples/integrated_poc/smart_ipc.elf).If you are configuring
Fast Boot Configuration > Fast boot file path, you can use an absolute path or the${SDK_*}variables exported bytools/mkenv.mk(e.g.${SDK_BUILD_IMAGES_DIR}). You also need to update the auto-start command, replacing the ELF path with/bin/preload.
Verify Auto-Start#
After rebooting the board, the sample program will start automatically. Confirm it is working via logs or peripheral behavior.
Frequently Asked Questions#
The sample is not in
/sdcard/app/examplesCheck that the master switch in
RT-Smart UserSpace Examples Configurationis enabled.Check that the relevant category (e.g. MPP/AI/Integrated) and the specific sample are selected.
Re-run
makeand ensure there are no build errors.
No output on serial port
Confirm the serial cable is properly connected.
Check that the baud rate and terminal settings match.
Following the steps above, you can quickly master the complete workflow for running K230 RTOS SDK sample programs.
