Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » eTrice » Build Etrice with STM32
Build Etrice with STM32 [message #1839739] Fri, 26 March 2021 21:38 Go to next message
John Tordur Kvilt Sevdal is currently offline John Tordur Kvilt SevdalFriend
Messages: 1
Registered: March 2021
Junior Member
Hello,
I'm trying to set up eTrice for my custom STM32 board. I'm using
Platformio for building and deploying the embedded code.
I have tried following the DAVE tutorial and adapting it for my system
instead, but when I use the wizard like in the tutorial the generator
only generates the following files in my model folder:
* et_blinky.etmap
* et_blinky.etphys
* et_blinky.room
According to the tutorial I should get more files:
I seem to be missing
* etrice_c_runtime
* etrice_c_modellib
The launch script are generated correctly.
I have tried to include files from org.eclipse.etrice.runtime.c and
org.eclipse.etrice.runtime.cpp and referring to the sources and
include paths in my build scripts. This lets me build more of my
project but errors on
lib/etrice/src/common/modelbase/RTSystemProtocol.h:11:10: fatal error:
common/modelbase/RTSystemServicesProtocol.h: No such file or directory
11 | #include "common/modelbase/RTSystemServicesProtocol.h"

So I have identified that the header for RTSystemServicesProtocol.h is
a generated header. And it is generated when the etrice_modellib is
properly included in the project, I have identified the modelpath
file, and tried to insert the full path to the etrice.modellib.cpp in
this file, and the generator cannot seem to find this folder.


So my question is, where do I start looking if I want to start cross
compiling a project for an MCU?
If I get it working I will gladly contribute with an updated tutorial :)
Re: Build Etrice with STM32 [message #1840057 is a reply to message #1839739] Tue, 06 April 2021 08:36 Go to previous messageGo to next message
Christian Hilden is currently offline Christian HildenFriend
Messages: 4
Registered: November 2018
Junior Member
Hello John,

sorry for the late reply. First of all thank you for copying this message to the forum.

Your post triggered quite a bit of offline discussion on how eTrice could support different embedded platforms in the future.

Unfortunately the eTrice DAVE support is no longer maintained. We are not really sure in which state it currently is. Therefore the DAVE part of the documentation should probably be removed in the near future.

From your question I am not really sure whether you are trying to setup a c or c++ project? If you do not have any specific need for c++ I suggest you stick with c. Most eTrice projects we know of use the c code generators. The c++ part is not very well tested.

Currently the easiest way get an eTrice stm32 project up and running is to use eTrice together with STM32Cube (either MX or the IDE) using gradle as build tool (protossoftware.github.io/etrice-gradle-plugin). Our tested setup is based on the single threaded 32bit runtime (ST_32Bit_Generic) which is part of the eTrice project.

Cheers
Christian
Re: Build Etrice with STM32 [message #1840138 is a reply to message #1840057] Wed, 07 April 2021 09:52 Go to previous messageGo to next message
Juergen Haug is currently offline Juergen HaugFriend
Messages: 6
Registered: May 2015
Junior Member
Hello John,

first, can you create the necessary files as described in the first part of the dave tutorial:

1. In Eclipse create a dummy CDT project
2. Use the C "New Set of eTrice Models" wizard. Make sure to select "Copy C-Runtime into project" and select platform "ST_32Bit_Generic".

The project is configured for Eclipse CDT and I would propose the following changes to simplify the setup:
1. Delete the folder "etrice_runtime\src\platforms\ST_32Bit_Generic\etSingleThreadedProjectSpecific_Examples"
2. Move the folder "etrice_modellib\model\etrice" into your model folder and delete the folder "etrice_modellib" entirely (remaining files not needed)

Now you can integrate the files into your project.
1. Move the content to the top-level of your project. Import the project into Eclipse to use the editors and run the generator.
2. Adapt the generation launch script (gen_BlinkyTutorial.launch). Below is an example. You can configure the project path (ModelFiles) and the source generation path (SrcgenPath). Be aware, that the generator is cleaning the source directory automatically. I think Platformio is only supporting a single source folder, if this is the case, use for example "src/etrice".
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.etrice.generator.launch.c.launchConfigurationType">
    <booleanAttribute key="DataLogging" value="true"/>
    <booleanAttribute key="Debug" value="false"/>
    <stringAttribute key="GenModelPath" value=""/>
    <booleanAttribute key="GenerateDepsWithinProject" value="true"/>
    <booleanAttribute key="Lib" value="false"/>
    <booleanAttribute key="MSC" value="false"/>
    <stringAttribute key="MainMethodName" value="etStart"/>
    <listAttribute key="ModelFiles">
        <listEntry value="${workspace_loc:/BlinkyTutorial/model/BlinkyTutorial.etmap}"/>
    </listAttribute>
    <booleanAttribute key="OldStyleTransitionData" value="false"/>
    <booleanAttribute key="OverrideDirectories" value="true"/>
    <booleanAttribute key="SaveGenModel" value="false"/>
    <stringAttribute key="SrcgenPath" value="src/etrice"/>
    <booleanAttribute key="UseTranslation" value="true"/>
    <booleanAttribute key="Verbose" value="false"/>
    <booleanAttribute key="cppFileExtensions" value="false"/>
    <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
    <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
        <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
    </listAttribute>
</launchConfiguration>

3. Build and link the "etrice_runtime" as a C library. The exact location does not matter. The includes paths are : "src/common", "src/config" and "src/platforms/ST_32Bit_Generic"
4. Call the function specified in MainMethodName to let etrice run.
Optionally: In src/confg/etRuntimeConfig.h you might want to undef ET_LOGGER_ACTIVATE, this is a logging option which provides msc charts (see Getting Started C) but it does work for embedded devices out-of-the-box and consumes resources.

I hope the steps help you to integrate etrice.
  • Attachment: Template.png
    (Size: 7.41KB, Downloaded 100 times)
Re: Build Etrice with STM32 [message #1848514 is a reply to message #1840138] Mon, 06 December 2021 14:13 Go to previous message
Tim Butler is currently offline Tim ButlerFriend
Messages: 9
Registered: March 2012
Junior Member
Hi,

I know this thread is a bit old, but as I've started working on an STM32 project and was thinking of trying eTrice, I wanted to touch base to see if there is any further input regarding this topic. Did I understand correctly that the suggestion in the most recent reply was to develop the eTrice application, along with its runtime and modellib, as a separate Eclipse library project and reference that library from the STM32 IDE of choice (STM32CubeIDE in my case)?

Thanks and best regards,
Tim

Previous Topic:[announce] eTrice 3.2.0 released
Next Topic:[announce] eTrice moved to Eclipse GitLab
Goto Forum:
  


Current Time: Tue Apr 23 07:36:59 GMT 2024

Powered by FUDForum. Page generated in 0.03855 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top