The Firmware Component Architecture
There is another concept I need to explain before start using the IDE. It is the Firmware Component Architecture. Each part of ODeV is designed in order to make easy to build firmware in a modular way.
The target of a firmware component is to provide a set of source files exporting some features organized in a set of related tasks. But it is not only source files. A firmware component contains also all needed resource to work with ODeV.
Let me show an example. Image I want to build an empty multitasking C++ application for the STM32F107 mcu, and I want to build it on a Mac host. I can split such kind of application (a template) in the following components:
-
‣The ST Standard Library for STM32F107
-
‣The FreeRTOS scheduler
-
‣The FreeRTOS Extension Class (to provide C++ API to FreeRTOS)
-
‣The Application specific files. Let me name it mCortex_STM32F107_CPP_Template
Figure 1 shows the dependence diagram of these components. An arrow from the component A to the component B specifies that the component A need the component B in order to build itself.
Fig.1 - The Components Dependence Graph
Each component is an Eclipse Project. To build with success the mCortex_STM32F107_CPP_Template project I need in the same workspace all components it depend on. Figure 2 shows the Eclipse workspace for this example.
Fig.2 - Eclipse Workspace
There are two fundamental type of components:
-
‣Application Component
-
‣Library Component
For example the FreeRTOS component is a Library. It is not a standalone application able to run on the MCU, but it provides the multitasking features used by all applications. On the other hand the mCortex_STM32F107_CPP_Template component is an Application.
The Firmware Component Directory Structure
A Firmware Component has a well defined directory structure depending on its nature. Figure 3 shows the directory structure of a firmware component.
Fig.3 - Directory Structure
Each Component has a Source folder containing all source files organized in a component specific way. The following folders are specific for an Application Component:
-
‣OpenOCD folder: contains all OpenOCD configuration files needed by OpenOCD to program and debug the MCU using Versaloon.
-
‣Documents folder: contains the component documentation and other files.
The following folders are specific for a Library Component:
-
‣Test folder: contains all file needed to compile and test the library but that are not needed by a project using the component.
-
‣Documents folder: this is an optional folder. It contains components documentation and other files.
About the Component naming convention
Each component name is composed by three part:
[HOST_PLATFORM] <PROJECT_NAME> [COMPONENT_TYPE]
where
[HOST_PLATFORM] if it exists it specifies the host I used to develop the component and it is one of:
-
‣l for Linux
-
‣m for Mac
-
‣w for Windows
<PROJECT_NAME> is the project name
[COMPONENT_TYPE] if exists it specifies the type of the component, and is one of:
-
‣_Template. A template component is an empty project with a main that only perform the hardware setup and and the FreRTOS multitasking environment. It is useful to start a new project.
-
‣_Demo. A demo component is a project showing how to use some features like lwIP etc.
For example the wCortex_STM32F1xx_CPP_Template is a template C++ project developed on (and ready to) Windows.