GithubHelp home page GithubHelp logo

elupus / osal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rtlabs-com/osal

1.0 1.0 0.0 112 KB

License: BSD 3-Clause "New" or "Revised" License

C++ 1.96% C 82.39% Assembly 9.47% CMake 6.18%

osal's Introduction

OS abstraction layer

Build Status CodeQL

This repository contains an OS abstraction layer. The goal of the abstraction layer is to simplify writing software that runs on many platforms. This abstraction layer is mainly focused on threading functionality.

Cloning

Clone the source:

$ git clone --recurse-submodules https://github.com/rtlabs-com/osal.git

This will clone the repository with submodules. If you already cloned the repository without the --recurse-submodules flag then run this in the osal folder:

$ git submodule update --init --recursive

Prerequisites for all platforms

  • CMake 3.14 or later

Windows

  • Visual Studio 2017 or later

You can use a windows or unix shell as preferred. The following instructions are for a unix shell. CMake is assumed to be in your path.

$ cmake -B build.win64 -A x64
$ cmake --build build.win64 --config Release
$ cmake --build build.win64 --config Release --target check

This builds the project and runs the unit tests.

Linux

  • GCC 4.6 or later
$ cmake -B build
$ cmake --build build --target all check

This builds the project and runs the unit tests.

rt-kernel

  • Workbench 2020.1 or later

You should use a bash shell, such as for instance the Command Line in your Toolbox installation. Set the BSP variable to the name of the BSP you wish to build for. Set the RTK variable to the path of your rt-kernel tree.

Standalone project

This creates standalone makefiles.

$ RTK=/path/to/rt-kernel BSP=xmc48relax cmake \
   -B build.xmc48relax \
   -DCMAKE_TOOLCHAIN_FILE=cmake/tools/toolchain/rt-kernel.cmake \
   -G "Unix Makefiles"
$ cmake --build build.xmc48relax

Workbench project

This creates a Makefile project that can be imported to Workbench. The project will be created in the build directory. The build directory should be located outside of the source tree.

$ RTK=/path/to/rt-kernel BSP=xmc48relax cmake \
   -B build.xmc48relax -S /path/to/osal \
   -DCMAKE_TOOLCHAIN_FILE=cmake/tools/toolchain/rt-kernel.cmake \
   -DCMAKE_ECLIPSE_EXECUTABLE=/opt/rt-tools/workbench/Workbench \
   -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE \
   -G "Eclipse CDT4 - Unix Makefiles"

A source project will also be created in the osal tree. This project can also be imported to Workbench. After importing, right-click on the project and choose New -> Convert to a C/C++ project. This will setup the project so that the indexer works correctly and the Workbench revision control tools can be used.

The library and the unit tests will be built. Note that the tests require a stack of at least 6 kB. You may have to increase CFG_MAIN_STACK_SIZE in your bsp include/config.h file.

STM32Cube / FreeRTOS / lwIP

First, clone the relevant STM32Cube repo for your platform. For instance, to build for STM32F7 (fetching a specific tag only):

$ git clone https://github.com/STMicroelectronics/STM32CubeF7.git \
    -b v1.16.1 --single-branch --depth 1

Then, when configuring specify CPU, board and path to the cloned git repository:

$ CPU=cortex-m7fd BOARD=STM32F769I-DISCO CUBE_DIR=/path/to/cube cmake \
    -B build.cube \
    -DCMAKE_TOOLCHAIN_FILE=cmake/tools/toolchain/stm32cube.cmake \
    -G "Unix Makefiles"
$ cmake --build build.cube

osal's People

Contributors

hefloryd avatar elupus avatar lrsdnlssn avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.