new KendryteIDE how to include libs?

  • Hi,

    I installed the new and actual KendryteIDE and now having trouble to include the libs needed from the standalone projects. How can they be found by the IDE? Anyone have any advice?
    Thank you very much

  • @GongT mostly using Win7 but also tried it on a Win10 machine which produced the same fault. The error code is taken from the Win7 pc.

  • |  Mod

    @ulix Are you using Windows 10 or 7 in this post?😬

  • Hi @GongT
    I'm using Win7 (and Win10) and compiling fails, I can not jump to the xxx.h files. I had this problem not before, the standalone projects I tested: dvp_ov and hello_world. I think there is some IDE bug because I had not the problem with the last KendryteIDE files without the installer, I used the archive.
    When I try to &build I get the following error:

    Starting build...
    [ INFO] Generate CMakeLists.txt file:
    [ INFO] reading file: c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/kendryte-package.json
    [ INFO] reading file: c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/kendryte_libraries/kendryte-standalone-sdk/kendryte-package.json
    [ INFO] Loaded projects: kendryte-standalone-sdk, hello_world_standalone, 
    [ INFO] resolving includes...
    [ INFO] resolving linker scripts...
    [ INFO] resolving constant definitions...
    [ INFO] resolving user custom cmake files...
    [ INFO] resolving user custom cmake files...
    [ INFO] generating CMakeLists.txt in c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/kendryte_libraries/kendryte-standalone-sdk...
    [ INFO] generating CMakeLists.txt in c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone...
    [ INFO] Done.
    [ INFO] configuring project: c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/CMakeLists.txt
    [ INFO] --no-warn-unused-cli
    [ INFO] _currentFolder=c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone
    [ INFO] pipeFile=c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/.vscode/.cmserver-pipe-1547115311568
    [ INFO] Start new CMake Server: C:/Users/ric/Desktop/KendryteIDE/Application/app_1.30.1-beta_20181219.210116/data/packages/cmake/bin/cmake.exe -E server --experimental --pipe=\\?\pipe\c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/.vscode/.cmserver-pipe-1547115311568
    [ INFO] Started new CMake Server instance with PID undefined
    [ INFO] CMake server error:
    Error: connect ENOENT \\?\pipe\c:/Users/ric/Desktop/KendryteIDE/workspace/hello_world_standalone/.vscode/.cmserver-pipe-1547115311568
        at Object._errnoException (util.js:1024:11)
        at _exceptionWithHostPort (util.js:1046:20)
        at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

    After I install the KendryteIDE.bat and execute it I get a Error:

    Get registry:
    latest version: 1.30.1-beta
    latest patch: 20181219.210116
    Get thirdParty:
    no action on: cmake
    no action on: hello-world-project
    no action on: cmake-list-files
    no action on: isp
    no action on: python2library
    will remove directory: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd
    Will download object from:
     extract to:
    no action on: toolchain
    found local version: app_1.30.1-beta_20181219.210116
    local versions: 
    1.30.1-beta @ 20181219.210116
    check complete. 10 work to be done.
    work no name:
    work no name has done in 0.00s
    Removing openocd
    work no name:
    removing directory: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd...
    work no name has done in 2.68s
    work download extract - openocd: :
    check remote changed: {"if-none-match":"\"980a45fe38fa582227eb0b629b581c18-2\""}
      -> changed or non-exists! reset download status.
    response: 200 [object Object]
    request HEAD got hash: "948c3a8959c16ade653be8c5ab5e11a8-2"
    success, 206.
    starting piping to file
    finishing piping
    work download extract - openocd:  has done in 34.62s
    openocd: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd
    work install - openocd: :
    unzip C:\Users\ric\AppData\Local\Temp\KendryteIDE\openocd-windows.7z -> C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd
    removing directory: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd...
    never exists...
    C:\Users\ric\Desktop\KendryteIDE\Updater\resources\app.asar.unpacked\node_modules\7zip-bin\win\x64\7za.exe -bso1 -bse1 -bsp2 x -oC:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd -y C:\Users\ric\AppData\Local\Temp\KendryteIDE\openocd-windows.7z
    7-Zip (a) 18.05 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30
    Scanning the drive for archives:
    1 file, 16619143 bytes (16 MiB)
    Extracting archive: C:\Users\ric\AppData\Local\Temp\KendryteIDE\openocd-windows.7z
    Path = C:\Users\ric\AppData\Local\Temp\KendryteIDE\openocd-windows.7z
    Type = 7z
    Physical Size = 16619143
    Headers Size = 676
    Method = LZMA2:48m BCJ
    Solid = +
    Blocks = 3
    Everything is Ok
    Folders: 2
    Files: 22
    Size:       44525014
    Compressed: 16619143
    only child: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd\openocd-windows
    removing directory: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd.rename-temp...
    never exists...
    rename(C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd\openocd-windows, C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd.rename-temp)
    removing directory: C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd...
    rename(C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd.rename-temp, C:\Users\ric\Desktop\KendryteIDE\LocalPackage\openocd)
    work install - openocd:  has done in 7.29s
    work no name:
    work no name has done in 0.01s
    work launch application:
    found local version: app_1.30.1-beta_20181219.210116
    local versions: 
    1.30.1-beta @ 20181219.210116
    wd: C:\Users\ric\Desktop\KendryteIDE
    Error: Application no response
        at Timeout.setTimeout (C:\Users\ric\Desktop\shell\electron-main\ipc.ts:43:11)
        at ontimeout (timers.js:425:11)
        at tryOnTimeout (timers.js:289:5)
        at listOnTimeout (timers.js:252:5)
        at Timer.processTimers (timers.js:212:10)
    Fail to Start
    try to start latest working version.
    found local version: app_1.30.1-beta_20181219.210116
    local versions: 
    1.30.1-beta @ 20181219.210116
    Fail to Start
    no installed version to try

  • |  Mod

    Source file should always "automtically" found by IDE.
    Infact, all path is manually defined inside the library. (in your case, the standalone_sdk)
    You need to compile at least once (failed is ok). After that, IDE can recognize all included things.

    If it cannot compile, maybe a bug in demo project.
    Which demo are you trying?

    If Ctrl+Click on #include xxx.h did not jump to that file, it may be an IDE bug, or the SDK path define is wrong.

  • Hi GongT,
    thank you very much for your reply.

    With libs I mean for example:

    #include <stdio.h>
    #include <string.h>
    #include "dvp.h"
    #include "fpioa.h"
    #include "lcd.h"
    #include "ov5640.h"
    #include "ov2640.h"
    #include "plic.h"
    #include "sysctl.h"
    #include "uarths.h"
    #include "nt35310.h"

    I directly downloaded the newest KendryteIDE from here and did not change anything only downloaded one of the sdk standalone examples. The .h-files should be found automtically by the IDE, shouldn't they (I did not change the paths)? Because a few versions back, the .h-files where found automatically.
    Am I wrong about this? How can the source files be found automatically?
    Thank you

  • |  Mod

    What type of libs?
    You can simply copy the lib's source code into your source directory, and append path to src in kendryte-package.json.

    Or if you do not have source, then you to need create a CMake file, And set extraList in kendryte-package.json.