Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Arm Community blogs
Arm Community blogs
Embedded and Microcontrollers blog Using SOMNIUM DRT with STM32 devices
  • Blogs
  • Mentions
  • Sub-Groups
  • Tags
  • Jump...
  • Cancel
More blogs in Arm Community blogs
  • AI blog

  • Announcements

  • Architectures and Processors blog

  • Automotive blog

  • Embedded and Microcontrollers blog

  • Internet of Things (IoT) blog

  • Laptops and Desktops blog

  • Mobile, Graphics, and Gaming blog

  • Operating Systems blog

  • Servers and Cloud Computing blog

  • SoC Design and Simulation blog

  • Tools, Software and IDEs blog

Tags
  • Arm
  • stm32 tools
  • STM32
  • stmicroelectronics
  • Cortex-M
  • somnium
Actions
  • RSS
  • More
  • Cancel
Related blog posts
Related forum threads

Using SOMNIUM DRT with STM32 devices

Daniel O'Hara
Daniel O'Hara
September 21, 2016

SOMNIUM DRT is is a set of development tools for ARM Cortex-M based devices such as the STM32 devices from STMicroelectronics. It is fully compatible with industry-standard tools such as the GNU toolchain and Eclipse IDE. DRT uses our patented techniques to produce highly optimized code by exploiting information about the embedded processor and the memory system to deliver improved performance, lower code size and reduced energy use.

There are three main routes for creating an STM32 project in DRT.

1. You can use the New Project Wizard in DRT to quickly create a project targeted at the STM32 device you are using. This will not immediately give you access to all the STM32Cube software enablement.

2. You can use the STM32CubeFx package for the board or device you are using. This includes a number of example projects that can get you started with specific peripherals and middleware. It also includes a blank "template" project to get you started.

3. You can use the STM32CubeMX program to create a new project for your target, including all the necessary libraries, drivers, middleware and initialization code.

This articles will discuss those last two options in a bit more detail. We also have a couple of videos that will talk you through the process.

Using STM32Cube

STM32Cube is a set of tools and software from STMicroelectronics to make it easier to develop applications for STM32 microcontrollers. It consists of firmware and software package for specific device families. These include the hardware abstraction layer (HAL), drivers, middleware, examples, and so on. There is also a tool called STM32CubeMX which provides a graphical interface to create and configure a project then generate the appropriate initialization code.

There is an STM32Cube software package for each class of devices, for example STM32CubeF0, STM32CubeF4 and so on. You can download the software for your target from the STMicroelectronics website. This is a zip file containing the libraries, drivers, middleware, documentation and examples.

Under the Projects directory there are examples for several boards. These are organized as follows:

  • The Example programs only use the hardware abstraction layer (HAL) and board support package (BSP) libraries.
  • The Application demos show how to use the available middleware. They are organized either by middleware or by product feature.
  • The Demonstrations directory contains programs that use the maximum number of peripherals and middleware stacks to demonstrate the product features.
  • Then there is a Template directory, which contains an "empty" program with the essential infrastructure to get started with your target hardware.

All of these examples are available for several different developments systems. You can easily import any of these examples into DRT by selecting the Atollic TrueSTUDIO project. DRT will import that and convert it into a DRT project. You can then build it, run it one the target hardware, and use it as the basis for your own application.

This video will explain the whole process in more detail. It shows how to import one of the standard STM32Cube examples.

Using SOMNIUM DRT with a STM32 device - YouTube

Creating a project with STM32CubeMX

STM32CubeMX is a program that runs on your PC to generate projects for STM32 systems. You can select the target for the project by choosing a specific microcontroller or a development board. This creates an initial configuration for the project. You can use the GUI to set up the pinouts, select middleware components, configure the clocks and other settings. For example, you can configure the GPIO pins to drive an LED.

When you click the "generate code" button, a project will be created in the workspace you specify. You should choose the Atollic project format as this can be automatically imported into DRT. After importing the project into DRT, you can add your own code, build and run the project on the target hardware.

This video will explain the whole process in more detail. It uses STM32CubeMX to create a program that flashes the LED on the board.

Using SOMNIUM DRT and STM32CubeMX - YouTube

Summary

DRT provides industry-leading optimization, resulting in smaller and faster code which uses less energy. It supports the latest C and C++ standards, including C++ exceptions and is extensively tested by several test and validation suites. Comparing the "out of the box" (that is, with no attempt to apply any toolchain-specific optimizations) figures for one of the standard STM32Cube demo programs we can see that DRT significantly reduces the memory requirements.

.text.data.bssROMRAM
DRT 3.3 31,36821218,91630.818.7
SW4STM3238,78422418,92338.118.7
Atollic50,3321,44818,96850.619.9

When built using DRT, the program uses significantly less ROM space. This could mean that you can use a lower cost device, or you can add more functions to your system. For more information on benchmarking and results, see the white paper on our website.

In addition, DRT has some advanced debugging tools which can speed your development process. This includes live view of expressions while the program is running, trace and fault diagnosis.

A free trial of DRT is available from the SOMNIUM Portal.

DRT provides automatic import of projects from other Eclipse-based development environments, making it simple to evaluate. Download your free trial today from the SOMNIUM Portal and try it for yourself.

Anonymous
Embedded and Microcontrollers blog
  • Adapting Kubernetes for high-performance IoT Edge deployments

    Alexandre Peixoto Ferreira
    Alexandre Peixoto Ferreira
    In this blog post, we address heterogeneity in IoT edge deployments using Kubernetes.
    • August 21, 2024
  • Evolving Edge Computing and Harnessing Heterogeneity

    Alexandre Peixoto Ferreira
    Alexandre Peixoto Ferreira
    This blog post identifies heterogeneity as an opportunity to create better edge computing systems.
    • August 21, 2024
  • Demonstrating a Hybrid Runtime for Containerized Applications in High-Performance IoT Edge

    Chris Adeniyi-Jones
    Chris Adeniyi-Jones
    In this blog post, we show how a hybrid runtime and k3s can be used to deploy an application onto an edge platform that includes an embedded processor.
    • August 21, 2024
  • I Develop For
    • AI
    • Automotive
    • Embedded and Microcontrollers
    • IoT
    • Laptops and Desktops
    • Mobile, Graphics, and Gaming
    • Servers and Cloud Computing
  • Learn
    • Documentation
    • Learning Paths
    • On-Demand Videos
  • Community and Blogs
    • Communities
    • Blogs
    • Developer Events
    • Discord
    • Forums
    • Groups
  • Support
    • Open a Support Case
    • My Support Cases
    • Contact Support
    • Product Support Forums
    • Documentation
    • Downloads
    • Licensing
    • Support and Training Options
  • CPU and Hardware
    • Architectures
    • Compare IP
    • Compute Subsystems
    • Corstone
    • Memory Model Tool
    • Performance Analysis
    • Processors
    • Reference Designs
  • About Arm
    • Leadership
    • Arm Offices
    • Careers
    • Contact Us
    • Newsroom
    • Trust Center

arm
  • Cookie Policy
  • Glossary
  • Terms of Use
  • Privacy Policy
  • Accessibility
  • Subscription Center
  • Trademarks
Copyright © 1995-2025 Arm Limited (or its affiliates). All rights reserved.