Difference between revisions of "Board Support Package"

From SEGGER Wiki
Jump to: navigation, search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
embOS comes with board support packages for different devices and evalboards.
+
Each embOS shipment contains various board support packages for different devices and evaluation boards.
  +
Each board support package comes with the required initialization code to execute embOS on that device, as well as a sample project for the IDE of your choice.
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.
 
   
  +
=== Introduction to embOS board support packages ===
You can also add embOS to an existing project.
 
  +
An embOS board support package (BSP) makes it easy to run embOS on a specific hardware.
The following description shows step by step how to add embOS.
 
  +
Although embOS for one specific core supports every device with that core, some device and board specific routines need to be implemented.
   
  +
An embOS board support package consists of two parts:
=== Where can I get the embOS files? ===
 
  +
* The required device and board specific software routines.
If you evaluate embOS or your are working on a non commercial project you can download and use the embOS Free edition from [https://www.segger.com/downloads/embos].
 
  +
* A project for your IDE with which embOS allows to execute on your hardware out of the box.
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.
 
   
  +
Most of the routines are specific to the selected device. For example, this includes
=== How can I add embOS to my existing project? ===
 
  +
* the startup code and vector table
The following screenshots are taken from Embedded Studio but the description works for other Compiler/IDEs as well.
 
  +
* the interrupt controller initialization
  +
* a hardware timer initialization
   
  +
The optional board specific routines could be for example:
This is a simple project for a SEGGER emPower board (NXP K66FN2M0) without embOS:
 
  +
* LED initialization/control
  +
* External memory initialization
  +
* UART initialization for a specific board connector (used for embOSView)
   
  +
An embOS BSP for one hardware may also be used on another hardware that features the same device, since most of the routines are device specific, but not board specific. <br>
[[File:K66_emPower_SimpleProject.png|none|alt=Active Simple project]]
 
  +
The embOS BSP code is implemented as source code in the files ''RTOSInit.c'' and ''BSP.c''.
  +
Further BSP files like ''BSP_Uart.c'' are optional.
   
  +
=== What's included ===
  +
All necessary initialization code to run embOS and a project for the IDE of your choice.
   
  +
=== What's not included ===
As a first step please add the new folder "embOS" to your project and add the following files:
 
  +
The embOS board support package does not include any code for additional peripherals like I²C or SPI.<br>
# One embOS library from Start/Lib.
 
  +
If those are required, hardware abstraction layers from your silicon vendor (e.g. [[Using_embOS_with_STM32CubeMX|STM32Cube HAL]]) seamlessly integrate with embOS.
# All files from the according embOS BSP Setup folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/Setup.
 
# In case you like to use RTT and SystemView all files from the BSP SEGGER folder, e.g. Start/BoardSupport/Segger/K66FN2M0_emPower/SEGGER.
 
   
  +
=== Where to find the BSPs in the embOS shipment ===
[[File:embOS_files.png|none|alt=Active Simple project]]
 
  +
Every embOS shipment includes a folder ''/Start/BoardSupport'', which includes further sub-folders grouped by silicon and board vendors.
  +
In each of these sub-folders you will find one or more board support packages. Each board support package is named ''<device name>_<board name>''.
   
  +
[[File:embOS_BSP_folders.png|none|alt=embOS BSP folders]]
   
  +
=== What shall I do when no BSP for my specific hardware was included with the embOS shipment? ===
Please add the following includes paths to your preprocessor settings and add the define "DEBUG=1":
 
  +
In case no BSP for your exact hardware was shipped with embOS, you may choose to:
  +
* use a BSP for another evaluation board but with the same device
  +
* create the BSP on your own
  +
* contact SEGGER to create the BSP
   
  +
In the latter case please send us detailed information about your hardware.
[[File:embOS_Includes.png|none|alt=Active Simple project]]
 
  +
The hardware can be an evalboard or even your custom hardware.
   
  +
=== Conclusion ===
[[File:embOS_Defines.png|none|alt=Active Simple project]]
 
  +
If you want to run embOS on a specific device and hardware please select the according embOS port first.
  +
This embOS port must support the core of your device and the compiler of your choice.
  +
You can then check if an according BSP is already included.
   
  +
In case of doubt please don't hesitate to contact us.
 
You can now use embOS in your application. Every embOS application file needs to include the RTOS header file "RTOS.h".
 
 
[[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]]
 
 
 
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.
 
embOS will execute the task function "Task()" until the application is stopped.
 
 
[[File:embOS_main.png|none|alt=Active Simple project]]
 

Latest revision as of 10:07, 29 November 2022

Each embOS shipment contains various board support packages for different devices and evaluation boards. Each board support package comes with the required initialization code to execute embOS on that device, as well as a sample project for the IDE of your choice.

Introduction to embOS board support packages

An embOS board support package (BSP) makes it easy to run embOS on a specific hardware. Although embOS for one specific core supports every device with that core, some device and board specific routines need to be implemented.

An embOS board support package consists of two parts:

  • The required device and board specific software routines.
  • A project for your IDE with which embOS allows to execute on your hardware out of the box.

Most of the routines are specific to the selected device. For example, this includes

  • the startup code and vector table
  • the interrupt controller initialization
  • a hardware timer initialization

The optional board specific routines could be for example:

  • LED initialization/control
  • External memory initialization
  • UART initialization for a specific board connector (used for embOSView)

An embOS BSP for one hardware may also be used on another hardware that features the same device, since most of the routines are device specific, but not board specific.
The embOS BSP code is implemented as source code in the files RTOSInit.c and BSP.c. Further BSP files like BSP_Uart.c are optional.

What's included

All necessary initialization code to run embOS and a project for the IDE of your choice.

What's not included

The embOS board support package does not include any code for additional peripherals like I²C or SPI.
If those are required, hardware abstraction layers from your silicon vendor (e.g. STM32Cube HAL) seamlessly integrate with embOS.

Where to find the BSPs in the embOS shipment

Every embOS shipment includes a folder /Start/BoardSupport, which includes further sub-folders grouped by silicon and board vendors. In each of these sub-folders you will find one or more board support packages. Each board support package is named <device name>_<board name>.

embOS BSP folders

What shall I do when no BSP for my specific hardware was included with the embOS shipment?

In case no BSP for your exact hardware was shipped with embOS, you may choose to:

  • use a BSP for another evaluation board but with the same device
  • create the BSP on your own
  • contact SEGGER to create the BSP

In the latter case please send us detailed information about your hardware. The hardware can be an evalboard or even your custom hardware.

Conclusion

If you want to run embOS on a specific device and hardware please select the according embOS port first. This embOS port must support the core of your device and the compiler of your choice. You can then check if an according BSP is already included.

In case of doubt please don't hesitate to contact us.