Environment requirements and configuration

Updated at:

This topic describes the hardware and development environment requirements for integrating the C Link SDK and provides compilation and runtime instructions.

Hardware environment

  • The SDK supports Linux and other systems that are compatible with POSIX-based APIs.

  • The device must support the TCP/IP protocol stack, either natively or through an external module.

  • The device must have at least 1 MB of ROM and 256 KB of RAM.

The demo files in the C Link SDK are developed for Linux. This lets you quickly test and use the SDK on a Linux system.

Development environment

The C Link SDK supports cross-platform porting and has flexible requirements for the development environment. The environment must support the following:

  • Programming language: C language (C99 standard).

  • Development tools: Any tool that supports C language compilation.

  • Compilation framework: CMake.

Compilation

Set up cross compilation

Modify the CMakeLists.txt file to set the cross-compilation toolchain.

Important

The value arm-linux-gnueabihf-gcc in the following configuration is an example. Replace it with your specific cross compiler.

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)

Compile the code

Direct compilation

mkdir build && cd build
cmake ..
make -j

Compile as a static library

mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=OFF ..
make -j

Compilation outputs

  • Demo executable file path: ./output/bin/

  • Library file path: ./output/lib/

  • Header file path: ./output/include/

Run

To test a feature such as device connection, execute the ./output/bin/device_basic_demo command.

Important
  • The demo does not contain the correct device information. Modify the device connection information before you compile and run the demo.

  • If you configured cross compilation, copy the library files from ./output/lib/ to the target system before running the demo. Alternatively, you can compile and run the demo as a static library.

FAQ

Why can't I run the application on a Linux development board after I configure the CMakeLists.txt file for C Link SDK Extended and compile it by running make -j?