Tuesday, May 22nd 2018, 4:34am UTC+2

You are not logged in.

  • Login
  • Register

Date of registration: Apr 8th 2015

Posts: 8

Location: Darmstadt, Germany

Occupation: Software Developer


Tuesday, March 1st 2016, 11:36am

embOS and STM32 CubeMX


I would like to base embOS on a HAL/BSP which is generated by STM32 CubeMX.

Currently, I am just looking for some hints or links to any documentation I should read.

The situation is that everything (HAL/BSP and embOS) compiles, links, and loads perfectly.
I can step through the code stating from the reset-vector.

As soon as OS calls or timer interrupts occur the CPU is entering OS_Error
for different reasons, depending on the modifications to the code I make.

I am using the "Cortex-M, Rowley" port of embOS.

Thanks for any hint

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 35


Tuesday, March 1st 2016, 3:33pm

Dear Stefan,

The latest release of embOS for Cortex-M and Rowley did include the "User & Reference Guide for embOS". Chapter 24.2 of that guide (starting on page 381) displays a table of each possible error code together with a short explanation. If you feel any of these descriptions is unclear or insufficient, please do not hesitate to contact us for further information.

Best regards,



Date of registration: Mar 1st 2017

Posts: 2


Wednesday, March 1st 2017, 4:26pm


a little late maybe, but I am a little step further.
I created a STM32CubeMX-setup for an Nucleo-64 (STM32L476) -> HAL
I also copied the default embOS-example for that controller -> embOS

In OS_StartLEDBlink.c:
  1. include main.h from HAL
  2. include stm32l4xx_hal.h from HAL
  3. copy content of HAL-main() to the beginning of the embOS-main(), before the call of OS_InitKern()
  4. copy all other functions from HAL-main() to the end of the embOS-main().
  5. drop call of BSP-functions from embOS (do't need that file at all) and call HAL_GPIO_TogglePin() instead
In RTOSInit_STM32L4xx_CMSIS.c:
  1. include stm32l4xx_hal.h instead of stm32l4xx.h (the _hal-File is the only header needed using HAL, as described in ST-document UM1884)
  2. move HAL-functions from HAL-SysTickHandler to embOS-SysTickHandler. I append the functions after the call of OS_LeaveNestableInterrupt()
In Start_STM32L46.emProject (embOS-Project-File used bei Embedded Studio)

  1. alter the include-path "c_user_include_directories" to contain all .h-files of HAL
  2. include all .c-files in Embedded Studio
  3. exclude all files of CoreSupport
  4. exclude all files of DeviceSupport
I now have a blinking green LED by using the STM32HAL.
Best regards

This post has been edited 1 times, last edit by "bkiepke" (Mar 1st 2017, 4:28pm)


Super Moderator

Date of registration: Nov 14th 2007

Posts: 271


Wednesday, March 1st 2017, 4:30pm

Thanks for sharing this with us.
I guess this could be also of interest for other embOS users.

Best regards,