Hello World¶
A minimal application that runs on the Coral Dev Board. Use this to verify the cross-compile, deploy, and run workflow.
Source Code¶
main.c¶
CMakeLists.txt¶
apps/hello_world/CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(hello_world C)
add_executable(hello_world src/main.c)
# Deploy / Run
include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/coral-deploy.cmake)
coral_add_deploy_target(
DEPLOY_DIR /home/mendel/work/hello_world
DEPENDS hello_world
FILES "$<TARGET_FILE:hello_world>:hello_world"
)
coral_add_run_target(
COMMAND /home/mendel/work/hello_world/hello_world
)
Including coral-deploy.cmake adds the deploy and run targets.
DEPLOY_DIR: Target directory on the boardDEPENDS: Targets to build before deployingFILES: Files to transfer (local_path:remote_filename)COMMAND: Command to execute remotely
Build¶
cmake -B build/hello_world -S apps/hello_world \
-DCMAKE_TOOLCHAIN_FILE=$(pwd)/cmake/toolchain-coral-aarch64.cmake
cmake --build build/hello_world
Deploy¶
Transfer the built binary to the Coral Dev Board.
Run¶
Execute the application remotely on the board.
Expected output: