Difference between revisions of "Board Support Package"

From SEGGER Wiki
Jump to: navigation, search
(Created page with "embOS comes with board support packages for different device and evalboards. Further board support packages may easily be created on your own or can be requested by SEGGER. Us...")
 
Line 1: Line 1:
embOS comes with board support packages for different device and evalboards. Further board support packages may easily be created on your own or can be requested by SEGGER.
+
embOS comes with board support packages for different devices and evalboards.
  +
Further board support packages may easily be created on your own or can be requested by SEGGER.
Usually we suggest to start with one of these board support packages and add your application code to it.
 
  +
Usually we suggest to start with one of these board support packages and add your application code.
This guidance covers the case you want to add embOS to an existing project.
 
  +
  +
You can also add embOS to an existing project.
  +
The following description shows step by step how to add embOS.
   
 
=== Where can I get the embOS files? ===
 
=== Where can I get the embOS files? ===
Line 7: Line 10:
 
Once you licensed embOS you will get a download link to our download portal. In either case please download the zip file.
 
Once you licensed embOS you will get a download link to our download portal. In either case please download the zip file.
 
Extract the zip-file to any folder of your choice, preserving the directory structure of this file. Keep all files in their respective sub directories.
 
Extract the zip-file to any folder of your choice, preserving the directory structure of this file. Keep all files in their respective sub directories.
  +
The following steps assume you are working with the embOS libraries and not with the embOS source code.
  +
There is a separate Wiki article about replacing the embOS library with the embOS source code.
   
 
=== How can I add embOS to my existing project? ===
 
=== How can I add embOS to my existing project? ===
The following screenshots are taken from Embedded Studio but the description should work for other Compiler/IDEs as well.
+
The following screenshots are taken from Embedded Studio but the description works for other Compiler/IDEs as well.
   
 
This is a simple project for a SEGGER emPower board (NXP K66FN2M0) without embOS:
 
This is a simple project for a SEGGER emPower board (NXP K66FN2M0) without embOS:
Line 19: Line 24:
 
# One embOS library from Start/Lib.
 
# One embOS library from Start/Lib.
 
# All files from the according embOS BSP Setup folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/Setup.
 
# All files from the according embOS BSP Setup folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/Setup.
# In case of Cortex-M all files from the BSP SEGGER folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/SEGGER.
+
# In case you like to use RTT and SystemView all files from the BSP SEGGER folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/SEGGER.
   
 
[[File:embOS_files.png|none|alt=Active Simple project]]
 
[[File:embOS_files.png|none|alt=Active Simple project]]
   
   
Please add the following includes paths to your preprocessor settings and add the define "DEBUG=1:
+
Please add the following includes paths to your preprocessor settings and add the define "DEBUG=1":
   
 
[[File:embOS_Includes.png|none|alt=Active Simple project]]
 
[[File:embOS_Includes.png|none|alt=Active Simple project]]
Line 31: Line 36:
   
   
You can now use embOS in your application. Every embOS application files needs to include "RTOS.h".
+
You can now use embOS in your application. Every embOS application file needs to include the RTOS header file "RTOS.h".
You can also add the necessary code to create to your first task. Every task needs a separate task stack, a separate task control block and a task function.
 
The task simply executes the code from the main() function.
 
   
 
[[File:embOS_RTOS_h.png|none|alt=Active Simple project]]
 
[[File:embOS_RTOS_h.png|none|alt=Active Simple project]]
  +
  +
  +
Please add the necessary code to create your first task. Every task needs a separate task stack, a separate task control block and a task function.
  +
The task simply executes the code from the main() function.
   
 
[[File:embOS_Stack_TCB.png|none|alt=Active Simple project]]
 
[[File:embOS_Stack_TCB.png|none|alt=Active Simple project]]
   
The main() function needs to initialize the RTOS; the hardware, the task and to start embOS:
 
   
  +
The main() function needs to initialize the RTOS and the hardware. After the task is created embOS is started with the call to "OS_Start()":
[[File:embOS_main.png|none|alt=Active Simple project]]
 
   
  +
Build the project. It should build without any warning or error.
You can run this embOS application in hardware.
 
  +
You can now run this embOS application in hardware.
  +
  +
[[File:embOS_main.png|none|alt=Active Simple project]]

Revision as of 14:04, 2 June 2020

embOS comes with board support packages for different devices and evalboards. Further board support packages may easily be created on your own or can be requested by SEGGER. Usually we suggest to start with one of these board support packages and add your application code.

You can also add embOS to an existing project. The following description shows step by step how to add embOS.

Where can I get the embOS files?

If you evaluate embOS or your are working on a non commercial project you can download and use the embOS Free edition from [1]. Once you licensed embOS you will get a download link to our download portal. In either case please download the zip file. Extract the zip-file to any folder of your choice, preserving the directory structure of this file. Keep all files in their respective sub directories. The following steps assume you are working with the embOS libraries and not with the embOS source code. There is a separate Wiki article about replacing the embOS library with the embOS source code.

How can I add embOS to my existing project?

The following screenshots are taken from Embedded Studio but the description works for other Compiler/IDEs as well.

This is a simple project for a SEGGER emPower board (NXP K66FN2M0) without embOS:

Active Simple project


As a first step please add the new folder "embOS" to your project and add the following files:

  1. One embOS library from Start/Lib.
  2. All files from the according embOS BSP Setup folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/Setup.
  3. In case you like to use RTT and SystemView all files from the BSP SEGGER folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/SEGGER.
Active Simple project


Please add the following includes paths to your preprocessor settings and add the define "DEBUG=1":

Active Simple project
Active Simple project


You can now use embOS in your application. Every embOS application file needs to include the RTOS header file "RTOS.h".

Active Simple project


Please add the necessary code to create your first task. Every task needs a separate task stack, a separate task control block and a task function. The task simply executes the code from the main() function.

Active Simple project


The main() function needs to initialize the RTOS and the hardware. After the task is created embOS is started with the call to "OS_Start()":

Build the project. It should build without any warning or error. You can now run this embOS application in hardware.

Active Simple project