Skip to content

Commit

Permalink
Bugfix release of foxBMS 2 (v1.1.2)
Browse files Browse the repository at this point in the history
added Axivion configuration
added system block diagram
  • Loading branch information
foxBMS committed Sep 3, 2021
1 parent 329216a commit 3b6acc4
Show file tree
Hide file tree
Showing 103 changed files with 5,701 additions and 251 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We therefore release foxBMS with permissive licenses:
**Creative Commons Attribution 4.0 International License (SPDX short identifier: CC-BY-4.0)**
- Software: **BSD 3-Clause License (SPDX short identifier: BSD-3-Clause)**

For details see the [LICENSE](../LICENSE) file and the
For details see the [LICENSE.md](../LICENSE.md) file and the
[license documentation](https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/latest/general/licenses.html).

However foxBMS is not openly developed on GitHub (or any other platform). The
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ tools/waf-sig*
*.bz2
*.gz
*.zip
# do not ignore zip in hardware
!/hardware/*.zip
*.7z

__pycache__
Expand Down
2 changes: 1 addition & 1 deletion conf/env/paths_win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ C:\Program Files\Cppcheck\Cppcheck-2.2-x64
C:\Program Files\LLVM\11.0.1\bin
C:\Ruby\Ruby272-x64\bin
C:\MinGW64\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin
C:\Bauhaus\7.2.0\bin
C:\Bauhaus\7.2.3\bin
1 change: 0 additions & 1 deletion conf/fmt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ exclude = '''
| tools/waf3-2.0.22-1241519b19b496207abef1f72bbf61c2
)/
| docs/conf.py
| tests/axivion
| tools/vendor
| tools/waf-tools/why.py
)
Expand Down
5 changes: 3 additions & 2 deletions conf/guidelines/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
".vscode/**",
".mypy_cache/**",
"build/**",
"libbuild/**",
"build-tools-tests/**",
"conf/hcg/include/*",
"conf/hcg/source/*",
Expand Down Expand Up @@ -45,7 +46,6 @@
"tools/vendor/**",
"tools/waf",
"tools/waf-verify-sig.py",
"tests/axivion/**",
"tests/scripts/waf-tools/f_guidelines/tests/**",
"tests/scripts/waf-core/general/**",
"tests/scripts/waf-core/init/**",
Expand All @@ -70,7 +70,8 @@
"conf/hcg/**/*.c",
"conf/hcg/**/*.h",
"src/app/driver/mic/nxp/common/MC33775A.h",
"src/os/freertos/README.ti-halcogen.md"
"src/os/freertos/README.ti-halcogen.md",
"tests/axivion/cafeCC.config"
]
},
"unique_filenames": {
Expand Down
1 change: 1 addition & 0 deletions conf/spa/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ good-names=p,
i,
j,
k,
m,
ex,
Run,
f,
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
"https://gitlab.com/ita1024/waf/-/blob/3536dfecf8061c6d99bac338837997c4862ee89b/waflib/TaskGen.py#L495-527",
"https://gitlab.com/ita1024/waf/-/blob/3f8bb163290eb8fbfc3b26d61dd04aa5a6a29d4a/waf-light#L6-30",
"https://www.misra.org.uk/",
"../_images/battery-system-setup.png",
"../_images/battery-system-setup-pack.png",
"../_images/battery-system-setup-bjb.png",
"../_images/battery-system-setup-single-string.png",
]

