+ All Categories
Home > Documents > XDK110 Library Guide

XDK110 Library Guide

Date post: 11-Jan-2022
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
7
XDK110: Getting Started Guide with Binding Libraries Cross-Domain Development Kit XDK110 Platform for Application Development XDK110: Getting Started Guide with Binding Libraries Document revision 2.0 Document release date August 17, 2017 Workbench version 3.0.0 Document number BCDS-XDK110-LIRBRARY-GUIDE Workbench version 3.0.0 Technical reference code(s) Notes Data in this document is subject to change without notice. Product photos and pictures are for illustration purposes only and may differ from the real product’s appearance. This document is confidential and under NDA inherent with the purchase of an XDK110. Advance information – Subject to change without notice
Transcript

XDK110: Getting Started Guide with Binding LibrariesCross-Domain Development Kit XDK110Platform for Application Development

XDK110: Getting Started Guide with Binding Libraries

Document revision 2.0

Document release date August 17, 2017

Workbench version 3.0.0

Document number BCDS-XDK110-LIRBRARY-GUIDE

Workbench version 3.0.0

Technical reference code(s)

Notes Data in this document is subject to change without notice. Product photos and pictures are for illustration purposes only and may differ from the real product’s appearance.This document is confidential and under NDA inherent with the purchase of an XDK110.Advance information – Subject to change without notice

XDK110Platform for Application Development

General Description The XDK is a wireless sensor device developed to enable rapid prototyping for the internet of things (IoT) space. It allows users to quickly realize their own test case (or “Proof of concept” project) and understand what the requirements of their ideal product are.

The XDK comes with a lithium ion battery, an extension board, a micro USB 2.0 cable and mounting plate and screws. The XDK is equipped with 7 physical sensors: Accelerometer, Gyroscope, Magnetometer, Inertial (Accelerometer and Gyroscope), Environmental (Pressure, Humidity, and Temperature), Ambient Noise, and Ambient Light. The XDK has a Micro-SD card slot and two antennas: one for wireless LAN and one for Bluetooth 4.0 communications. The XDK has 3 programmable LEDs, one LED for charge indication, and two programmable buttons.

Development with the XDK is easily done with the XDK Workbench. It is a programming suite based on the Eclipse Platform, which requires a PC with a Windows 7 or higher operating system. The XDK Workbench delivers all of the API’s, source code and demos necessary for new users to quickly and easily start development of their application with the XDK.

This document details how to build and bind a library, for in any project in the XDK Workbench.

This document assumes the user has already downloaded and installed the XDK Workbench. For help on how to download and install the XDK workbench, please navigate to the XDK website (www.xdk.io), click on the Learning tab and view the Workbench Installation guide. The download for the XDK workbench can be found on the XDK website under the Downloads tab.

Placeholder | Bosch Sans Regular 9pt � | �3 7Placeholder | Bosch Sans Regular 9pt � | �3 7Placeholder | Bosch Sans Regular 9pt � | �3 7Placeholder | Bosch Sans Regular 9pt � | �3 7Placeholder | Bosch Sans Regular 9pt � | �3 7Getting Started Guide with Binding Libraries| XDK110 � | �3 7� | �3 7

Table of contents

General Description 2

1. Building a Library for the XDK 4

2. Binding a Library in the SDK 4

3. Document History and Modification 6

4. Appendix 7

Placeholder | Bosch Sans Regular 9pt � | �4 7Placeholder | Bosch Sans Regular 9pt � | �4 7Placeholder | Bosch Sans Regular 9pt � | �4 7Placeholder | Bosch Sans Regular 9pt � | �4 7Placeholder | Bosch Sans Regular 9pt � | �4 7Getting Started Guide with Binding Libraries| XDK110 � | �4 7� | �4 7

1. Building a Library for the XDKTo be able to create your own libraries for the XDK, you first have to create a header file to your library (e.g. „StaticLib.h“) and an associated implementation file (e.g. „StaticLib.c“). Please make sure that your header file contains all function prototypes, type definitions and global variables used in the implementation file before continuing. To ensure your libraries will work properly when flashed on the XDK, please use the armGCC compiler provided with your XDK Workbench installation. To do so, please browse to the armGCC compiler binary folder using your windows command line. The default path for the armGCC compiler binary folder is C:\XDK-Workbench\armGCC\bin.

