Build kendryte using eclipse

  • Staff

    I tested visual studio, clion and eclipse for k210. i can build elf and bin using all of them, but the only one IDE I can debug is eclipse. Here is how i use eclipse to compile and debug.


    • eclipse cdt( Version: 2018-09 (4.9.0) i used)
    • ninja
    • unofficial build of riscv toolchain for windows( gdb have bug in official toolchain for windows. if you use linux it's okay, if you use windows you have to build yourself or find prebuilt from somewhere like sifive)
    • cmake
    • cmake4eclipse plugin


    • add ${toolchain}/bin to path env
    • add so search path (if you use linux)
    • put ninja to your search path
    • run eclipse cdt new c/c++ project
    • add cmakelists.txt like this:
    cmake_minimum_required(VERSION 3.0)
    set(SDK_ROOT "C:/tools/kendryte/kendryte/kendryte-standalone-sdk")
    set(TOOLCHAIN "C:/Users/manag/kendryte/kendryte-toolchain/bin")
    # config self use headers
    INCLUDE_DIRECTORIES(${SDK_ROOT}/lib/arch/include ${SDK_ROOT}/lib/utils/include)
    # build library first
    add_subdirectory(${SDK_ROOT}/lib lib)
    # compile project
    add_source_files(src/*.c src/*.s src/*.S src/*.cpp)
    • configure cmake. using generate "Eclipse Ninja"
    • build project
    • launch openocd with -m0
    • add debug config "gdb hardware debug"
    • configure gdb using "localhost:3333" and configure
    • start debugging

  • Hi,
    do you think you could write this Eclipse information at bit more precise? It is very good to use eclipse, but some points are written very cryptic, especially when using Win. I think a lot of users would be grateful for that!

    For example:
    What do you mean with:

    • add ${toolchain}/bin to path env
    • configure cmake. using generate "Eclipse Ninja"
    • launch openocd with -m0
    • add debug config "gdb hardware debug"
    • configure gdb using "localhost:3333" and configure

    Thank you

  • Staff

    oh, and i found both visual studio and clion can get right lint. but eclipse can't found symbol