[FAQ] TDA4VH-Q1: Steps to Duplicate and Register a New C7x Kernel

Part Number: TDA4VH-Q1

Tool/software:

What are the steps to duplicate and register a new c7x kernel in vision apps ?

  • 1. Duplicate the Kernel Folder

    • Copy the folder: vision_apps/apps/basic_demos/app_c7x_kernel

    • Rename the copied folder with your new kernel name, e.g.: app_c7x_kernel_cp

    2. Update Build Output Paths

    Modify the output paths in the following .mak files to match your new kernel name :

    • vision_apps/apps/basic_demos/app_c7x_kernel_cp/c7x/concerto.mak

    • vision_apps/apps/basic_demos/app_c7x_kernel_cp/concerto.mak


    3. Add Output Library Path

    Depending on the build target, update the following files:

    • For PC Emulation (x86_64):
      Add your new output library path to: vision_apps/apps/concerto_x86_64_inc.mak

    • For Target Build (RTOS on EVM):
      Add your output library path to: vision_apps/platform/<evm>/rtos/concerto_c7x_inc.mak

    4. Register and Unregister the Kernel

    Update function names and definitions in both host and target code:

    • Host File    : vision_apps/apps/basic_demos/app_c7x_kernel_cp/app_c7x_kernel_img_add.c
    • Target File : vision_apps/apps/basic_demos/app_c7x_kernel_cp/c7x/app_c7x_target_kernel_img_add.cpp

    Update the following functions with your new kernel name:

    • Host registration
      • vx_status app_c7x_kernel_img_add_register(vx_context context);
      • vx_status app_c7x_kernel_img_add_unregister(vx_context context);

    • Target registration
      • void app_c7x_target_kernel_img_add_register(void);
      • vx_status app_c7x_target_kernel_img_add_unregister(void);

    Rename all instances appropriately (e.g., if your kernel is img_sub, change to app_c7x_kernel_img_sub_register, etc.).

    Update kernel Name from : /vision_apps/apps/basic_demos/app_c7x_kernel_cp/app_c7x_kernel.h

    Change the names of kernel functions in app_c7x_target_kernel_<name>_register and in their function definitions.

    5. Hook Kernel into Application Init

    In the following file: vision_apps/platform/j784s4/rtos/common/app_init.c

    Locate the following functions and add calls to your new register/unregister functions:

    • appRegisterOpenVXTargetKernels()

    add app_c7x_target_kernel_<your_kernel>_register()

    • appUnRegisterOpenVXTargetKernels()

    app_c7x_target_kernel_<your_kernel>_unregister();

    Replace <your_kernel> with your new kernel identifier.

    Notes:

    • File renaming is not shown in this summary — make sure to rename .c/.cpp/.h files to match your new kernel name if needed.
    • Be consistent with naming across all files, functions, and build paths.