Wednesday, October 18th 2017, 7:25am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Date of registration: Apr 8th 2015

Posts: 8

Location: Darmstadt, Germany

Occupation: Software Developer

1

Tuesday, March 1st 2016, 11:36am

embOS and STM32 CubeMX

Hi,

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
Stefan

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 32

2

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,
Martin

bkiepke

Beginner

Date of registration: Mar 1st 2017

Posts: 2

3

Wednesday, March 1st 2017, 4:26pm

Hi,

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)


SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 255

4

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,
Til