html_theme_options = {
Expand Down
5 changes: 4 additions & 1 deletion docs/developer-manual/software/software-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ The following tools are shown in :numref:`mapping-of-third-party-tools`.
| waf | build automation system | T3 | controls build process; generates |
| | | | version dependent code |
+-----------------+-------------------------+-------------+----------------------------------------+
| Cppcheck | static program | T1 | just a helper for the static analysis; |
| Axivion Suite | static program | T2 | |
| | analysis tools | | |
+-----------------+-------------------------+-------------+----------------------------------------+
| Cppcheck | static program | T1 | just a helper for the static analysis; |
| | analysis tools | | Axivion is used as the main tool |
+-----------------+-------------------------+-------------+----------------------------------------+
| sphinx | documentation tools | T1 | just a rendering tool for |
| | | | the documentation text files |
+-----------------+-------------------------+-------------+----------------------------------------+
Expand Down
6 changes: 5 additions & 1 deletion docs/developer-manual/software/software-verification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ Software Analysis
-----------------

The source code is subject to a static program analysis. These tests are
performed by Cppcheck (see :numref:`CPPCHECK`).
performed by Axivion Suite and Cppcheck (see :numref:`AXIVION_BAUHAUS_SUITE`
and :numref:`CPPCHECK`).

The architecture is verified by the Axivion Suite (see
:numref:`AXIVION_BAUHAUS_SUITE`)
4 changes: 2 additions & 2 deletions docs/developer-manual/style-guide/examples/c-011.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
* @details Detailed description of this function
* @return some uint8_t which describes xyz
*/
static uint8_t ABC_Another_Function(void);
static uint8_t ABC_AnotherFunction(void);

static uint8_t ABC_Another_Function(void) {
static uint8_t ABC_AnotherFunction(void) {
/* code */
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/developer-manual/style-guide/examples/c-019.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct POINT {
typedef struct PATH {
POINT_s point;
uint32_t timestamp;
uint32_t prevTimestamp;
uint32_t previousTimestamp;
uint8_t name[16];
} PATH_s;

Expand All @@ -63,7 +63,7 @@ uint64_t myVar3 = 10uLL;
int8_t myVar4 = -10;
int16_t myVar5 = -10;
int32_t myVar6 = -10;
int32_t myVar7 = -10LL;
int64_t myVar7 = -10LL;

/* Initialization example for arrays */
uint8_t myArrayA[] = {1, 2, 3}; /* Array has type uint8_t[3] and holds 1,2,3 */
Expand Down
4 changes: 2 additions & 2 deletions docs/developer-manual/style-guide/guidelines_c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ installed (see :ref:`software_prerequisites`) using :kbd:`Ctrl-S`.
.. warning::

The style of third party sources (generated HAL sources in
``build/bin/src/hal/**`` and ``src/os``) should not be changed. To save
without reformatting use :kbd:`Ctrl-K + Ctrl-Shift-S`.
``build/bin/src/hal/**`` and ``src/os``) should not be changed.
To save without reformatting use :kbd:`Ctrl-K + Ctrl-Shift-S`.

The following list shows more detailed rules for |foxbms|. Every rule has some
context and/or rationale and notes that clearly state the rules, followed by a
Expand Down
56 changes: 56 additions & 0 deletions docs/general/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,61 @@ Versioning follows then these rules:
- increasing ``MINOR`` adds functionality in a backwards compatible manner
- increasing ``PATCH`` fixes bugs in a backwards compatible manner

********************
[1.1.2] - 2021-09-03
********************

Added
=====

- A basic block diagram and description of a battery system and the voltages
and the currents that need to be measured have been included in the
documentation.
- Add helper script to run the library test build
(``tests/variants/lib-build/lib-build.bat``).
- Updated the Axivion configuration to use version 7.2.3.
- Added minimal documentation for Axivion setup.
- Improved the Axivion configuration:

* use ``FAS_ASSERT`` as assert macro in order to be compliant with the style
guide
* fix some includes (library-inclusions and unnecessary inclusions)
* adds the Axivion example for race condition analysis and a minimal
configuration of entry points
* updates .axivion.preinc with missing symbols
* makes cafeCC point to the right compiler library
* excludes vendored code from analysis
* disables all naming conventions (as they are currently not configured and
thus horribly noisy)
* disables the NoImplicitTypeConversion check as it is very noisy and better
done with appropriate MISRA rules
* detect unsafe variable access by defining task priorities
* make Axivion less noisy, by disabling unused style-checks.
* Made rules for loop-counter variables more strict.
* enabling more detailed computation of findings (Abstract Interpretation in
Static Semantic Analysis).

Changed
=======

- Improved the code quality of the module ``foxmath`` so that it is
MISRA-compliant (:numref:`FOXMATH`).
- Refactored ``cc-options`` parsing to separate tool to simplify the TI ARM CGT
compiler tool.

Deprecated
==========

Removed
=======

Fixed
=====

- When HALCoGen was not available, the waf tool nevertheless tried to set the
respective include path, which lead to exception in Python. This has been
fixed by not trying to set the include path when HALCoGen is not available.

********************
[1.1.1] - 2021-08-06
********************
Expand Down Expand Up @@ -528,6 +583,7 @@ Removed

- Removed the deprecated Anaconda extension from the list of recommended
Visual Studio Code plugins that is shipped with the project.
- Suppressed the (uncovered) ADI-driver from the unit-test-report.

Fixed
=====
Expand Down
1 change: 1 addition & 0 deletions docs/general/releases.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
foxBMS 2; Release Date; Permanent link to documentation
v1.1.2; 2021-09-03; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.1.2/
v1.1.1; 2021-08-06; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.1.1/
v1.1.0; 2021-07-29; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.1.0/
v1.0.2; 2021-04-30; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.0.2/
Expand Down
6 changes: 6 additions & 0 deletions docs/getting-started/repository-structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ The ``tests`` directory is structured into the following parts (see
+--------------------+--------------------------+--------------------------------------+
| directory | long name | content description |
+====================+==========================+======================================+
| ``tests/axivion`` | Axivion | configuration files to describe the |
| | | architecture of |foxbms|. Additional |
| | | static program analysis |
| | | configurations are stored here |
| | | (e.g., MISRA-C) |
+--------------------+--------------------------+--------------------------------------+
| ``tests/scripts`` | scripts | unit test of scripts (e.g., Python, |
| | | shell) |
+--------------------+--------------------------+--------------------------------------+
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/software-installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ later steps of this manual.
:caption: Downloading a release
:name: download-foxbms-2
C:\Users\vulpes\Documents>curl -Ss -L -o foxbms-2-v1.1.1.zip https://github.com/foxBMS/foxbms-2/archive/v1.1.1.zip
C:\Users\vulpes\Documents>tar -x -f foxbms-2-v1.1.1.zip
C:\Users\vulpes\Documents>ren foxbms-2-1.1.1 foxbms-2
C:\Users\vulpes\Documents>curl -Ss -L -o foxbms-2-v1.1.2.zip https://github.com/foxBMS/foxbms-2/archive/v1.1.2.zip
C:\Users\vulpes\Documents>tar -x -f foxbms-2-v1.1.2.zip
C:\Users\vulpes\Documents>ren foxbms-2-1.1.2 foxbms-2
C:\Users\vulpes\Documents>cd foxbms-2
.. note::
Expand Down
16 changes: 16 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The documentation is divided in the following parts:
#. :ref:`GETTING_STARTED_OVERVIEW`
#. :ref:`SOFTWARE_DOCUMENTATION_OVERVIEW`
#. :ref:`HARDWARE_DOCUMENTATION_OVERVIEW`
#. :ref:`SYSTEM_DOCUMENTATION_OVERVIEW`
#. :ref:`TOOLS_DOCUMENTATION_OVERVIEW`
#. :ref:`DEVELOPER_MANUAL`

Expand Down Expand Up @@ -70,6 +71,9 @@ in the |doxygen| documentation.
Next, the :ref:`HARDWARE_DOCUMENTATION_OVERVIEW` gives the details needed to
understand the hardware platform developed for |foxbms|.

The :ref:`SYSTEM_DOCUMENTATION_OVERVIEW` provides information on the
integration of |foxbms| in an application.

Numerous tools have been developed or adapted to support developing with the
|foxbms| platform. These tools and their usage are described in
:ref:`TOOLS_DOCUMENTATION_OVERVIEW`.
Expand Down Expand Up @@ -152,6 +156,17 @@ All sections are listed here:
./hardware/design-resources.rst
./hardware/connectors.rst

.. _SYSTEM_DOCUMENTATION_OVERVIEW:

.. toctree::
:titlesonly:
:numbered:
:maxdepth: 1
:caption: System Documentation

./system/system-introduction.rst
./system/system-voltage-and-current-monitoring.rst

.. _TOOLS_DOCUMENTATION_OVERVIEW:

.. toctree::
Expand All @@ -165,6 +180,7 @@ All sections are listed here:
./tools/waf-tools/waf-tools.rst
./tools/debugger/debug-application.rst
./tools/halcogen/halcogen.rst
./tools/static-analysis/axivion.rst
./tools/static-analysis/cppcheck.rst

.. _DEVELOPER_MANUAL:
Expand Down
2 changes: 1 addition & 1 deletion docs/macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. |timestamp| date:: %Y-%m-%d %H:%M:%S

.. |foxbms| replace:: foxBMS 2
.. |version_foxbms| replace:: ``1.1.1``
.. |version_foxbms| replace:: ``1.1.2``
.. |github_foxbms| replace:: https://github.com/foxBMS/
.. |foxbms_repository| replace:: https://github.com/foxBMS/foxbms-2
.. _Fraunhofer IISB: https://www.iisb.fraunhofer.de
Expand Down
42 changes: 22 additions & 20 deletions docs/software/overview/sw-overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,37 @@ Startup
*******

The startup code begins in the function ``_c_int00()`` in
``app/main/fstartup.c``. After initialization of the main
microcontroller registers, memory, system clock and interrupts,
the C function ``main()`` is called.
``app/main/fstartup.c``.
After initialization of the main microcontroller registers, memory, system
clock and interrupts, the C function ``main()`` is called.
In ``general/main.c``, interrupts are enabled and the initializations of the
microcontroller unit, peripherals and software modules are done (e.g.,
hardware modules like SPI and DMA). The OS is than started.The steps are
indicated by the global variable
``os_boot``. At the end of the main function, the operating system resources
(tasks, events, queues, mutex) are configured in
``OS_InitializeOperatingSystem()`` (``os/os.c``) and the scheduler is started.
hardware modules like SPI and DMA).
The OS is then started.
The steps are indicated by the global variable ``os_boot``.
At the end of the main function, the operating system resources (tasks, queues)
are configured in ``OS_InitializeOperatingSystem()`` (``src/app/task/os/os.c``)
and the scheduler is started.
All configured tasks (FreeRTOS threads) are then started depending on
their priority. The successful activation of the tasks is indicated by
their priority.
The successful activation of the tasks is indicated by
``os_boot = OS_RUNNING``.

The OS-scheduler first calls the highest priority task. All other cyclic tasks
are blocked in a while-loop until the initialization of this
task finishes. At the beginning of the task,
``FTSK_InitializeUserCodeEngine()`` is called.
In this function, the database is initialized. Once finished, this is indicated
by ``os_boot = OS_ENGINE_RUNNING``.
The OS-scheduler first calls the highest priority task.
All other cyclic tasks are blocked in a while-loop until the initialization of
this task finishes.
At the beginning of the task, ``FTSK_InitializeUserCodeEngine()`` is called.
In this function, the database is initialized.
Once finished, this is indicated by ``os_boot = OS_ENGINE_RUNNING``.
The function ``FTSK_RunUserCodeEngine()`` is then called, where the diagnostic
module and the database are managed.

Once ``os_boot = OS_ENGINE_RUNNING``, the 1ms cyclic task is unblocked. The
function ``FTSK_InitializeUserCodePreCyclicTasks()`` is called once first.
Once ``os_boot = OS_ENGINE_RUNNING``, the 1ms cyclic task is unblocked.
The function ``FTSK_InitializeUserCodePreCyclicTasks()`` is called once first.
This function is called when the OS and the database are running but before
the cyclic tasks run. Once ``FTSK_InitializeUserCodePreCyclicTasks()`` has
finished, all cyclic tasks are unblocked from there while-loop and run
periodically.
the cyclic tasks run.
Once ``FTSK_InitializeUserCodePreCyclicTasks()`` has finished, all cyclic tasks
are unblocked from there while-loop and run periodically.

****************
Operating System
Expand Down
6 changes: 6 additions & 0 deletions docs/system/bjb-measurements.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Symbol ; Description
V\ :sub:`P` ; Pack voltage
V\ :sub:`FP` ; Pack voltage after main fuse
V\ :sub:`SV` ; System voltage
V\ :sub:`SV2` ; System voltage: second power path
I\ :sub:`P` ; Pack current
Binary file added docs/system/img/battery-system-setup-bjb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/battery-system-setup-pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/battery-system-setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/battery-system-setup.vsdx
Binary file not shown.
Binary file added docs/system/img/blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/contactor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/current-sensor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/dark-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/dark-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/dotted-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/fuse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/imd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/inverter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/msd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/system/img/resistor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/system/system-introduction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. include:: ./../macros.txt
.. include:: ./../units.txt

.. _SYSTEM_INTRODUCTION:

System Introduction
===================
Loading

0 comments on commit 3b6acc4

Please sign in to comment.