Create a library object file (e.g. „StaticLib.o“) using the command below. This command will build a library object file including all necessary flags for the cortex-m3 micro-controller on the XDK. Make sure to replace $PATH with the path of your implementation file.

arm-none-eabi-gcc $PATH\StaticLib.c -c -Wall -pedantic -mcpu=cortex-m3 -mthumb -o $PATH\StaticLib.o

Once the library object file was successfully created, build an archive file (e.g. „StaticLib.a“) using the command below. The archive file will work without any issues on the XDK. Make sure to replace $PATH with the path of your archive file.

arm-none-eabi-ar -r $PATH\StaticLib.a $PATH\StaticLib.o

To make these steps easily repeatable, you might consider creating a batch (.bat) file with these two command lines. Batch files can be run from terminal and execute the code written into it.

2. Binding a Library in the SDKWe strongly recommend making a copy of your current SDK before proceeding. This ensures that you still own a copy of the original SDK, in case the SDK gets corrupted during or after the editing process.

Browse to the SDK libraries folder and create the folder „OwnLibs“. The default path of the SDK libraries folder is C:\XDK-Workbench\SDK\xdk110\Libraries. Create a subfolder „include“ and put your header files into it (e.g. „StaticLib.h“). Create another subfolder „source“ and put your archive files into it (e.g. „StaticLib.a“). Afterwards, you need to make some changes in the makefiles within the common folder of the SDK. You can find the common folder by navigating to SDK > xdk110 > Common within your Project Explorer using the XDK Workbench.

Open the file „application.mk“. Browse down to the end of #Root paths to 3rd party packages on which xdk applications depends and add the following code snippet to it:

OWN_LIBRARIES_DIR = $(BCDS_LIBRARIES_PATH)/OwnLibs

Picture 1:Platform and Library paths of the application.mk file

Placeholder | Bosch Sans Regular 9pt � | �5 7Placeholder | Bosch Sans Regular 9pt � | �5 7Placeholder | Bosch Sans Regular 9pt � | �5 7Placeholder | Bosch Sans Regular 9pt � | �5 7Placeholder | Bosch Sans Regular 9pt � | �5 7Getting Started Guide with Binding Libraries| XDK110 � | �5 7� | �5 7

This defines the path to your own archive and header files.

Now browse down to the end of BCDS_XDK_EXT_INCLUDES and add the following code snippet to it:

-isystem $(OWN_LIBRARIES_DIR)/include

Picture 2:External includes of application.mk file

This sets the include path for the header file associated to your archive file. Now, to ensure that your archive file can be build within your applications, open the file „Libraries.mk“, browse to the end of BCDS_THIRD_PARTY_LIBS and add the following code snippet to it:

$(OWN_LIBRARIES_DIR)/source/StaticLib.a \

�Picture 3:Third party libraries of the Libraries.mk file

If the backslash at the end of the previous line is missing, add one, else this will cause issues.

Save all changes made and rebuild the SDK. Please note that this binding of your own libraries to the makefiles of the XDK is an easy approach and does not distinguishing between particular builds like release, debug or clean.

Getting Started Guide with Binding Libraries| XDK110 � | �5 7

Placeholder | Bosch Sans Regular 9pt � | �6 7Placeholder | Bosch Sans Regular 9pt � | �6 7Placeholder | Bosch Sans Regular 9pt � | �6 7Placeholder | Bosch Sans Regular 9pt � | �6 7Placeholder | Bosch Sans Regular 9pt � | �6 7Getting Started Guide with Binding Libraries| XDK110 � | �6 7� | �6 7

3. Document History and Modification

REV. NO. CHAPTER DESCRIPTION OF MODIFICATION/CHANGES

EDITOR DATE

2.0 Version 2.0 initial release

AFS 2017-08-17

Placeholder | Bosch Sans Regular 9pt � | �7 7Placeholder | Bosch Sans Regular 9pt � | �7 7Placeholder | Bosch Sans Regular 9pt � | �7 7Placeholder | Bosch Sans Regular 9pt � | �7 7Placeholder | Bosch Sans Regular 9pt � | �7 7Getting Started Guide with Binding Libraries| XDK110 � | �7 7� | �7 7

4. Appendix


Recommended