4. K230 Fancy POC Overview#

This chapter provides multiple POC project setup processes using the K230 development board, showcasing the powerful capabilities of the K230, and offering ideas for users to build POCs with the K230.

Note: Most K230 Fancy POCs only support running on Linux+RT-Smart dual systems, not pure RT-Smart single system. Please pay attention to the image selection during actual operation.

4.1 Overview#

The K230 Fancy POC collection includes projects such as multimodal_chat_robot (multimodal chat robot), meta_human (digital human), meta_hand (gesture rendering), and finger_reader (finger reading).

4.2 Source Code Location#

The source code path is located in the src/reference/fancy_poc directory under the root of the K230 SDK (k230_sdk/src/reference/fancy_poc at main · kendryte/k230_sdk (github.com)) or src/reference/fancy_poc · kendryte/k230_sdk - Gitee (gitee.com). For an introduction to each POC, please refer to the table below:

POC Subdirectory

Description

GitHub Link

Gitee Link

Remarks

ai_scale

K230 Simulated AI Scale

ai_scale

ai_scale

Only supports Linux+RT-Smart dual system

face_recognition

K230 Face Recognition System

face_recognition

face_recognition

Support Linux+RT-Smart dual system and pure RT-Smart single system

finger_reader

K230 Finger Reading Project

finger_reader

finger_reader

Only supports Linux+RT-Smart dual system

housekeeper

Smart Housekeeper System

housekeeper

housekeeper

Only supports Linux+RT-Smart dual system and Only supports version k230_sdk<=1.2

meta_hand

K230 Gesture Rendering Project

meta_hand

meta_hand

Only supports Linux+RT-Smart dual system

meta_human

K230 Virtual Digital Human

meta_human

meta_human

Only supports Linux+RT-Smart dual system

multimodal_chat_robot

K230 Multimodal Chat Robot

multimodal_chat_robot

multimodal_chat_robot

Only supports Linux+RT-Smart dual system

4.3 Compiling and Running the Program#

This section is based on the latest version of the source code from kendryte/k230_sdk: Kendryte K230 SDK (github.com) or k230_sdk: Kendryte K230 SDK (Gitee.com).

4.3.1. Self-compiled Image Upload Process#

  • Follow the instructions from kendryte/k230_sdk: Kendryte K230 SDK (github.com) or k230_sdk: Kendryte K230 SDK (Gitee.com) to build a Docker container and compile the image for the board;

    # Download the Docker compilation image
    docker pull ghcr.io/kendryte/k230_sdk
    # Use the following command to confirm if the Docker image was pulled successfully
    docker images | grep ghcr.io/kendryte/k230_sdk
    # Download the SDK source code
    git clone https://github.com/kendryte/k230_sdk.git
    cd k230_sdk
    # Download toolchains for Linux and RT-Smart, buildroot package, AI package, etc.
    make prepare_sourcecode
    # Create a Docker container, $(pwd):$(pwd) maps the current system directory to the same directory inside the Docker container, and maps the toolchain directory to /opt/toolchain inside the Docker container
    docker run -u root -it -v $(pwd):$(pwd) -v $(pwd)/toolchain:/opt/toolchain -w $(pwd) ghcr.io/kendryte/k230_sdk /bin/bash
    make mpp
    # (1) If you choose to compile the Linux+RT-Smart dual system image yourself, execute the following command
    make CONF=k230_canmv_defconfig
    
    # (2) If you choose to use the Linux+RT-Smart dual system image downloaded from the developer community, be sure to execute the following command in the k230_sdk root directory to specify the development board type
    make CONF=k230_canmv_defconfig prepare_memory
    
    # (3) If you choose to compile a pure RT-Smart system image yourself, execute the following command. The developer community has not yet opened the pure RT-Smart image download
    make CONF=k230_canmv_only_rtt_defconfig
    
  • Please wait patiently for the image to compile successfully.

    For Linux+RT-Smart dual system compilation, download the compiled image from k230_sdk root directory/output/k230_canmv_defconfig/images and flash it to the SD card. Refer to Image Flashing for flashing steps:

    k230_canmv_defconfig/images
     ├── big-core
     ├── little-core
     ├── sysimage-sdcard.img    # SD card boot image
     └── sysimage-sdcard.img.gz # Compressed SD card boot image
    

    For RT-Smart single system compilation, download the compiled image from k230_sdk root directory/output/k230_canmv_only_rtt_defconfig/images and flash it to the SD card. Refer to Image Flashing for flashing steps:

    k230_canmv_defconfig/images
     ├── big-core
     ├── sysimage-sdcard.img    # SD card boot image
     └── sysimage-sdcard.img.gz # Compressed SD card boot image
    
  • Inside the Docker container, navigate to the root directory of k230_sdk and execute the following command to compile the fancy POC part:

    cd src/reference/fancy_poc
    # If build_app.sh lacks permissions, execute chmod +x build_app.sh
    ./build_app.sh
    
  • In the src/reference/fancy_poc/k230_bin directory, select the corresponding files compiled for the POC, including the ELF files for the big core and the executable files for the small core;

  • If the files to be copied exceed the available size of the development board, you will need to perform a repartition operation;

    Note:

    1. For Linux+RT-Smart dual system, sharefs is a shared directory between the big and little cores, allowing the big core to access the little core’s file system by accessing their respective /sharefs directories. Typically, executable programs for the big core are stored in the /sharefs directory, enabling the big core to execute these programs and facilitating application development and debugging on the big core. Refer to: K230 Big and Little Core Communication Sharefs Usage Introduction.

    2. For Linux+RT-Smart dual system, to ensure sufficient system space, the last disk partition size might be insufficient to store all files. You can use the following commands to resize the last partition. Refer to: K230 SDK FAQ Question 9.

    umount /sharefs/
    parted -l /dev/mmcblk1
    # 31.3GB size should be based on the output of the previous command Disk /dev/mmcblk1
    parted -a minimal /dev/mmcblk1 resizepart 4 31.3GB
    mkfs.ext2 /dev/mmcblk1p4
    mount /dev/mmcblk1p4 /sharefs
    
    1. For Linux+RT-Smart dual system, Choose an image from the Canaan Developer Community -> Downloads -> K230 -> Images. Check the SDK and nncase version correspondence via the provided link:

    K230 SDK nncase Version Correspondence — K230 Documentation (canaan-creative.com)

    Refer to Image Flashing for flashing instructions. The developer community only provides Linux+RT-Smart dual-system images. You need to compile the pure RT-Smart image yourself according to the above steps.

    1. For RT-Smart single system, the root directory identified by the PC when copying files corresponds to the /sdcard directory of the big core. Please search for the copied files in /sdcard under the big core directory.

@You:

The Fancy POC chapters aim to showcase the powerful performance and wide application scenarios of the K230 in the AI field. Although we provide the relevant source code for user reference, these sources are mostly implementations based on specific POC task scenarios.

For users who wish to gain an in-depth understanding of the K230 AI development process, it is recommended to study Quick_Start_K230_AI_Inference_Process and In-depth_Analysis_AI_Development_Process. In these chapters, we provide a detailed explanation of the multimedia applications, AI inference process, and AI development process based on the K230, thoroughly analyzing the AI development knowledge of the K230 from the code level.

Comments list

Comments list

Comments
Log in