getting_started:write_app:use_on_bbb
This is an old revision of the document!
Writing EEROS Applications for Beaglebone Blue Board
Fetch the EEROS scripts on your target system with
$ git clone https://github.com/eeros-project/eeros-build-scripts.git bbblue $ cd bbblue $ git checkout sdk_bbb
What do you want to do next?
Say Hello with EEROS
- Edit the file
config.sh.in
as followscustom_application=hello
- Create a project directory and change into it with
$ mkdir hello $ cd hello
- Create a text file “main.cpp” and copy the following code into it
#include <iostream> #include <eeros/logger/Logger.hpp> #include <eeros/logger/StreamLogWriter.hpp> int main() { using namespace eeros::logger; Logger::setDefaultStreamLogger(std::cout); Logger log = Logger::getLogger(); log.info() << "Hello, EEROS"; return 0; }
- Create a text file “CMakeLists.txt” and copy the following text into it:
cmake_minimum_required(VERSION 3.5.1) project(helloworld) set(CMAKE_CXX_STANDARD 14) find_package(EEROS REQUIRED) include_directories(${EEROS_INCLUDE_DIR}) link_directories(${EEROS_LIB_DIR}) add_executable(helloworld main.cpp) target_link_libraries(helloworld eeros ucl ${CMAKE_DL_LIBS})
- Change back into your parent directory and build the project with
$ cd .. $ ./make.sh
Continue with Deploy to Beaglebone Blue Board.
Using Existing Project
As an example we use the Control a Single Motor demo program.
- Edit the file
config.sh.in
as followscustom_application=simple-motor-control
environment_setup_script=/opt/ntb-distro/1.0/environment-setup-armv7at2hf-neon-poky-linux-gnueabi
This will guide your make script to use the SDK. Make sure that the above path matches your installation path.
getting_started/write_app/use_on_bbb.1616569383.txt.gz · Last modified: 2021/03/24 08:03 by ursgraf