Industrial IoT

The Internet transformed how people communicate, what they do and how they work together. Now, it is connecting machines and devices together into intelligent systems that will transform the world. These connected systems make up the Industrial IoT (IIoT).

Products

RTI provides the intelligent connectivity framework designed for the Industrial IoT. RTI Connext DDS delivers the edge-to-cloud connectivity software needed to streamline, control and monitor the most demanding IIoT systems.

Services

There’s no room for error in designing, integrating and deploying mission-critical Industrial IoT systems. The Professional Services team works with RTI customers to increase efficiency and drive project success.

Developers

From downloads to Hello World, we've got you covered. Find all of the tutorials, documentation, peer conversations and inspiration you need to get started using Connext DDS today.

Resources

RTI provides a broad range of technical resources to learn about the RTI Connext product line and its underlying Object Management Group (OMG) Data Distribution Service (DDS) technology.

Company

RTI is the Industrial Internet of Things connectivity company. Across industries and across the world, companies trust RTI software and services to make their mission-critical applications work as one.

How to Build and Run RTI Connext DDS Micro on a Microcontroller

As you might know, we ship a buildable source for RTI Connext DDS Micro so you can build it for your own architecture. In the past few months, we have noticed that customers are interested in building our product for microcontrollers without a Memory Management Unit (MMU), and they’re using a uClibc-based OS. The purpose of this post is to support this expressed need and illustrate how to port RTI Connext DDS Micro to uCLinux with relatively few changes. The development board that we will use in this practical example is STM32F769I-DISCO. You should be able to extrapolate it to any other board by knowing your toolchain. You can even extrapolate it to any other OS that uses uClibc!

Let’s get started.

Enabling Multithreading Support

In order to work with RTI Connext DDS Micro, you will need support for pthreads library. Make sure to enable it in your uCLinux OS. The uClibc included in codesourcery toolchain does not have posix threads support. For our board, Emcraft implemented it and shipped it with their board support package. You will need access to their cross development environment. Unpack it in any folder you want (we will call it <cross-dev-dir> here), and follow the instructions in the EMCraft web link provided.

After following the steps, you should find the libs (including pthread) in the following folder:

<cross-dev-dir>/A2F/root/usr/lib

And the header files in this one:

<cross-dev-dir>/A2F/root/usr/include

Finally, you should have the toolchain in:

<cross-dev-dir>/tools/arm-2010q1

And the binaries (gcc, g++, gdb…):

<cross-dev-dir>/tools/arm-2010q1/bin

You can run the ACTIVATE.sh script provided by Emcraft or just add <cross-dev-env-dir>/tools/arm-2010q1/bin to your path. After that, you can build your threaded application with the following line:

Compile Static Micro Libraries

Get the cross development and toolchain, and install them as explained in *Enabling multithreading support*.

Make sure to have <cross-dev-dir>/tools/arm-2010q1/bin in your PATH.

Get the buildable sources for Micro. Unpack them in a different dir. We will work in the <buildable_source_folder>/source/unix/ directory, so all paths will part from there.

Modify resource/cmake/cmake_module.txtfile with this patch file. This allows us to not compile dynamic libraries since uCLinux does not support dynamic linking. To patch the file, copy the cmake_modules.txt.patch to resource/cmake/ and run the following command:patch < cmake_module.txt.patch

In src/osapi/posix/posisSystem.c (OSAPI_SystemPosix_timer_thread() func):Replace clock_nanosleep() calls with nanosleep() function. Leave only the last two arguments in the call to nanosleep.

In src/osapi/posix/posix/posixThread.c (OSAPI_Thread_sleep() func):The same as in bNote: you can also avoid errors in 6.b and 6.c by adding the line ADD_DEFINITIONS(-DUSE_TIMER_THREAD_SLEEP) to the uCLinux.tc file downloaded in step 5.a

(From <buildable_source_folder>/source/unix) Run the rtime_make script:

Then you only have to edit the makefile for your application, to use the correct compiler, and the right flags, headers, and includes. You will have to use the cross development environment folder. Add the following to your makefile:

Header files: add the folder <cross-dev-folder>/A2F/root/usr/include

Library files: add the folder: <cross-dev-folder>/A2F/root/usr/lib

Compiler flags: -mthumb -march=armv7 -mfix-cortex-m3-ldrd

Compiler: arm-uclinuxeabi-gcc

As a simple test, we will use the shipped HelloWorld_dpde example with a properly-modified Makefile. To avoid hardcoding paths, it’s assumed that you will put the cross development environment path into an environment variable called CDE_DIR. Also include the arm-uclinuxeabi-gcc in your PATH, and set RTIMEHOME and RTIMEARCH as usual. You can find the modified Makefile here.

That’s it! For more information and additional tutorials head on over to the RTI Community. If you’re up for some more fun, I suggest you visit RTI Labs and take one of our experimental projects for a test drive.