diff --git a/.gitattributes b/.gitattributes index 79c5ba65..240a7c27 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,3 +12,6 @@ tools/waf linguist-vendored # files tracked with Git LFS *.zip filter=lfs diff=lfs merge=lfs -text + +tests/axivion/qualification-test/qualification-kit/**/*.json -diff -merge -text +tests/axivion/qualification-test/qualification-kit/**/*.py -diff -merge -text diff --git a/.gitignore b/.gitignore index 7a3951e5..a2570c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ __pycache__ /qa-chain/* *.log +*log*.txt +*log/* *.patch *.diff @@ -51,3 +53,6 @@ __pycache__ *.exe /races.txt + +# CAN log files +*.asc diff --git a/CITATION.cff b/CITATION.cff index 853ab666..eb9a9532 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -46,5 +46,5 @@ keywords: - "BMS" message: "If the foxBMS project contributes to a project that leads to a scientific publication, please acknowledge this fact by citing." title: "foxBMS - The Most Advanced Open Source BMS Platform: foxBMS 2" -version: "1.4.0" -date-released: 2022-07-29 +version: "1.4.1" +date-released: 2022-10-27 diff --git a/conf/bms/schema/slave.schema.json b/conf/bms/schema/slave.schema.json index fb5faa8a..c6c361a4 100644 --- a/conf/bms/schema/slave.schema.json +++ b/conf/bms/schema/slave.schema.json @@ -132,6 +132,7 @@ "type": "string", "enum": [ "epcos", + "murata", "vishay", "fake" ] @@ -175,7 +176,7 @@ "properties": { "manufacturer": { "enum": [ - "vishay" + "murata" ] } } @@ -184,8 +185,7 @@ "properties": { "model": { "enum": [ - "ntcalug01a103g", - "ntcle317e4103sba" + "ncu15xh103f6sxx" ] } } @@ -195,7 +195,7 @@ "properties": { "manufacturer": { "enum": [ - "fake" + "vishay" ] } } @@ -204,10 +204,31 @@ "properties": { "model": { "enum": [ - "none" + "ntcalug01a103g", + "ntcle317e4103sba" ] } } + }, + "else": { + "if": { + "properties": { + "manufacturer": { + "enum": [ + "fake" + ] + } + } + }, + "then": { + "properties": { + "model": { + "enum": [ + "none" + ] + } + } + } } } } diff --git a/conf/cc/cc-options.yaml b/conf/cc/cc-options.yaml index 7ad83710..b3fc59a3 100644 --- a/conf/cc/cc-options.yaml +++ b/conf/cc/cc-options.yaml @@ -35,7 +35,7 @@ # - "This product includes parts of foxBMS®" # - "This product is derived from foxBMS®" -FOXBMS_2_CCS_VERSION_STRICT: "v20.2.5.LTS" +FOXBMS_2_CCS_VERSION_STRICT: "v20.2.6.LTS" INCLUDE_PATHS: win32: diff --git a/conf/env/paths_linux.txt b/conf/env/paths_linux.txt index 25a51a0f..4832b935 100644 --- a/conf/env/paths_linux.txt +++ b/conf/env/paths_linux.txt @@ -1,4 +1,4 @@ -/opt/ti/ccs1100/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin -/opt/ti/ccs1100/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/lib -/opt/ti/ccs1100/ccs/utils/bin -/opt/ti/ccs1100/ccs/utils/tiobj2bin +/opt/ti/ccs1200/ccs/tools/compiler/ti-cgt-arm_20.2.6.LTS/bin +/opt/ti/ccs1200/ccs/tools/compiler/ti-cgt-arm_20.2.6.LTS/lib +/opt/ti/ccs1200/ccs/utils/bin +/opt/ti/ccs1200/ccs/utils/tiobj2bin diff --git a/conf/env/paths_win32.txt b/conf/env/paths_win32.txt index 2fa3f930..03d30799 100644 --- a/conf/env/paths_win32.txt +++ b/conf/env/paths_win32.txt @@ -1,10 +1,10 @@ -C:\ti\ccs1100\ccs\tools\compiler\ti-cgt-arm_20.2.5.LTS\bin -C:\ti\ccs1100\ccs\tools\compiler\ti-cgt-arm_20.2.5.LTS\lib -C:\ti\ccs1100\ccs\utils\bin -C:\ti\ccs1100\ccs\utils\cygwin -C:\ti\ccs1100\ccs\utils\tiobj2bin +C:\ti\ccs1200\ccs\tools\compiler\ti-cgt-arm_20.2.6.LTS\bin +C:\ti\ccs1200\ccs\tools\compiler\ti-cgt-arm_20.2.6.LTS\lib +C:\ti\ccs1200\ccs\utils\bin +C:\ti\ccs1200\ccs\utils\cygwin +C:\ti\ccs1200\ccs\utils\tiobj2bin C:\ti\Hercules\HALCoGen\v04.07.01 C:\Program Files\LLVM\13.0.0\bin C:\Ruby\Ruby272-x64\bin C:\MinGW64\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin -C:\Bauhaus\7.4.0\bin +C:\Bauhaus\7.4.6\bin diff --git a/conf/guidelines/rules.json b/conf/guidelines/rules.json index 69f79c51..983580bc 100644 --- a/conf/guidelines/rules.json +++ b/conf/guidelines/rules.json @@ -22,6 +22,7 @@ "**/*~", "**/__pycache__/**", "**/foxbms-2_axivion_report.json", + "**/*.asc", ".git/**", ".lock-waf_*_build", ".mypy_cache/**", @@ -49,6 +50,7 @@ "src/os/safertos/**/*.asm", "src/os/safertos/**/*.c", "src/os/safertos/**/*.h", + "tests/axivion/qualification-test/qualification-kit/**", "tests/scripts/waf-core/general/**", "tests/scripts/waf-core/init/**", "tests/scripts/waf-core/install/**", @@ -125,19 +127,15 @@ "posix_3.206": { "name": "GENERAL:004", "exclude": [ - "**/*.dbc", "**/*.patch", - "**/*.sym", "tools/utils/git-hooks/pre-commit" ] }, "trailing_whitespace": { "name": "GENERAL:005", "exclude": [ - "**/*.dbc", "**/*.dil", "**/*.patch", - "**/*.sym", "tools/gui/data/pcan_view_v2.0.trc" ] }, @@ -374,6 +372,7 @@ "docs/developer-manual/style-guide/examples/c-028*.c", "docs/developer-manual/style-guide/state-machine-example/state-machine.c", "docs/software/build-process/misc/libproject-example.c", + "docs/software/modules/driver/can/can_how-to_tx.c", "docs/software/modules/engine/database/database_how-to.c", "docs/software/modules/task/ftask/ftask_how-to.c", "src/**", diff --git a/conf/tpl/c.c b/conf/tpl/c.c index 9fec40f7..096b4adc 100644 --- a/conf/tpl/c.c +++ b/conf/tpl/c.c @@ -43,8 +43,8 @@ * @file c.c * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup SOME_GROUP * @prefix ABC * diff --git a/conf/tpl/c.h b/conf/tpl/c.h index 3e82c49f..6b1167a7 100644 --- a/conf/tpl/c.h +++ b/conf/tpl/c.h @@ -43,8 +43,8 @@ * @file c.h * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup SOME_GROUP * @prefix ABC * diff --git a/conf/tpl/test_c.c b/conf/tpl/test_c.c index 76c0a48c..ba07033a 100644 --- a/conf/tpl/test_c.c +++ b/conf/tpl/test_c.c @@ -43,8 +43,8 @@ * @file test_c.c * @author foxBMS Team * @date 2020-08-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/conf/tpl/test_c.h b/conf/tpl/test_c.h index a46ce62d..62170652 100644 --- a/conf/tpl/test_c.h +++ b/conf/tpl/test_c.h @@ -43,8 +43,8 @@ * @file test_c.h * @author foxBMS Team * @date 2020-08-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/docs/developer-manual/hardware/dummy b/docs/developer-manual/hardware/.dummy similarity index 100% rename from docs/developer-manual/hardware/dummy rename to docs/developer-manual/hardware/.dummy diff --git a/docs/developer-manual/style-guide/examples/c-004.c b/docs/developer-manual/style-guide/examples/c-004.c index 5839d27e..7f3e0038 100644 --- a/docs/developer-manual/style-guide/examples/c-004.c +++ b/docs/developer-manual/style-guide/examples/c-004.c @@ -43,8 +43,8 @@ * @file c-004.c * @author foxBMS Team * @date 2021-04-06 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup SOME_GROUP * @prefix ABC * diff --git a/docs/developer-manual/style-guide/guidelines_rst.rst b/docs/developer-manual/style-guide/guidelines_rst.rst index d1c194d7..6088121b 100644 --- a/docs/developer-manual/style-guide/guidelines_rst.rst +++ b/docs/developer-manual/style-guide/guidelines_rst.rst @@ -96,8 +96,8 @@ Examples: Headings (``RST:005``) ---------------------- -We follow the convention of the Python Developer's Guide for -`reStructuredText Markup `_. +We follow the convention of the +*Python Developer's Guide for reStructuredText Markup*. Use the following rules to create headings: - # with overline, for parts diff --git a/docs/developer-manual/style-guide/state-machine-example/state-machine.c b/docs/developer-manual/style-guide/state-machine-example/state-machine.c index 056f7c1a..86022d81 100644 --- a/docs/developer-manual/style-guide/state-machine-example/state-machine.c +++ b/docs/developer-manual/style-guide/state-machine-example/state-machine.c @@ -43,8 +43,8 @@ * @file state-machine.c * @author foxBMS Team * @date 2020-10-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup STATE_MACHINE * @prefix EG * diff --git a/docs/developer-manual/style-guide/state-machine-example/state-machine.h b/docs/developer-manual/style-guide/state-machine-example/state-machine.h index ce600ace..160b9050 100644 --- a/docs/developer-manual/style-guide/state-machine-example/state-machine.h +++ b/docs/developer-manual/style-guide/state-machine-example/state-machine.h @@ -43,8 +43,8 @@ * @file state-machine.h * @author foxBMS Team * @date 2020-10-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup STATE_MACHINE * @prefix EG * diff --git a/docs/general/changelog.rst b/docs/general/changelog.rst index de6ac588..7b9c0cb8 100644 --- a/docs/general/changelog.rst +++ b/docs/general/changelog.rst @@ -41,6 +41,57 @@ Versioning follows then these rules: - increasing ``MINOR`` adds functionality in a backwards compatible manner - increasing ``PATCH`` fixes bugs in a backwards compatible manner +******************** +[1.4.1] - 2022-10-27 +******************** + +|foxbms| updated to TI ARM CGT 20.2.6.LTS. +Installation instructions are found at :numref:`css_install`. + +Added +===== + +- The new default compiler set in ``conf/env/paths_win32.txt`` and + ``conf/env/paths_linux.txt`` is now TI ARM CGT v20.2.6.LTS (shipped with CCS + ``12.0.0``). +- Added driver for *Murata NCU15XH103F6Sxx* temperature sensor + +Changed +======= + +- Updated the hardware design files (e.g., schematics, layout, BOM and STEP + file etc.) of the |bms-master| to ``v1.1.5`` (see + :ref:`CHANGELOG_FOR_MASTER_TMS570_V1_1_5`). +- Updated documentation of the interface using the |max17841b| transceiver + chip. +- The implementation of the CAN driver has been changed to simplify adding + new messages. + Furthermore it is now possible to force a certain style on how CAN messages + are defined in the symbol/dbc files as well as in the source code. + For further information see :ref:`HOW_TO_USE_THE_CAN_MODULE`. +- Updated version of ``.sym`` file for the definition of the CAN messages and + signals to v6.0 (from 5.0). +- Update the static code analysis to Axivion 7.4.6 (from 7.4.0). + +Deprecated +========== + +Removed +======= + +- Unused calculation of MOL, RSL and MSL curves for trapezoid algorithm in + ``SOF`` module. + +Fixed +===== + +- In ``ADC`` module, corrected formula making the conversion from raw ADC + reading to voltage in mV. +- The address of two diagnostic registers in the Smart Power Switch driver + was wrong. +- Endianness definition throughout the CAN signals was inconsistent. Not all + signals were correctly defined as big-endian. + ******************** [1.4.0] - 2022-07-29 ******************** @@ -127,11 +178,11 @@ Fixed [1.3.0] - 2022-05-30 ******************** -|foxbms| updated to TI ARM CGT 20.2.5.LTS. Installation instructions are found -at :numref:`css_install`. +|foxbms| updated to TI ARM CGT 20.2.5.LTS. +Installation instructions are found at :numref:`css_install`. -|foxbms| updated to LLVM 13.0.0. Installation instructions are found at -:numref:`llvm_install`. +|foxbms| updated to LLVM 13.0.0. +Installation instructions are found at :numref:`llvm_install`. Added ===== diff --git a/docs/general/commit-msgs/next-release.txt b/docs/general/commit-msgs/next-release.txt new file mode 100644 index 00000000..e89cc99e --- /dev/null +++ b/docs/general/commit-msgs/next-release.txt @@ -0,0 +1,6 @@ + release of foxBMS 2 (vx.y.z) + +* + +For a detailed list of changes, please refer to the documentation at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/vx.y.z/general/changelog.html. diff --git a/docs/general/commit-msgs/release-v1.0.0.txt b/docs/general/commit-msgs/release-v1.0.0.txt new file mode 100644 index 00000000..47b2ca19 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.0.0.txt @@ -0,0 +1 @@ +Initial commit of foxBMS 2 (v1.0.0) diff --git a/docs/general/commit-msgs/release-v1.0.1.txt b/docs/general/commit-msgs/release-v1.0.1.txt new file mode 100644 index 00000000..c44d95fc --- /dev/null +++ b/docs/general/commit-msgs/release-v1.0.1.txt @@ -0,0 +1,9 @@ +Bugfix release of foxBMS 2 (v1.0.1) + +* updated the documentation +* updated master board +* minor toolchain improvements + +For a detailed list of changes, please refer to the documentation +at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.0.1/general/changelog.html diff --git a/docs/general/commit-msgs/release-v1.0.2.txt b/docs/general/commit-msgs/release-v1.0.2.txt new file mode 100644 index 00000000..9cb27ea7 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.0.2.txt @@ -0,0 +1,8 @@ +Bugfix release of foxBMS 2 (v1.0.2) + +* updated the documentation +* minor toolchain improvements + +For a detailed list of changes, please refer to the documentation +at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.0.2/general/changelog.html diff --git a/docs/general/commit-msgs/release-v1.1.0.txt b/docs/general/commit-msgs/release-v1.1.0.txt new file mode 100644 index 00000000..15cc2af1 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.1.0.txt @@ -0,0 +1,8 @@ +Minor release of foxBMS 2 (v1.1.0) + +* Release of new master schematic +* Implementation of CAN messages + +For a detailed list of changes, please refer to the documentation +at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.1.0/general/changelog.html diff --git a/docs/general/commit-msgs/release-v1.1.1.txt b/docs/general/commit-msgs/release-v1.1.1.txt new file mode 100644 index 00000000..aba73589 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.1.1.txt @@ -0,0 +1,8 @@ +Bugfix release of foxBMS 2 (v1.1.1) + +fixed a CAN message decoding bug +added missing CAN messages + +For a detailed list of changes, please refer to the documentation +at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.1.1/general/changelog.html diff --git a/docs/general/commit-msgs/release-v1.1.2.txt b/docs/general/commit-msgs/release-v1.1.2.txt new file mode 100644 index 00000000..b976feec --- /dev/null +++ b/docs/general/commit-msgs/release-v1.1.2.txt @@ -0,0 +1,4 @@ +Bugfix release of foxBMS 2 (v1.1.2) + +added Axivion configuration +added system block diagram diff --git a/docs/general/commit-msgs/release-v1.2.0.txt b/docs/general/commit-msgs/release-v1.2.0.txt new file mode 100644 index 00000000..5a5a9b37 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.2.0.txt @@ -0,0 +1,8 @@ +Minor release of foxBMS 2 (v1.2.0) + +* Initial release of the hardware design files (e.g., schematics, layout, BOM and STEP file etc.) of the BMS-Master Board (hardware version: ``v1.1.1``) +* Added new drivers for port expander, interlock, humidity/temperature sensor and LED +* Support for second CAN interface +* Renamed the measurement IC (MIC) driver to analog front-end driver (AFE) + +For a detailed list of changes, please refer to the documentation at https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.2.0/general/changelog.html. diff --git a/docs/general/commit-msgs/release-v1.2.1.txt b/docs/general/commit-msgs/release-v1.2.1.txt new file mode 100644 index 00000000..5d58f635 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.2.1.txt @@ -0,0 +1,8 @@ +Minor release of foxBMS 2 (v1.2.1) + +* Added documentation for slave LTC-based interface and slaves +* improved MAXIM MAX17852 and MAX17841B driver +* make git a required software installation in order to work with the foxBMS 2 repository +* update conda environment + +For a detailed list of changes, please refer to the documentation at https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.2.1/general/changelog.html. diff --git a/docs/general/commit-msgs/release-v1.3.0.txt b/docs/general/commit-msgs/release-v1.3.0.txt new file mode 100644 index 00000000..f79a2b0d --- /dev/null +++ b/docs/general/commit-msgs/release-v1.3.0.txt @@ -0,0 +1,8 @@ +Minor release of foxBMS 2 (v1.3.0) + +* Added master and slave hardware documentation +* Added CRC checks in the FRAM driver +* Enhanced insulation monitoring driver +* Added Bender IR155 driver + +For a detailed list of changes, please refer to the documentation at https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.3.0/general/changelog.html. diff --git a/docs/general/commit-msgs/release-v1.4.0.txt b/docs/general/commit-msgs/release-v1.4.0.txt new file mode 100644 index 00000000..9e8b7b0c --- /dev/null +++ b/docs/general/commit-msgs/release-v1.4.0.txt @@ -0,0 +1,11 @@ +Minor release of foxBMS 2 (v1.4.0) + +* foxBMS 2 has been certified as open source hardware by the Open Source Hardware Association (OSHWA UID DE000128). +* Added AFE driver for the NXP monitoring IC MC33775A. +* Increased delay between chip select activation and start of SPI transmission and the delay between end of SPI transmission and chip select deactivation to avoid SPI transmission errors for AFEs. +* Activated CAN2 message boxes within the HALCoGen configuration. +* Updated Master board hardware reference to version v1.1.3. +* Several new unit tests have been added. +* Improved the Axivion configuration to ensure style guide conforming source code and fixed in the same step several style guide violations + +For a detailed list of changes, please refer to the documentation at https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.4.0/general/changelog.html. diff --git a/docs/general/commit-msgs/release-v1.4.1.txt b/docs/general/commit-msgs/release-v1.4.1.txt new file mode 100644 index 00000000..07ee4bf6 --- /dev/null +++ b/docs/general/commit-msgs/release-v1.4.1.txt @@ -0,0 +1,19 @@ +Bugfix release of foxBMS 2 (v1.4.1) + +* The BMS Master hardware has been updated to v1.1.5. +* CAN: + * The implementation of the CAN driver has been changed to simplify adding + new messages. + * Endianness definition throughout the CAN signals was inconsistent. Not all + signals were correctly defined as big-endian. + * Updated the version of .sym file for the definition of the CAN messages to + format version 6.0. +* Fixed equation that does the conversion from raw ADC reading to voltage (mV). +* Fixed the address for reading two diagnostic registers in the Smart Power + Switch driver. +* Maintenance: + * TI CCS version 12.0.0, including TI ARM CGT 20.2.6, are now the defaults. + * Update the Axivion static code analysis to version 7.4.6. + +For a detailed list of changes, please refer to the documentation at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.4.1/general/changelog.html. diff --git a/docs/general/releases.csv b/docs/general/releases.csv index 83fc290f..99e5541f 100644 --- a/docs/general/releases.csv +++ b/docs/general/releases.csv @@ -1,4 +1,5 @@ foxBMS 2; Release Date; Permanent link to documentation +v1.4.1; 2022-10-27; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.4.1/ v1.4.0; 2022-07-29; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.4.0/ v1.3.0; 2022-05-30; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.3.0/ v1.2.1; 2021-12-08; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v1.2.1/ diff --git a/docs/general/releases.rst b/docs/general/releases.rst index 44693a95..b4a0cdbc 100644 --- a/docs/general/releases.rst +++ b/docs/general/releases.rst @@ -17,7 +17,8 @@ Releases ----------------- The following tables describe the different versions of |foxbms| that were -released. The first line is the most recent one, the last one the oldest one. +released. +The first line is the most recent one, the last one the oldest one. The changes between two releases are described in the :ref:`CHANGELOG`. @@ -27,9 +28,186 @@ The changes between two releases are described in the :ref:`CHANGELOG`. :delim: ; :file: ./releases.csv -Release Information -------------------- +Detailed Release Procedure +-------------------------- -Releases are commits on the master branch with an annotated tag. If we would -release for example version 0.0.42, we would check out the master branch and -then execute ``git tag -a v0.0.42``. +This description is for documenting purposes only, so that others know how we, +the :ref:`TEAM`, create public releases. +Releases are created from commits of the ``master`` branch of an Fraunhofer +internal git repository. +A release is assembled by running the described procedure after the ``master`` +branch has been bumped to a version, which identifier matches the regular +expression ``\d+\.\d+\.\d+`` +(the internal development version number is always ``x.y.z``, except for the +commit that bumps the version to a releasable version). + +.. note:: + + This description uses two different directories: + + - ``C:\release-bot\foxbms-2``: local checkout of the internal repository. + - ``C:\release-bot\foxbms-2-publishing-mirror``: local checkout of the + internal repository that is synced to |foxbms_repository|. + +The release is internally created by the ``The foxBMS ReleaseBot`` and these +steps are automated. +The git configuration of the ``The foxBMS ReleaseBot`` is + +.. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git config user.name "The foxBMS ReleaseBot" + C:\release-bot\foxbms-2-publishing-mirror>git config user.mail "info@foxbms.org" + +For this documentation we assume that the version to be created and released +is ``1.0.0``. + +Defining release status of repository ++++++++++++++++++++++++++++++++++++++ + +#. Defining the version number of the release. +#. Creation of a version bump branch ``bump-version`` + + .. code-block:: console + + C:\release-bot\foxbms-2>git checkout -b bump-version + +#. Bump the version number in all relevant files and commit the changes to the + new branch: + + .. code-block:: console + + C:\release-bot\foxbms-2>tools\utils\cmd\run-script.bat tools\utils\update_version.py --from x.y.z --to 1.0.0 + C:\release-bot\foxbms-2>tools\utils\cmd\run-script.bat tools\utils\update_doxygen_header.py + C:\release-bot\foxbms-2>git add . + C:\release-bot\foxbms-2>git commit -m "bump version to v1.0.0" + C:\release-bot\foxbms-2>git tag -a v1.0.0-version-bump -m "bump version to v1.0.0" + +#. Merge the branch back to ``master`` branch and remove the version bumping + branch + + .. code-block:: console + + C:\release-bot\foxbms-2>git checkout master + C:\release-bot\foxbms-2>git merge bump-version + C:\release-bot\foxbms-2>git branch -D bump-version + +#. Tag the ``master`` branch with ``v1.0.0``: + + .. code-block:: console + + C:\release-bot\foxbms-2>git tag -a v1.0.0 -m "v1.0.0" + +#. Make the ``master`` branch a development branch again (note the reverted + order of ``from`` and ``to``: ``--from 1.0.0 --to x.y.z``): + + .. code-block:: console + + C:\release-bot\foxbms-2>tools\utils\cmd\run-script.bat tools\utils\update_version.py --from 1.0.0 --to x.y.z + +#. Push all this work: + + .. code-block:: console + + C:\release-bot\foxbms-2>git push origin master --follow-tags + + +Creation of the release branch +++++++++++++++++++++++++++++++ + +#. Creation of the release branch at the created version tag ``v1.0.0``: + + .. code-block:: console + + C:\release-bot\foxbms-2>git checkout v1.0.0 + C:\release-bot\foxbms-2>git checkout -b release-v1.0.0 + +#. Run script to remove confidential and non-releasable files and information. +#. Commit all changes to the release branch ``release-v1.0.0`` and tag this + commit as release: + + .. code-block:: console + + C:\release-bot\foxbms-2>git add . + C:\release-bot\foxbms-2>git commit -m "branch for GitHub release version 1.0.0" + C:\release-bot\foxbms-2>git tag -a gh-1.0.0 -m "gh-1.0.0" + +#. Make a clean build to make sure everything works as expected: + + .. code-block:: console + + C:\release-bot\foxbms-2>waf configure + C:\release-bot\foxbms-2>waf build_all + +#. Clean the repository from all generated files: + + .. code-block:: console + + C:\release-bot\foxbms-2>git clean -xdf + + +Publication of the release branch ++++++++++++++++++++++++++++++++++ + +#. Create release branch in the publishing mirror and check it out: + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git checkout -b gh-release-v1.0.0 + C:\release-bot\foxbms-2-publishing-mirror>git commit -m "update branch for GitHub release version 1.0.0" + +#. Remove all files from the current checkout: + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git rm -r "*" + +#. Copy files from release branch in the internal repository to the release + branch of the publishing repository and add them: + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>xcopy C:\release-bot\foxbms-2 . /s /e + C:\release-bot\foxbms-2-publishing-mirror>git add . -f + C:\release-bot\foxbms-2-publishing-mirror>git commit -F docs\general\commit-msgs\release-v1.0.0.txt + +#. Create a dummy tag (annotated or not does not make a difference here) and + make sure everything works as expected (no problems are expected to happen): + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git tag v1.0.0 + C:\release-bot\foxbms-2-publishing-mirror>waf configure + C:\release-bot\foxbms-2-publishing-mirror>waf build_all + +#. Delete the temporary tag ``v1.0.0``: + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git checkout master + C:\release-bot\foxbms-2-publishing-mirror>git tag -d v1.0.0 + +#. Merge the ``gh-release-v1.0.0`` branch to the ``master`` branch and create + an annotated tag ``v1.0.0`` on ``master`` branch: + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git merge gh-release-v1.0.0 + C:\release-bot\foxbms-2-publishing-mirror>git branch -D gh-release-v1.0.0 + +#. Push to the publishing repository: + + .. code-block:: console + + C:\release-bot\foxbms-2-publishing-mirror>git push origin master --follow-tags + +#. The ``master`` branch of the publishing mirror is automatically synced to + |foxbms_repository|. + +Finishing the release ++++++++++++++++++++++ + +After that process, we + +- create `GitHub release `_, +- update the documentation on |docs.foxbms.org| and +- post a news entry on the website |foxbms.org|. diff --git a/docs/getting-started/software-installation.rst b/docs/getting-started/software-installation.rst index b26e383b..5b4ac2be 100644 --- a/docs/getting-started/software-installation.rst +++ b/docs/getting-started/software-installation.rst @@ -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.4.0.zip https://github.com/foxBMS/foxbms-2/archive/v1.4.0.zip - C:\Users\vulpes\Documents>tar -x -f foxbms-2-v1.4.0.zip - C:\Users\vulpes\Documents>ren foxbms-2-1.4.0 foxbms-2 + C:\Users\vulpes\Documents>curl -Ss -L -o foxbms-2-v1.4.1.zip https://github.com/foxBMS/foxbms-2/archive/v1.4.1.zip + C:\Users\vulpes\Documents>tar -x -f foxbms-2-v1.4.1.zip + C:\Users\vulpes\Documents>ren foxbms-2-1.4.1 foxbms-2 C:\Users\vulpes\Documents>cd foxbms-2 .. note:: @@ -126,8 +126,8 @@ Download `Code Composer Studio`_ (CCS) version |version_ccs| and run the installer (chose ``Windows single file installer for CCS IDE``). Do **not** change the default installation directory chosen by the installer and let the installer proceed with the installation into the installation -directory (i.e. ``C:\ti\...`` for CCS ``10.3.1``). Select the -``Hercules™ Safety MCUs`` option during the installation. +directory (e.g., ``C:\ti\ccs1031`` for CCS ``10.3.1``). +Select the ``Hercules™ Safety MCUs`` option during the installation. Installing Code Composer Studio may take a while. diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0.rst b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0.rst index d9629a95..b293cf2f 100644 --- a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0.rst +++ b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0.rst @@ -30,8 +30,16 @@ Overview The |bms-interface| is used to enable communication between the |bms-master| and the |bms-slaves|. +A 3D rendering from the TOP side view of the |bms-interface| is shown in +:numref:`Fig. %s `. The |bms-interface| is intended to be used together with a |bms-master|. +.. _interface-max17841b_v1.0.0_rendering: +.. figure:: ./maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_rendering.png + :width: 80 % + + 3D rendering of the |bms-interface| + -------------- Specifications -------------- @@ -40,7 +48,8 @@ Specifications Mechanical Dimensions ^^^^^^^^^^^^^^^^^^^^^ -The size of the PCB is 70 |_| |mm| |_| x |_| 120 |_| |mm|. +The size of the PCB is 70 |_| |mm| |_| x |_| 120 |_| |mm|. A 3D-model and a +drawing of the PCB can be found in :ref:`DESIGN_RESOURCES` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Battery Management UART Insulation @@ -67,6 +76,38 @@ The PCB design complies with the following parameters: - Creepage distance: 12.5 |_| |mm| +^^^^^^^^^^^^^ +Block Diagram +^^^^^^^^^^^^^ + +A block diagram of the |bms-interface| is shown in +:numref:`Fig. %s `. + +.. _interface-max17841b_v1.0.0_block_diagram: +.. figure:: ./maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_block_diagram.png + :width: 100 % + + Block diagram of the |bms-interface| + +Each |max17841b| communication chip from |mxm| provides one UART channel. +Each channel is comprised of a RX and a TX signal, each using one insulation +transformer. +The |max17841b| chips are directly connected to the MCU via |spi|. + +^^^^^^^^^^^^^^^^^^^^^^^^^^ +Schematic and Board Layout +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +More information about the board schematic and layout files can be found in +section :ref:`DESIGN_RESOURCES`. +For better debugging, there are test-points on the PCB for all relevant IO +signals. In addition to test-points, a pin header (J101) allows an easier +connection to a logic analyzer. + +--------- +Functions +--------- + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Maxim Battery Management UART communication ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -75,6 +116,42 @@ The |bms-interface| offers up to two isolated Maxim Battery Management UART communication channels using the |max17841b| transceiver chip from |mxm|. The |max17841b| transceivers are controlled by the SPI signals from the |bms-master|. +The UART RX signals are available on the connectors J102 and J104. +The pinout of the connectors is described in +:numref:`Table %s `. + +.. csv-table:: UART RX Input Connectors + :name: interface-max17841b_v1.0.0_uartrx_connectors + :header-rows: 1 + :delim: ; + :file: ./maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uartrx_connectors.csv + +The UART TX signals are available on the connectors J103 and J105. +The pinout of the connectors is described in +:numref:`Table %s `. + +.. csv-table:: UART TX Output Connectors + :name: interface-max17841b_v1.0.0_uarttx_connectors + :header-rows: 1 + :delim: ; + :file: ./maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uarttx_connectors.csv For the connection to the |bms-master|, a 40-pole mezzanine connector (J100) -is used. +is used. The pinout and pin usage is described in +:numref:`Table %s ` + +.. csv-table:: Signal connector to |bms-master| + :name: interface-max17841b_v1.0.0_master_connector + :header-rows: 1 + :delim: ; + :file: ./maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_master_connector.csv + +All important IO signals are connected to a pin header (J101) to provide an +easy connection to a logic analyzer. The pinout of this header is described in +:numref:`Table %s ` + +.. csv-table:: Debug connector + :name: interface-max17841b_v1.0.0_debug_connector + :header-rows: 1 + :delim: ; + :file: ./maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_debug_connector.csv diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_block_diagram.png b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_block_diagram.png new file mode 100644 index 00000000..1d70fcca Binary files /dev/null and b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_block_diagram.png differ diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_block_diagram.pptx b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_block_diagram.pptx new file mode 100644 index 00000000..e69de29b diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_debug_connector.csv b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_debug_connector.csv new file mode 100644 index 00000000..59793db9 --- /dev/null +++ b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_debug_connector.csv @@ -0,0 +1,13 @@ +Pin; Signal; Description +1; ``GND``;\- +2; ``GND``;\- +3; ``MCU_SPI4.CS0``;UART channel 2 +4; ``MCU_SPI1.CS1``;UART channel 1 +5; ``MCU_SPI4.SIMO``;UART channel 2 +6; ``MCU_SPI1.SIMO0``;UART channel 1 +7; ``MCU_SPI4.SOMI``;UART channel 2 +8; ``MCU_SPI1.SOMI0``;UART channel 1 +9; ``MCU_SPI4.CLK``;UART channel 2 +10; ``MCU_SPI1.CLK``;UART channel 1 +11; ``IF_INT2``;UART channel 2 [max17841b] interrupt +12; ``IF_INT0``;UART channel 1 [max17841b] interrupt diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_master_connector.csv b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_master_connector.csv new file mode 100644 index 00000000..9146d11a --- /dev/null +++ b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_master_connector.csv @@ -0,0 +1,41 @@ +Pin; Signal; Description; Usage on |bms-interface| +1; ``MCU_SPI1.SOMI0``; \-; UART channel 1 +2; ``MCU_SPI1.SOMI1``; \-; \- +3; ``MCU_SPI1.SIMO0``; \-; UART channel 1 +4; ``MCU_SPI1.SIMO1``; \-; \- +5; ``MCU_SPI1.CLK``; \-; UART channel 1 +6; ``MCU_SPI1.CS1``; \-; UART channel 1 +7; ``MCU_SPI1.CS2``; \-; \- +8; ``MCU_SPI1.CS3``; \-; \- +9; ``MCU_SPI1.CS4``; \-; \- +10; ``MCU_SPI1.CS5``; \-; \- +11; ``MCU_SPI4.SOMI``; \-; UART channel 2 +12; ``MCU_SPI4.SIMO``; \-; UART channel 2 +13; ``MCU_SPI4.CLK``; \-; UART channel 2 +14; ``MCU_SPI4.CS0``; \-; UART channel 2 +15; ``MCU_SPI4.CS1``; \-; \- +16; ``MCU_SPI4.CS2``; \-; \- +17; ``MCU_SPI4.CS3``; \-; \- +18; ``MCU_SPI4.CS4``; \-; \- +19; ``MCU_SPI4.CS5``; \-; \- +20; ``IF_INT0``; Interrupt pin, connected to MCU GIOA_2; UART channel 1 [max17841b] interrupt +21; ``IF_INT1``; Interrupt pin, connected to MCU GIOA_3; UART channel 1 [max17841b] enable +22; ``IF_INT2``; Interrupt pin, connected to MCU GIOA_4; UART channel 2 [max17841b] interrupt +23; ``IF_INT3``; Interrupt pin, connected to MCU GIOA_6; UART channel 2 [max17841b] enable +24; ``IF_GPIO.0``; GPIO pin, connected to port expander 3 IO1_0; UART channel 1 [max17841b] enable +25; ``IF_GPIO.1``; GPIO pin, connected to port expander 3 IO1_1; UART channel 2 [max17841b] enable +26; ``IF_GPIO.2``; GPIO pin, connected to port expander 3 IO1_2; \- +27; ``IF_GPIO.3``; GPIO pin, connected to port expander 3 IO1_3; \- +28; ``IF_GPIO.4``; GPIO pin, connected to port expander 3 IO1_4; \- +29; ``IF_GPIO.5``; GPIO pin, connected to port expander 3 IO1_5; \- +30; ``IF_GPIO.6``; GPIO pin, connected to port expander 3 IO1_6; \- +31; ``IF_GPIO.7``; GPIO pin, connected to port expander 3 IO1_7; \- +32; ``GND``; Power supply ground; Power supply ground +33; ``GND``; Power supply ground; Power supply ground +34; ``PER_3.3V``; 3.3 |_| V from peripheral SBC; 3.3 |_| V power supply +35; ``PER_3.3V``; 3.3 |_| V from peripheral SBC; 3.3 |_| V power supply +36; ``PER_5.0V``; 5.0 |_| V from peripheral SBC; \- +37; ``PER_5.0V``; 5.0 |_| V from peripheral SBC; \- +38; ``VBB_12V``; 12 |_| V from buck-boost converter; \- +39; ``VSUP``; Master supply voltage (after protection circuits); \- +40; ``VSUP``; Master supply voltage (after protection circuits); \- diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_rendering.png b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_rendering.png new file mode 100644 index 00000000..f6334769 Binary files /dev/null and b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_rendering.png differ diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uartrx_connectors.csv b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uartrx_connectors.csv new file mode 100644 index 00000000..d6bf422c --- /dev/null +++ b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uartrx_connectors.csv @@ -0,0 +1,3 @@ +Pin; Signal; Description +1; UART_RX_p; UART RX positive +2; UART_RX_n; UART RX negative diff --git a/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uarttx_connectors.csv b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uarttx_connectors.csv new file mode 100644 index 00000000..d4150f62 --- /dev/null +++ b/docs/hardware/interfaces/maxim-max17841b-vx.x.x/maxim-max17841b-v1.0.0/maxim-max17841b-v1.0.0_uarttx_connectors.csv @@ -0,0 +1,3 @@ +Pin; Signal; Description +1; UART_TX_p; UART TX positive +2; UART_TX_n; UART TX negative diff --git a/docs/hardware/master.rst b/docs/hardware/master.rst index 41621598..5cc6c4d5 100644 --- a/docs/hardware/master.rst +++ b/docs/hardware/master.rst @@ -22,3 +22,4 @@ The documentation for the different versions can be found at. ./master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-v1.1.1.rst ./master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-v1.1.3.rst + ./master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-v1.1.5.rst diff --git a/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-changelog.rst b/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-changelog.rst index fe608b52..d904d8c7 100644 --- a/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-changelog.rst +++ b/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-changelog.rst @@ -6,6 +6,21 @@ Changelog for Master TMS570 =========================== +.. _CHANGELOG_FOR_MASTER_TMS570_V1_1_5: + +v1.1.5 +------ + +- Fixed Farnell order code for 100nF/50V/0402 +- Updated project BOM + +.. _CHANGELOG_FOR_MASTER_TMS570_V1_1_4: + +v1.1.4 +------ + +- Improved SBC wake-up pulse generation circuit by changing value of R7233 to 470kOhm + .. _CHANGELOG_FOR_MASTER_TMS570_V1_1_3: v1.1.3 diff --git a/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-v1.1.5.rst b/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-v1.1.5.rst new file mode 100644 index 00000000..9972cd31 --- /dev/null +++ b/docs/hardware/master/ti-tms570lc4357-vx.x.x/ti-tms570lc4357-v1.1.5.rst @@ -0,0 +1,15 @@ +.. include:: ./../../../macros.txt +.. include:: ./../../../units.txt + +.. _MASTER_TMS570___V1_1_5__: + +Master TMS570 ``v1.1.5`` +======================== + +.. note:: + + The changelog for this release is found at + :ref:`CHANGELOG_FOR_MASTER_TMS570_V1_1_5`. + +There are no changes that need a new documentation compared to v1.1.1, +therefore see :ref:`MASTER_TMS570___V1_1_1__`. diff --git a/docs/macros.txt b/docs/macros.txt index 5a3c8494..be4002b6 100644 --- a/docs/macros.txt +++ b/docs/macros.txt @@ -3,7 +3,9 @@ .. |timestamp| date:: %Y-%m-%d %H:%M:%S .. |foxbms| replace:: foxBMS 2 -.. |version_foxbms| replace:: ``1.4.0`` +.. |version_foxbms| replace:: ``1.4.1`` +.. |foxbms.org| replace:: https://foxbms.org +.. |docs.foxbms.org| replace:: https://docs.foxbms.org .. |github_foxbms| replace:: https://github.com/foxBMS/ .. |foxbms_repository| replace:: https://github.com/foxBMS/foxbms-2 .. _Fraunhofer IISB: https://www.iisb.fraunhofer.de @@ -29,8 +31,8 @@ .. |texas-instruments| replace:: Texas Instruments .. |code-composer-studio| replace:: Code Composer Studio -.. _Code Composer Studio: https://www.ti.com/tool/download/CCSTUDIO/10.3.1.00003 -.. |version_ccs| replace:: ``10.3.1`` +.. _Code Composer Studio: https://www.ti.com/tool/download/CCSTUDIO/12.0.0 +.. |version_ccs| replace:: ``12.0.0`` .. |halcogen| replace:: HALCoGen .. _HALCoGen: https://www.ti.com/tool/HALCOGEN @@ -41,8 +43,8 @@ .. |version_llvm| replace:: ``13.0.0`` .. |path_llvm| replace:: ``C:\Program Files\LLVM\13.0.0`` -.. |version_pcan_se| replace:: ``Version 6.4.1`` -.. |version_sym_file| replace:: ``Version 5.0`` +.. |version_pcan_se| replace:: ``Version 6.5.2`` +.. |version_sym_file| replace:: ``Version 6.0`` .. _Ruby: https://www.ruby-lang.org/ diff --git a/docs/software/architecture/img/axivion_architecture.svg b/docs/software/architecture/img/axivion_architecture.svg index ce37290b..b65c7552 100644 --- a/docs/software/architecture/img/axivion_architecture.svg +++ b/docs/software/architecture/img/axivion_architecture.svg @@ -3,7 +3,7 @@ viewBox="0 0 707.405 537.379" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" baseProfile="tiny"> Architecture (Hier.) -Exported from Gravis 7.4.0 (2022-05-10) +Exported from Gravis 7.4.6 (2022-10-20) @@ -111,12 +111,12 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal > - - @@ -125,27 +125,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Measurement +Temperature Sensors - - - @@ -154,27 +154,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -SPI +Analog Front-End - - - @@ -183,27 +183,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -IO +FRAM - - - @@ -212,17 +212,17 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Analog Front-End +Interlock - @@ -256,12 +256,12 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal > - - @@ -270,27 +270,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Contactor +SPI - - - @@ -299,27 +299,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -DMA +Contactor - - - @@ -328,27 +328,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -FRAM +MCU - - - @@ -357,27 +357,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -ADC +Common - - - @@ -386,27 +386,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -MCU +ADC - - - @@ -415,27 +415,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Common +Measurement - - - @@ -444,27 +444,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Power Supply +DMA - - - @@ -473,27 +473,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Temperature Sensors +IO - - - @@ -502,17 +502,17 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Interlock +Power Supply - @@ -628,12 +628,12 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal > - - @@ -642,27 +642,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Plausibility +BMS - - - @@ -671,17 +671,17 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -BMS +Plausibility - @@ -723,13 +723,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -746,13 +746,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -889,12 +889,12 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal > - - @@ -903,27 +903,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -System +Diagnosis - - - @@ -932,27 +932,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -System Monitoring +System - - - @@ -961,17 +961,17 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -Diagnosis +System Monitoring - @@ -1029,12 +1029,12 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal > - - @@ -1043,27 +1043,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -core components +fassert - - - @@ -1072,27 +1072,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -fassert +main - - - @@ -1101,27 +1101,27 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -version information +core components - - - @@ -1130,17 +1130,17 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + -main +version information - @@ -1310,13 +1310,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1333,13 +1333,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1353,15 +1353,17 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal > - - + - + + - - - - + - + - + @@ -1441,13 +1441,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1503,13 +1503,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1526,13 +1526,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1549,13 +1549,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1572,13 +1572,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1618,13 +1618,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1641,13 +1641,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1664,13 +1664,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1733,13 +1733,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1756,13 +1756,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1848,13 +1848,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1871,13 +1871,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1894,13 +1894,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1917,13 +1917,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1940,13 +1940,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1963,13 +1963,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -1986,13 +1986,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2009,13 +2009,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2032,13 +2032,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2055,13 +2055,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2078,13 +2078,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2101,13 +2101,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2124,13 +2124,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2147,13 +2147,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2170,13 +2170,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2193,13 +2193,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2216,13 +2216,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2239,13 +2239,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2262,13 +2262,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2285,13 +2285,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2308,13 +2308,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + @@ -2331,13 +2331,13 @@ font-family="MS Shell Dlg 2" font-size="11" font-weight="400" font-style="normal - + - + diff --git a/docs/software/build-process/misc/libproject-example.c b/docs/software/build-process/misc/libproject-example.c index f40d197d..237c556b 100644 --- a/docs/software/build-process/misc/libproject-example.c +++ b/docs/software/build-process/misc/libproject-example.c @@ -43,8 +43,8 @@ * @file libproject-example.c * @author foxBMS Team * @date 2020-10-06 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup USER_LIB * @prefix SUPER * diff --git a/docs/software/build-process/misc/libproject-example.h b/docs/software/build-process/misc/libproject-example.h index fbe81644..86ee3e1d 100644 --- a/docs/software/build-process/misc/libproject-example.h +++ b/docs/software/build-process/misc/libproject-example.h @@ -43,8 +43,8 @@ * @file libproject-example.h * @author foxBMS Team * @date 2020-10-06 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup USER_LIB * @prefix SUPER * diff --git a/docs/software/modules/driver/can/can.rst b/docs/software/modules/driver/can/can.rst index 356f0bb9..2df8a2a6 100644 --- a/docs/software/modules/driver/can/can.rst +++ b/docs/software/modules/driver/can/can.rst @@ -45,17 +45,19 @@ The sent message parameters are: - CAN ID of message to be sent. - data length code, number of bytes to send. Default 8, maximum 8. -- repetition time, period of transmission in ms. Must be a multiple of 10. -- repetition phase, delay for the first transmission. Avoids sending all - messages with same period at the same time. +- repetition time, period of transmission in ms. + Must be a multiple of 10. +- repetition phase, delay for the first transmission. + Avoids sending all messages with same period at the same time. - byte order, endianness (big or little endian) of CAN data. - callback function, pointer to the function that is called when the message has to be sent. -- multiplexer, pointer to a number. This is used to multiplex data in CAN - messages. A static variable must be defined to be used as multiplexer. +- multiplexer, pointer to a number. + This is used to multiplex data in CAN messages. + A static variable must be defined to be used as multiplexer. -The data of the CAN message is divided into signals. Data for each signal -is prepared within the callback function. +The data of the CAN message is divided into signals. +Data for each signal is prepared within the callback function. The developer must implement the signals as needed by the application. Two helper functions are defined for this task, @@ -79,12 +81,13 @@ store the CAN message in the variable used by the low-level driver for the actual transmission. The function ``CAN_PeriodicTransmit()`` is called every 10ms by the 10ms task. -It parses all the elements of ``can_txMessages[]``. If the time has been -reached to send the messages, the corresponding callback function is called. +It parses all the elements of ``can_txMessages[]``. +If the time has been reached to send the messages, the corresponding callback +function is called. -The message is then sent with the function ``CAN_DataSend()``. The function -``CAN_DataSend()`` can also be used to send a CAN message directly anywhere -else in the code. +The message is then sent with the function ``CAN_DataSend()``. +The function ``CAN_DataSend()`` can also be used to send a CAN message directly +anywhere else in the code. Messages to receive ^^^^^^^^^^^^^^^^^^^ diff --git a/docs/software/modules/driver/can/can_how-to.rst b/docs/software/modules/driver/can/can_how-to.rst index 56e61fc4..571608b1 100644 --- a/docs/software/modules/driver/can/can_how-to.rst +++ b/docs/software/modules/driver/can/can_how-to.rst @@ -6,14 +6,191 @@ How to Use the CAN Module ========================= -|tbc| +How to add a new CAN Message +---------------------------- -Use the CAN4 interface ----------------------- +#. Add the new CAN message to the symbol file (``tools/dbc/foxbms.sym``). + + #. If the message is |foxbms| specific prefix it with ``foxBMS``. + #. Set the DLC + #. Add a comment that follows the pattern + + - ``optional comment text (in:, fv:tx) optional comment text`` + for files that are transmitted and + - ``optional comment text (in:, fv:rx) optional comment text`` + for files that are received as seen by the |foxbms| hardware. + +#. Export the symbol file as dbc file. +#. Declare the callback function in + + - in file ``src\app\driver\can\cbs\tx\can_cbs_tx.h`` for + the transmit callbacks + - in file ``src\app\driver\can\cbs\rx\can_cbs_rx.h`` for + the receive callbacks + +#. Implement a callback. + If the message handling suites in any of the existing callback + implementation files (``src/app/driver/can/cbs/tx/*`` or respectively + ``src/app/driver/can/cbs/rx/*``), implement the callback there, otherwise + create a new file (and accompanying test file) and implement the callback + there. + +#. Add the message ID and message details: + + - in file ``src/app/driver/config/can_cfg_tx-message-definitions.h`` for + transmit messages + - in file ``src/app/driver/config/can_cfg_rx-message-definitions.h`` for + receive messages + +#. Add the message to the callback array in + + - in file ``src/app/driver/config/can_cfg_tx.c`` for transmit messages in + the array ``can_txMessages`` + - in file ``src/app/driver/config/can_cfg_rx.c`` for receive messages in the + array ``can_rxMessages`` + +#. Verify that the CAN message is defined and implemented as expected by + |foxbms| guidelines: + + .. code-block:: console + :caption: Verify CAN message definition and callback implementation + :name: can-message-implementation-verification + + C:\Users\vulpes\Documents\foxbms-2>python tests/can/check_ids.py + C:\Users\vulpes\Documents\foxbms-2>python tests/can/check_implemented.py + +.. warning:: + + These script do no syntactical or similar checks of the implementation. + These scripts do text based comparisons in order to help to get a consistent + style for the CAN message implementations. + **The correct implementation etc. must be checked by compiling and debugging.** + +Example for a Transmit Message +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Creating the Transmit Message +""""""""""""""""""""""""""""" + +In this example a message to transmit the |foxbms| system status is +implemented. +The name of the message is therefore ``BmsState`` (following PascalCase naming +convention). +In the symbol file the message is implemented as ``foxBMS_BmsState`` (prefix +``foxBMS`` followed by the message name) with the ID ``0x220``. +As the message is transmitted from the point of view of the BMS, the comment in +the symbol file must be +``Message containing the foxBMS system state (in:can_cbs_tx_state.c:CANTX_BmsState, fv:tx)``. +The new dbc file must be exported. + +Required Macros +""""""""""""""" + +The name of the macro to be implemented in +``src/app/driver/config/can_cfg_tx-message-definitions.h`` needs to be prefixed +with ``CANTX_ID`` (``CANTX`` is the module prefix) followed by the message name +in uppercase (``BMS_STATE``), i.e., the full macro name is +``CANTX_BMS_STATE_ID``. +The macro for the period of the transmitted message must be defined: Module +prefix ``CANTX`` followed by the message name (``BMS_STATE``) and the period in +milliseconds (``PERIOD_ms``), i.e., the full macro name is +``CANTX_BMS_STATE_PERIOD_ms``. +Last, the macro for the phase of the transmitted message must be defined: +Module prefix ``CANTX`` followed by the message name (``BMS_STATE``) and the +phase in milliseconds (``PHASE_ms``) i.e., the full macro name is +``CANTX_BMS_STATE_PHASE_ms``. + +.. literalinclude:: ./can_how-to_tx.c + :language: C + :linenos: + :start-after: example-can-message-id-macro-start + :end-before: example-can-message-id-macro-end + :caption: Adding the new message ID to the transmit message definition file + ``src/app/driver/config/can_cfg_tx-message-definitions.h`` + :name: adding-the-new-message-id + +Now the details of the ID need to be added in an additional macro, that is then +used for the initialization of the transmitted messages macro. +The macro must be named Module prefix (``CANTX``) followed by the message name +(``BMS_STATE``) and suffixed with ``MESSAGE``. + +.. literalinclude:: ./can_how-to_tx.c + :language: C + :linenos: + :start-after: example-can-message-id-details-start + :end-before: example-can-message-id-details-end + :caption: Adding the details of the new message ID to the transmit message + definition file + ``src/app/driver/config/can_cfg_tx-message-definitions.h`` + :name: adding-the-details-to-the-new-message + +Callback Function +""""""""""""""""" + +The callback declaration must be done in file +``src\app\driver\can\cbs\tx\can_cbs_tx.h``. + +.. literalinclude:: ./can_how-to_tx.c + :language: C + :linenos: + :start-after: example-can-tx-messages-callback-declaration-start + :end-before: example-can-tx-messages-callback-declaration-end + :caption: Declaration of the callback function in + ``src\app\driver\can\cbs\tx\can_cbs_tx.h`` + :name: callback-declaration + +The callback definition must be done in the appropriate implementation file, +i.e., for the BMS state message in +``src\app\driver\can\cbs\tx\can_cbs_tx_state.c``. + +.. literalinclude:: ./can_how-to_tx.c + :language: C + :linenos: + :start-after: example-can-tx-messages-callback-definition-start + :end-before: example-can-tx-messages-callback-definition-end + :caption: Definition of the callback function in + ``src\app\driver\can\cbs\tx\can_cbs_tx_state.c`` + :name: callback-definition + +Required Variables Adaptations +"""""""""""""""""""""""""""""" + +The message needs to be added the transmitted messages array as follows: + +.. literalinclude:: ./can_how-to_tx.c + :language: C + :linenos: + :start-after: example-can-tx-messages-configuration-start + :end-before: example-can-tx-messages-configuration-end + :caption: Adding the new message to the registry of transmitted messages + ``src/app/driver/config/can_cfg_tx.c`` + :name: adding-the-the-new-message-to-the-tx-registry + + +Verification +"""""""""""" + +Run the check scripts to verify that the messages are implemented as described +in this how-to's guidelines. + +.. code-block:: console + :caption: Verify CAN transmit message definition and callback implementation + + C:\Users\vulpes\Documents\foxbms-2>python tests/can/check_ids.py + C:\Users\vulpes\Documents\foxbms-2>python tests/can/check_implemented.py + +Example for a Receive Message +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The implementation of a receive message is done analogous, by replacing ``tx`` +with ``rx`` in paths, prefixes, function names etc. + +Using the CAN4 interface +------------------------ If the CAN Module should be extended to the CAN4 interface, a workaround for a -bug in |halcogen| has to be applied. For details, please refer to -:ref:`HALCOGEN_TOOL_DOCUMENTATION`. +bug in |halcogen| has to be applied. +For details, please refer to :ref:`HALCOGEN_TOOL_DOCUMENTATION`. Further Reading --------------- diff --git a/docs/software/modules/driver/can/can_how-to_tx.c b/docs/software/modules/driver/can/can_how-to_tx.c new file mode 100644 index 00000000..ff05d604 --- /dev/null +++ b/docs/software/modules/driver/can/can_how-to_tx.c @@ -0,0 +1,118 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_how-to_tx.c + * @author foxBMS Team + * @date 2022-09-12 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup SOME_GROUP + * @prefix CAN + * + * @brief Documentation file to show how a new CAN message is added to the + * project. + * + */ + +/*========== Includes =======================================================*/ +#include "general.h" + +#include "can_cfg.h" + +/*========== Macros and Definitions =========================================*/ + +/* example-can-message-id-macro-start */ +/** CAN message ID to send state */ +#define CANTX_BMS_STATE_ID (0x220u) +/** Periodicity of CAN state messages in ms */ +#define CANTX_BMS_STATE_PERIOD_ms (100u) +/** Phase of CAN state messages in ms */ +#define CANTX_BMS_STATE_PHASE_ms (0u) +/* example-can-message-id-macro-end */ + +/* example-can-message-id-details-start */ +#define CANTX_BMS_STATE_MESSAGE \ + { \ + .dlc = CAN_DEFAULT_DLC, \ + .id = CANTX_BMS_STATE_ID, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_BMS_STATE_PERIOD_ms, .phase = CANTX_BMS_STATE_PHASE_ms \ + } +/* example-can-message-id-details-end */ + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ +/* example-can-tx-messages-callback-declaration-start */ +extern uint32_t CANTX_BmsState( + CAN_MESSAGE_PROPERTIES_s message, + uint8_t *pCanData, + uint8_t *pMuxId, + const CAN_SHIM_s *const kpkCanShim); +/* example-can-tx-messages-callback-declaration-end */ + +/* example-can-tx-messages-configuration-start */ +const CAN_TX_MESSAGE_TYPE_s can_txMessages[] = { + /* other messages */ + {CAN_NODE_1, CANTX_BMS_STATE_MESSAGE, &CANTX_BmsState, NULL_PTR}, /*!< BMS state */ +}; +/* example-can-tx-messages-configuration-end */ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ +/* example-can-tx-messages-callback-definition-start */ +extern uint32_t CANTX_BmsState( + CAN_MESSAGE_PROPERTIES_s message, + uint8_t *pCanData, + uint8_t *pMuxId, + const CAN_SHIM_s *const kpkCanShim) { + /* Do message handling stuff */ + return 0; +} +/* example-can-tx-messages-callback-definition-end */ + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/docs/software/modules/driver/can/wscript b/docs/software/modules/driver/can/wscript new file mode 100644 index 00000000..ea73dbd8 --- /dev/null +++ b/docs/software/modules/driver/can/wscript @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# We kindly request you to use one or more of the following phrases to refer to +# foxBMS in your hardware, software, documentation or advertising materials: +# +# - "This product uses parts of foxBMS®" +# - "This product includes parts of foxBMS®" +# - "This product is derived from foxBMS®" + +"""Build Script: ``./docs/software/modules/engine/database/wscript`` +==================================================================== + +Builds the database example + +This build script is not meant to be reused! + +""" + +import os + + +def build(bld): + """Build the database object""" + source = ["can_how-to_tx.c"] + dummy_txt = "/* dummy file */\n" + dummy_headers = ["mcu", "HL_can", "os"] + for i in dummy_headers: + bld.path.find_or_declare(f"{i}.h").write(dummy_txt) + includes = [ + ".", + os.path.join("..", "..", "..", "..", "..", "src", "app", "driver", "config"), + os.path.join("..", "..", "..", "..", "..", "src", "app", "main", "include"), + os.path.join("..", "..", "..", "..", "..", "src", "app", "engine", "database"), + os.path.join("..", "..", "..", "..", "..", "src", "app", "engine", "config"), + os.path.join( + "..", "..", "..", "..", "..", "src", "app", "application", "config" + ), + ] + cflags = bld.env.CFLAGS_FOXBMS + bld.path.find_or_declare("needed-for-build.h").write( + "/* dummy file */\n" + "extern void OS_EnterTaskCritical();\n" + "extern void OS_ExitTaskCritical();\n" + ) + bld.add_group() + bld( + features="c", + source=source, + defines=[ + "MCU_ADC1_MAX_NR_CHANNELS=1", + "OS_QUEUE=void", + "canBASE_t=void", + 'canREG1="((uint32_t *)0xFFF7DC00U)"', + ], + includes=includes, + cflags=(cflags + ["--diag_suppress=179", "--diag_suppress=552"]), + idx=1, + ) diff --git a/docs/software/modules/driver/ts/murata/ncu15xh103f6sxx.rst b/docs/software/modules/driver/ts/murata/ncu15xh103f6sxx.rst new file mode 100644 index 00000000..418cd736 --- /dev/null +++ b/docs/software/modules/driver/ts/murata/ncu15xh103f6sxx.rst @@ -0,0 +1,16 @@ +.. include:: ./../../../../../macros.txt +.. include:: ./../../../../../units.txt + +.. + Comments: + Murata is the name of the sensor manufacturer + +.. spelling:: + Murata + +.. _MURATA_NCU15XH103F6SXX: + +MURATA NCU15XH103F6SXX +====================== + +|tbc| diff --git a/docs/software/modules/driver/ts/ts-sensors.rst b/docs/software/modules/driver/ts/ts-sensors.rst index 55d60eb9..36576c07 100644 --- a/docs/software/modules/driver/ts/ts-sensors.rst +++ b/docs/software/modules/driver/ts/ts-sensors.rst @@ -14,6 +14,8 @@ Supported Temperature Sensors Epcos Epc Fak + Murata + Mur Vishay Vis @@ -30,6 +32,7 @@ implement the :ref:`temperature_sensor_api`. ./epcos/b57251v5103j060.rst ./epcos/b57861s0103f045.rst ./fake/none.rst + ./murata/ncu15xh103f6sxx.rst ./vishay/ntcalug01a103g.rst ./vishay/ntcle317e4103sba.rst diff --git a/docs/software/modules/driver/ts/ts-short-names.csv b/docs/software/modules/driver/ts/ts-short-names.csv index dc47a10a..90f74dec 100644 --- a/docs/software/modules/driver/ts/ts-short-names.csv +++ b/docs/software/modules/driver/ts/ts-short-names.csv @@ -2,5 +2,6 @@ Manufacturer;Model;*Short Name* Epcos;B57251V5103J060;Epc00 Epcos;B57861S0103F045;Epc01 Fake;none;Fak00 +Murata;NCU15XH103F6XXS;Mur00 Vishay;NTCALUG01A103G;Vis00 Vishay;NTCLE317E4103SBA;Vis01 diff --git a/docs/software/modules/engine/database/database_how-to.c b/docs/software/modules/engine/database/database_how-to.c index f281d65c..7396e34a 100644 --- a/docs/software/modules/engine/database/database_how-to.c +++ b/docs/software/modules/engine/database/database_how-to.c @@ -43,8 +43,8 @@ * @file database_how-to.c * @author foxBMS Team * @date 2021-04-12 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup SOME_GROUP * @prefix DATA * diff --git a/docs/software/modules/task/ftask/ftask_how-to.c b/docs/software/modules/task/ftask/ftask_how-to.c index 18d4c37d..d1986625 100644 --- a/docs/software/modules/task/ftask/ftask_how-to.c +++ b/docs/software/modules/task/ftask/ftask_how-to.c @@ -43,8 +43,8 @@ * @file ftask_how-to.c * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup SOME_GROUP * @prefix FTSK * diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 86030d66..b6561012 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -51,6 +51,7 @@ enum enums expander extern +Farnell ferroelectric fiducial filename @@ -61,6 +62,7 @@ foxbms foxBMS foxmath fram +Fraunhofer freertos freeRTOS functionalities diff --git a/docs/tools/debugger/debugger-lauterbach.rst b/docs/tools/debugger/debugger-lauterbach.rst index 68cd0b62..66db9d14 100644 --- a/docs/tools/debugger/debugger-lauterbach.rst +++ b/docs/tools/debugger/debugger-lauterbach.rst @@ -19,8 +19,9 @@ Please carefully read the for Lauterbach. After setting up the hardware connection you should be able to load -the Trace32 application. For details on where to find a ready configuration -for |foxbms|, please refer to :numref:`WAF_TOOL_LAUTERBACH`. +the Trace32 application. +For details on where to find a ready configuration for |foxbms|, please refer +to :numref:`WAF_TOOL_LAUTERBACH`. .. figure:: lauterbach-buttons.png :alt: Buttons in the Lauterbach Trace32 environment @@ -40,11 +41,13 @@ the target and start with an attached debugger. Using a trace probe ^^^^^^^^^^^^^^^^^^^ Lauterbach supplies in addition to the debug probes also a trace probe for the -TMS570LC4357 target. Please refer to their customer support for details. +TMS570LC4357 target. +Please refer to their customer support for details. The setup of `Fraunhofer IISB`_ consists of a LA-3505 debugger connected to a LA-3580 trace probe with the LA-7992 parallel preprocessor for ARM/Cortex -architectures. |foxbms| features a compliant Mictor-38 connector in order -to be able to connect trace ports with up to 8 bit. If you need more bandwidth, -please contact us. The standard design can be adapted to up to 32 bit trace -bandwidth. +architectures. +|foxbms| features a compliant Mictor-38 connector in order to be able to +connect trace ports with up to 8 bit. If you need more bandwidth, please +contact us. +The standard design can be adapted to up to 32 bit trace bandwidth. diff --git a/docs/tools/static-analysis/axivion.rst b/docs/tools/static-analysis/axivion.rst index 30768264..ae62d777 100644 --- a/docs/tools/static-analysis/axivion.rst +++ b/docs/tools/static-analysis/axivion.rst @@ -82,7 +82,8 @@ Running the Tests ^^^^^^^^^^^^^^^^^ Press :kbd:`Ctrl + Shift + B` and run the task *axivion analysis*. This task -runs the Axivion analysis script ``tests/axivion/scripts/start_analysis.bat``. +runs the Axivion analysis script +``tests/axivion/scripts/start_local_analysis.bat``. Issues ^^^^^^ diff --git a/ide.bat b/ide.bat index fd36cdef..824d195a 100644 --- a/ide.bat +++ b/ide.bat @@ -79,6 +79,13 @@ @EXIT /b 1 ) +@IF NOT EXIST %~dp0\.vscode\settings.json ( + @ECHO VS code settings do not exist. + @ECHO Creating VS Code setup^.^.^. + @%~dp0\waf configure + @ECHO Done^.^.^. +) + @PUSHD %~dp0 @start "foxBMS Development" /b %VS_CODE% . @IF %ERRORLEVEL% NEQ 0 ( diff --git a/src/app/application/algorithm/algorithm.c b/src/app/application/algorithm/algorithm.c index dc47ee30..6ba830f7 100644 --- a/src/app/application/algorithm/algorithm.c +++ b/src/app/application/algorithm/algorithm.c @@ -43,8 +43,8 @@ * @file algorithm.c * @author foxBMS Team * @date 2017-12-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ALGORITHMS * @prefix ALGO * diff --git a/src/app/application/algorithm/algorithm.h b/src/app/application/algorithm/algorithm.h index e39771ca..03446215 100644 --- a/src/app/application/algorithm/algorithm.h +++ b/src/app/application/algorithm/algorithm.h @@ -43,8 +43,8 @@ * @file algorithm.h * @author foxBMS Team * @date 2017-12-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ALGORITHMS * @prefix ALGO * diff --git a/src/app/application/algorithm/config/algorithm_cfg.c b/src/app/application/algorithm/config/algorithm_cfg.c index 7df3470e..3a4474cc 100644 --- a/src/app/application/algorithm/config/algorithm_cfg.c +++ b/src/app/application/algorithm/config/algorithm_cfg.c @@ -43,8 +43,8 @@ * @file algorithm_cfg.c * @author foxBMS Team * @date 2017-12-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ALGORITHMS_CONFIGURATION * @prefix ALGO * diff --git a/src/app/application/algorithm/config/algorithm_cfg.h b/src/app/application/algorithm/config/algorithm_cfg.h index b5f541fc..1b6a5093 100644 --- a/src/app/application/algorithm/config/algorithm_cfg.h +++ b/src/app/application/algorithm/config/algorithm_cfg.h @@ -43,8 +43,8 @@ * @file algorithm_cfg.h * @author foxBMS Team * @date 2017-12-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ALGORITHMS_CONFIGURATION * @prefix ALGO * diff --git a/src/app/application/algorithm/moving_average/moving_average.c b/src/app/application/algorithm/moving_average/moving_average.c index fcc144d9..dd909223 100644 --- a/src/app/application/algorithm/moving_average/moving_average.c +++ b/src/app/application/algorithm/moving_average/moving_average.c @@ -43,8 +43,8 @@ * @file moving_average.c * @author foxBMS Team * @date 2017-12-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ALGORITHMS * @prefix ALGO * diff --git a/src/app/application/algorithm/moving_average/moving_average.h b/src/app/application/algorithm/moving_average/moving_average.h index 3fd8c3b3..4ce00363 100644 --- a/src/app/application/algorithm/moving_average/moving_average.h +++ b/src/app/application/algorithm/moving_average/moving_average.h @@ -43,8 +43,8 @@ * @file moving_average.h * @author foxBMS Team * @date 2017-12-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ALGORITHMS * @prefix ALGO * diff --git a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.c b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.c index c0a87dd5..28e2138f 100644 --- a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.c +++ b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.c @@ -43,8 +43,8 @@ * @file soc_counting.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.h b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.h index 83618424..a5a6e8eb 100644 --- a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.h +++ b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting.h @@ -43,8 +43,8 @@ * @file soc_counting.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.c b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.c index 6321c6c8..f57bd2e1 100644 --- a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.c +++ b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.c @@ -43,8 +43,8 @@ * @file soc_counting_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.h b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.h index d038fbc6..a6280c95 100644 --- a/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.h +++ b/src/app/application/algorithm/state_estimation/soc/counting/soc_counting_cfg.h @@ -43,8 +43,8 @@ * @file soc_counting_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.c b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.c index cf689191..47b538b7 100644 --- a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.c +++ b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.c @@ -43,8 +43,8 @@ * @file soc_debug.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.h b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.h index e85a86f5..cf4d6198 100644 --- a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.h +++ b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug.h @@ -43,8 +43,8 @@ * @file soc_debug.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.c b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.c index 61196196..9201a55a 100644 --- a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.c +++ b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.c @@ -43,8 +43,8 @@ * @file soc_debug_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.h b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.h index f1ee3920..3d25d6b3 100644 --- a/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.h +++ b/src/app/application/algorithm/state_estimation/soc/debug/soc_debug_cfg.h @@ -43,8 +43,8 @@ * @file soc_debug_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/none/soc_none.c b/src/app/application/algorithm/state_estimation/soc/none/soc_none.c index c60a18fa..3b036f26 100644 --- a/src/app/application/algorithm/state_estimation/soc/none/soc_none.c +++ b/src/app/application/algorithm/state_estimation/soc/none/soc_none.c @@ -43,8 +43,8 @@ * @file soc_none.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/none/soc_none.h b/src/app/application/algorithm/state_estimation/soc/none/soc_none.h index 803736c4..039b6d00 100644 --- a/src/app/application/algorithm/state_estimation/soc/none/soc_none.h +++ b/src/app/application/algorithm/state_estimation/soc/none/soc_none.h @@ -43,8 +43,8 @@ * @file soc_none.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.c b/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.c index aa450060..46a304b0 100644 --- a/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.c +++ b/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.c @@ -43,8 +43,8 @@ * @file soc_none_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.h b/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.h index f503be01..4fb9933f 100644 --- a/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.h +++ b/src/app/application/algorithm/state_estimation/soc/none/soc_none_cfg.h @@ -43,8 +43,8 @@ * @file soc_none_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOC * diff --git a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.c b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.c index 72d3a12f..c6e091f2 100644 --- a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.c +++ b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.c @@ -43,8 +43,8 @@ * @file soe_counting.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.h b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.h index f74196e0..c3707f58 100644 --- a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.h +++ b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting.h @@ -43,8 +43,8 @@ * @file soe_counting.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.c b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.c index f9ff5e9b..246bff5b 100644 --- a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.c +++ b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.c @@ -43,8 +43,8 @@ * @file soe_counting_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.h b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.h index 0cdf27f0..9e0390a2 100644 --- a/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.h +++ b/src/app/application/algorithm/state_estimation/soe/counting/soe_counting_cfg.h @@ -43,8 +43,8 @@ * @file soe_counting_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.c b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.c index eb2ddc8c..2e4ba39d 100644 --- a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.c +++ b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.c @@ -43,8 +43,8 @@ * @file soe_debug.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.h b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.h index 5e04adfe..c928ad7b 100644 --- a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.h +++ b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug.h @@ -43,8 +43,8 @@ * @file soe_debug.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.c b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.c index 31149fe2..7ef38cd4 100644 --- a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.c +++ b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.c @@ -43,8 +43,8 @@ * @file soe_debug_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.h b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.h index 3cbf546f..c107b27d 100644 --- a/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.h +++ b/src/app/application/algorithm/state_estimation/soe/debug/soe_debug_cfg.h @@ -43,8 +43,8 @@ * @file soe_debug_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/none/soe_none.c b/src/app/application/algorithm/state_estimation/soe/none/soe_none.c index d063e9a9..f713ea39 100644 --- a/src/app/application/algorithm/state_estimation/soe/none/soe_none.c +++ b/src/app/application/algorithm/state_estimation/soe/none/soe_none.c @@ -43,8 +43,8 @@ * @file soe_none.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/none/soe_none.h b/src/app/application/algorithm/state_estimation/soe/none/soe_none.h index 67a841d8..1ca98141 100644 --- a/src/app/application/algorithm/state_estimation/soe/none/soe_none.h +++ b/src/app/application/algorithm/state_estimation/soe/none/soe_none.h @@ -43,8 +43,8 @@ * @file soe_none.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.c b/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.c index 8e651e03..d433f4c4 100644 --- a/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.c +++ b/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.c @@ -43,8 +43,8 @@ * @file soe_none_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.h b/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.h index 9f08deaf..72ab9a09 100644 --- a/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.h +++ b/src/app/application/algorithm/state_estimation/soe/none/soe_none_cfg.h @@ -43,8 +43,8 @@ * @file soe_none_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOE * diff --git a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.c b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.c index 3e35b306..bb2a0bcc 100644 --- a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.c +++ b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.c @@ -43,8 +43,8 @@ * @file sof_trapezoid.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION_CONFIGURATION * @prefix SOF * @@ -69,12 +69,9 @@ /*========== Static Constant and Variable Definitions =======================*/ /** @{ - * module-local static Variables that are calculated at startup and used later to avoid divisions at runtime + * module-local static variable that is calculated at startup and used later to avoid divisions at runtime */ static SOF_CURVE_s sof_curveRecommendedOperatingCurrent; -static SOF_CURVE_s sof_curveMol; -static SOF_CURVE_s sof_curveRsl; -static SOF_CURVE_s sof_curveMsl; /** @} */ /** local copies of database tables */ @@ -350,17 +347,6 @@ static SOF_CURRENT_LIMITS_s SOF_MinimumOfTwoSofValues( extern void SOF_Init(void) { /* Calculating SOF curve for the recommended operating current */ SOF_CalculateCurves(&sof_recommendedCurrent, &sof_curveRecommendedOperatingCurrent); - -#if BMS_CHECK_SOF_CURRENT_LIMITS == true - /* Calculating SOF curve for maximum operating limit */ - SOF_CalculateCurves(&sof_maximumOperatingLimit, &sof_curveMol); - - /* Calculating SOF curve for recommended safety limit */ - SOF_CalculateCurves(&sof_recommendedSafetyLimit, &sof_curveRsl); - - /* Calculating SOF curve for maximum safety limit */ - SOF_CalculateCurves(&sof_configMaximumSafetyLimit, &sof_curveMsl); -#endif } extern void SOF_Calculation(void) { @@ -416,80 +402,6 @@ extern void SOF_Calculation(void) { sof_tableSofValues.recommendedPeakChargeCurrent_mA[s] = 0.0f; sof_tableSofValues.recommendedPeakDischargeCurrent_mA[s] = 0.0f; } - -#if BMS_CHECK_SOF_CURRENT_LIMITS == true - /* Calculate maximum allowed current MOL level */ - SOF_CalculateVoltageBasedCurrentLimit( - (float)sof_tableMinimumMaximumValues.minimumCellVoltage_mV[s], - (float)sof_tableMinimumMaximumValues.maximumCellVoltage_mV[s], - &voltageBasedSof, - &sof_maximumOperatingLimit, - &sof_curveMol); - SOF_CalculateTemperatureBasedCurrentLimit( - (float)sof_tableMinimumMaximumValues.minimumTemperature_ddegC[s], - (float)sof_tableMinimumMaximumValues.maximumTemperature_ddegC[s], - &temperatureBasedSof, - &sof_maximumOperatingLimit, - &sof_curveMol); - allowedCurrent = SOF_MinimumOfTwoSofValues(voltageBasedSof, temperatureBasedSof); - sof_tableSofValues.continuousMolChargeCurrent_mA[s] = allowedCurrent.continuousChargeCurrent_mA; - sof_tableSofValues.continuousMolDischargeCurrent_mA[s] = allowedCurrent.continuousDischargeCurrent_mA; - sof_tableSofValues.peakMolChargeCurrent_mA[s] = allowedCurrent.peakChargeCurrent_mA; - sof_tableSofValues.peakMolDischargeCurrent_mA[s] = allowedCurrent.peakDischargeCurrent_mA; - - /* Calculate maximum allowed current RSL level */ - SOF_CalculateVoltageBasedCurrentLimit( - (float)sof_tableMinimumMaximumValues.minimumCellVoltage_mV[s], - (float)sof_tableMinimumMaximumValues.maximumCellVoltage_mV[s], - &voltageBasedSof, - &sof_recommendedSafetyLimit, - &sof_curveRsl); - SOF_CalculateTemperatureBasedCurrentLimit( - (float)sof_tableMinimumMaximumValues.minimumTemperature_ddegC[s], - (float)sof_tableMinimumMaximumValues.maximumTemperature_ddegC[s], - &temperatureBasedSof, - &sof_recommendedSafetyLimit, - &sof_curveRsl); - allowedCurrent = SOF_MinimumOfTwoSofValues(voltageBasedSof, temperatureBasedSof); - sof_tableSofValues.continuousRslChargeCurrent_mA[s] = allowedCurrent.continuousChargeCurrent_mA; - sof_tableSofValues.continuousRslDischargeCurrent_mA[s] = allowedCurrent.continuousDischargeCurrent_mA; - sof_tableSofValues.peakRslChargeCurrent_mA[s] = allowedCurrent.peakChargeCurrent_mA; - sof_tableSofValues.peakRslDischargeCurrent_mA[s] = allowedCurrent.peakDischargeCurrent_mA; - - /* Calculate maximum allowed current MSL level */ - SOF_CalculateVoltageBasedCurrentLimit( - (float)sof_tableMinimumMaximumValues.minimumCellVoltage_mV[s], - (float)sof_tableMinimumMaximumValues.maximumCellVoltage_mV[s], - &voltageBasedSof, - &sof_configMaximumSafetyLimit, - &sof_curveMsl); - SOF_CalculateTemperatureBasedCurrentLimit( - (float)sof_tableMinimumMaximumValues.minimumTemperature_ddegC[s], - (float)sof_tableMinimumMaximumValues.maximumTemperature_ddegC[s], - &temperatureBasedSof, - &sof_configMaximumSafetyLimit, - &sof_curveMsl); - allowedCurrent = SOF_MinimumOfTwoSofValues(voltageBasedSof, temperatureBasedSof); - sof_tableSofValues.continuousMslChargeCurrent_mA[s] = allowedCurrent.continuousChargeCurrent_mA; - sof_tableSofValues.continuousMslDischargeCurrent_mA[s] = allowedCurrent.continuousDischargeCurrent_mA; - sof_tableSofValues.peakMslChargeCurrent_mA[s] = allowedCurrent.peakChargeCurrent_mA; - sof_tableSofValues.peakMslDischargeCurrent_mA[s] = allowedCurrent.peakDischargeCurrent_mA; -#else /* BMS_CHECK_SOF_CURRENT_LIMITS == false */ - sof_tableSofValues.continuousMolChargeCurrent_mA[s] = BC_CURRENT_MAX_CHARGE_MOL_mA; - sof_tableSofValues.continuousMolDischargeCurrent_mA[s] = BC_CURRENT_MAX_DISCHARGE_MOL_mA; - sof_tableSofValues.peakMolChargeCurrent_mA[s] = BC_CURRENT_MAX_CHARGE_MOL_mA; - sof_tableSofValues.peakMolDischargeCurrent_mA[s] = BC_CURRENT_MAX_DISCHARGE_MOL_mA; - - sof_tableSofValues.continuousRslChargeCurrent_mA[s] = BC_CURRENT_MAX_CHARGE_RSL_mA; - sof_tableSofValues.continuousRslDischargeCurrent_mA[s] = BC_CURRENT_MAX_DISCHARGE_RSL_mA; - sof_tableSofValues.peakRslChargeCurrent_mA[s] = BC_CURRENT_MAX_CHARGE_RSL_mA; - sof_tableSofValues.peakRslDischargeCurrent_mA[s] = BC_CURRENT_MAX_DISCHARGE_RSL_mA; - - sof_tableSofValues.continuousMslChargeCurrent_mA[s] = BC_CURRENT_MAX_CHARGE_MSL_mA; - sof_tableSofValues.continuousMslDischargeCurrent_mA[s] = BC_CURRENT_MAX_DISCHARGE_MSL_mA; - sof_tableSofValues.peakMslChargeCurrent_mA[s] = BC_CURRENT_MAX_CHARGE_MSL_mA; - sof_tableSofValues.peakMslDischargeCurrent_mA[s] = BC_CURRENT_MAX_DISCHARGE_MSL_mA; -#endif /* BMS_CHECK_SOF_CURRENT_LIMITS == true */ } if (minCharge_mA > (float)BS_MAXIMUM_STRING_CURRENT_mA) { @@ -505,6 +417,16 @@ extern void SOF_Calculation(void) { sof_tableSofValues.recommendedPeakPackChargeCurrent_mA = (float)nrClosedStrings * minCharge_mA; sof_tableSofValues.recommendedPeakPackDischargeCurrent_mA = (float)nrClosedStrings * minDischarge_mA; + /* Check if currently a transition into ERROR state in the BMS state + * machine is ongoing. Set allowed current to 0 if this is the case. + */ + if (BMS_IsTransitionToErrorStateActive() == true) { + sof_tableSofValues.recommendedContinuousPackChargeCurrent_mA = 0.0f; + sof_tableSofValues.recommendedContinuousPackDischargeCurrent_mA = 0.0f; + sof_tableSofValues.recommendedPeakPackChargeCurrent_mA = 0.0f; + sof_tableSofValues.recommendedPeakPackDischargeCurrent_mA = 0.0f; + } + DATA_WRITE_DATA(&sof_tableSofValues); } diff --git a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.h b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.h index 4ced08c9..8c2e4a1b 100644 --- a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.h +++ b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid.h @@ -43,8 +43,8 @@ * @file sof_trapezoid.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOF * diff --git a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.c b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.c index 8f36e86e..81fb1d6c 100644 --- a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.c +++ b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.c @@ -43,8 +43,8 @@ * @file sof_trapezoid_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOF * @@ -78,57 +78,6 @@ const SOF_CONFIG_s sof_recommendedCurrent = { .limitLowerCellVoltage_mV = SOF_VOLTAGE_LIMIT_DISCHARGE_mV, .cutoffLowerCellVoltage_mV = SOF_VOLTAGE_CUTOFF_DISCHARGE_mV}; -const SOF_CONFIG_s sof_maximumOperatingLimit = { - .maximumChargeCurrent_mA = SOF_MOL_STRING_CURRENT_CONTINUOUS_CHARGE_mA, - .maximumDischargeCurrent_mA = SOF_MOL_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA, - .limpHomeCurrent_mA = SOF_MOL_STRING_CURRENT_LIMP_HOME_mA, - .cutoffLowTemperatureDischarge_ddegC = SOF_MOL_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC, - .limitLowTemperatureDischarge_ddegC = SOF_MOL_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC, - .cutoffLowTemperatureCharge_ddegC = SOF_MOL_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC, - .limitLowTemperatureCharge_ddegC = SOF_MOL_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC, - .cutoffHighTemperatureDischarge_ddegC = SOF_MOL_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC, - .limitHighTemperatureDischarge_ddegC = SOF_MOL_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC, - .cutoffHighTemperatureCharge_ddegC = SOF_MOL_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC, - .limitHighTemperatureCharge_ddegC = SOF_MOL_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC, - .limitUpperCellVoltage_mV = SOF_MOL_VOLTAGE_LIMIT_CHARGE_mV, - .cutoffUpperCellVoltage_mV = SOF_MOL_VOLTAGE_CUTOFF_CHARGE_mV, - .limitLowerCellVoltage_mV = SOF_MOL_VOLTAGE_LIMIT_DISCHARGE_mV, - .cutoffLowerCellVoltage_mV = SOF_MOL_VOLTAGE_CUTOFF_DISCHARGE_mV}; - -const SOF_CONFIG_s sof_recommendedSafetyLimit = { - .maximumChargeCurrent_mA = SOF_RSL_STRING_CURRENT_CONTINUOUS_CHARGE_mA, - .maximumDischargeCurrent_mA = SOF_RSL_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA, - .limpHomeCurrent_mA = SOF_RSL_STRING_CURRENT_LIMP_HOME_mA, - .cutoffLowTemperatureDischarge_ddegC = SOF_RSL_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC, - .limitLowTemperatureDischarge_ddegC = SOF_RSL_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC, - .cutoffLowTemperatureCharge_ddegC = SOF_RSL_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC, - .limitLowTemperatureCharge_ddegC = SOF_RSL_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC, - .cutoffHighTemperatureDischarge_ddegC = SOF_RSL_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC, - .limitHighTemperatureDischarge_ddegC = SOF_RSL_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC, - .cutoffHighTemperatureCharge_ddegC = SOF_RSL_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC, - .limitHighTemperatureCharge_ddegC = SOF_RSL_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC, - .limitUpperCellVoltage_mV = SOF_RSL_VOLTAGE_LIMIT_CHARGE_mV, - .cutoffUpperCellVoltage_mV = SOF_RSL_VOLTAGE_CUTOFF_CHARGE_mV, - .limitLowerCellVoltage_mV = SOF_RSL_VOLTAGE_LIMIT_DISCHARGE_mV, - .cutoffLowerCellVoltage_mV = SOF_RSL_VOLTAGE_CUTOFF_DISCHARGE_mV}; - -const SOF_CONFIG_s sof_configMaximumSafetyLimit = { - .maximumChargeCurrent_mA = SOF_MSL_STRING_CURRENT_CONTINUOUS_CHARGE_mA, - .maximumDischargeCurrent_mA = SOF_MSL_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA, - .limpHomeCurrent_mA = SOF_MSL_STRING_CURRENT_LIMP_HOME_mA, - .cutoffLowTemperatureDischarge_ddegC = SOF_MSL_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC, - .limitLowTemperatureDischarge_ddegC = SOF_MSL_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC, - .cutoffLowTemperatureCharge_ddegC = SOF_MSL_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC, - .limitLowTemperatureCharge_ddegC = SOF_MSL_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC, - .cutoffHighTemperatureDischarge_ddegC = SOF_MSL_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC, - .limitHighTemperatureDischarge_ddegC = SOF_MSL_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC, - .cutoffHighTemperatureCharge_ddegC = SOF_MSL_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC, - .limitHighTemperatureCharge_ddegC = SOF_MSL_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC, - .limitUpperCellVoltage_mV = SOF_MSL_VOLTAGE_LIMIT_CHARGE_mV, - .cutoffUpperCellVoltage_mV = SOF_MSL_VOLTAGE_CUTOFF_CHARGE_mV, - .limitLowerCellVoltage_mV = SOF_MSL_VOLTAGE_LIMIT_DISCHARGE_mV, - .cutoffLowerCellVoltage_mV = SOF_MSL_VOLTAGE_CUTOFF_DISCHARGE_mV}; - /*========== Static Function Prototypes =====================================*/ /*========== Static Function Implementations ================================*/ diff --git a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.h b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.h index 35313f8d..540fe859 100644 --- a/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.h +++ b/src/app/application/algorithm/state_estimation/sof/trapezoid/sof_trapezoid_cfg.h @@ -43,8 +43,8 @@ * @file sof_trapezoid_cfg.h * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION_CONFIGURATION * @prefix SOF * @@ -58,37 +58,21 @@ /*========== Includes =======================================================*/ #include "general.h" +#include "battery_cell_cfg.h" + /*========== Macros and Definitions =========================================*/ /** * Maximum current in mA in charge direction that a string can sustain. * Normally set once for the specific battery cell from data sheet */ -#define SOF_STRING_CURRENT_CONTINUOUS_CHARGE_mA (120000.00f) - -/** - * Different alarm levels for the maximum continuous charge current in mA. - * @{ - */ -#define SOF_MOL_STRING_CURRENT_CONTINUOUS_CHARGE_mA (10000.00f) -#define SOF_RSL_STRING_CURRENT_CONTINUOUS_CHARGE_mA (11500.00f) -#define SOF_MSL_STRING_CURRENT_CONTINUOUS_CHARGE_mA (12200.00f) -/**@}*/ +#define SOF_STRING_CURRENT_CONTINUOUS_CHARGE_mA ((float)BC_CURRENT_MAX_CHARGE_MOL_mA) /** * Maximum current in mA in discharge direction that a string can deliver. * Normally set once for the specific battery cell from data sheet. */ -#define SOF_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA (120000.00f) - -/** - * Different alarm levels for the maximum continuous string discharge current in mA. - * @{ - */ -#define SOF_MOL_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA (10000.00f) -#define SOF_RSL_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA (11500.00f) -#define SOF_MSL_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA (12200.00f) -/**@}*/ +#define SOF_STRING_CURRENT_CONTINUOUS_DISCHARGE_mA ((float)BC_CURRENT_MAX_DISCHARGE_MOL_mA) /** * Current in mA that the string should be able to discharge when in @@ -97,224 +81,81 @@ */ #define SOF_STRING_CURRENT_LIMP_HOME_mA (20000.00f) -/** - * Different alarm levels for the limp home current in mA - * @{ - */ -#define SOF_MOL_STRING_CURRENT_LIMP_HOME_mA (20000.00f) -#define SOF_RSL_STRING_CURRENT_LIMP_HOME_mA (20000.00f) -#define SOF_MSL_STRING_CURRENT_LIMP_HOME_mA (20000.00f) -/**@}*/ - /** * Cold temperature in deci °C where the derating of maximum discharge * current starts, i.e., below this temperature battery pack should not deliver * full discharge current. */ -#define SOF_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (0) - -/** - * Different alarm levels for the cold temperature in deci °C where the - * derating of maximum discharge current starts, i.e., below this temperature - * battery pack should not deliver full discharge current. - * @{ - */ -#define SOF_MOL_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (0) -#define SOF_RSL_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (0) -#define SOF_MSL_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (0) -/**@}*/ +#define SOF_TEMPERATURE_LOW_CUTOFF_DISCHARGE_ddegC (BC_TEMPERATURE_MIN_DISCHARGE_MOL_ddegC) /** * Cold temperature in deci °C where the derating of maximum discharge * current is fully applied, i.e., below this temperature battery pack should * not deliver any current in discharge direction. */ -#define SOF_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (-100) - -/** - * Different alarm levels for the cold temperature in deci °C where the - * derating of maximum discharge current is fully applied. Below this - * temperature the battery pack should not deliver any current in discharge - * direction. - * @{ - */ -#define SOF_MOL_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (-100) -#define SOF_RSL_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (-100) -#define SOF_MSL_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (-100) -/**@}*/ +#define SOF_TEMPERATURE_LOW_LIMIT_DISCHARGE_ddegC (BC_TEMPERATURE_MIN_DISCHARGE_MSL_ddegC) /** * Cold temperature in deci °C where the derating of maximum charge current * starts, i.e., below this temperature battery pack should not deliver full * charge current. */ -#define SOF_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (0) - -/** - * Different alarm levels for the cold temperature in deci °C where the - * derating of maximum charge current starts, i.e., below this temperature - * battery pack should not deliver full charge current - * @{ - */ -#define SOF_MOL_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (0) -#define SOF_RSL_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (0) -#define SOF_MSL_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (0) -/**@}*/ +#define SOF_TEMPERATURE_LOW_CUTOFF_CHARGE_ddegC (BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC) /** * Cold temperature in deci °C where the derating of maximum charge current * is fully applied, i.e., below this temperature battery pack should not * deliver any current in charge direction. */ -#define SOF_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (-100) - -/** - * Different alarm levels for the cold temperature in deci °C where the - * derating of maximum charge current is fully applied. Below this temperature - * the battery pack should not deliver any current in charge direction. - * @{ - */ -#define SOF_MOL_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (-100) -#define SOF_RSL_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (-100) -#define SOF_MSL_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (-100) -/**@}*/ +#define SOF_TEMPERATURE_LOW_LIMIT_CHARGE_ddegC (BC_TEMPERATURE_MIN_CHARGE_MSL_ddegC) /** * Hot temperature in deci °C where the derating of maximum discharge * current starts, i.e., above this temperature battery pack should not deliver * full discharge current. */ -#define SOF_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (450) - -/** - * Different alarm levels for the high temperature in deci °C where the - * derating of maximum discharge current starts, i.e., above this temperature - * battery pack should not deliver full discharge current - * @{ - */ -#define SOF_MOL_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (450) -#define SOF_RSL_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (450) -#define SOF_MSL_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (450) -/**@}*/ +#define SOF_TEMPERATURE_HIGH_CUTOFF_DISCHARGE_ddegC (BC_TEMPERATURE_MAX_DISCHARGE_MOL_ddegC) /** * Hot temperature in deci °C where the derating of maximum discharge * current is fully applied, i.e., above this temperature battery pack should * not deliver any current in discharge direction. */ -#define SOF_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (550) - -/** - * Different alarm levels for the high temperature in deci °C where the - * derating of maximum discharge current is fully applied. Above this - * temperature the battery pack should not deliver any current in discharge - * direction. - * @{ - */ -#define SOF_MOL_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (550) -#define SOF_RSL_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (550) -#define SOF_MSL_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (550) -/**@}*/ +#define SOF_TEMPERATURE_HIGH_LIMIT_DISCHARGE_ddegC (BC_TEMPERATURE_MAX_DISCHARGE_MSL_ddegC) /** * Hot temperature in deci °C where the derating of maximum charge current * starts, i.e., above this temperature battery pack should not deliver full * charge current. */ -#define SOF_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (450) - -/** - * Different alarm levels for the high temperature in deci °C where the - * derating of maximum charge current starts, i.e., above this temperature - * battery pack should not deliver full charge current - * @{ - */ -#define SOF_MOL_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (450) -#define SOF_RSL_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (450) -#define SOF_MSL_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (450) -/**@}*/ +#define SOF_TEMPERATURE_HIGH_CUTOFF_CHARGE_ddegC (BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC) /** * Hot temperature in deci °C where the derating of maximum charge current * is fully applied, i.e., above this temperature battery pack should not * deliver any current in charge direction. */ -#define SOF_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (550) - -/** - * Different alarm levels for the high temperature in deci °C where the - * derating of maximum charge current is fully applied. Above this temperature - * the battery pack should not deliver any current in charge direction. - * @{ - */ -#define SOF_MOL_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (550) -#define SOF_RSL_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (550) -#define SOF_MSL_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (550) -/**@}*/ +#define SOF_TEMPERATURE_HIGH_LIMIT_CHARGE_ddegC (BC_TEMPERATURE_MAX_CHARGE_MSL_ddegC) /** * Above this voltage value battery pack should not be exposed to full current in charge direction. */ -#define SOF_VOLTAGE_CUTOFF_CHARGE_mV (2400) - -/** - * Different alarm levels for the upper voltage limit where the derating of - * maximum charge current starts. Above this value the battery pack - * should not deliver full current in charge direction. - * @{ - */ -#define SOF_MOL_VOLTAGE_CUTOFF_CHARGE_mV (2400) -#define SOF_RSL_VOLTAGE_CUTOFF_CHARGE_mV (2400) -#define SOF_MSL_VOLTAGE_CUTOFF_CHARGE_mV (2400) -/**@}*/ +#define SOF_VOLTAGE_CUTOFF_CHARGE_mV (BC_VOLTAGE_MAX_MOL_mV) /** * Above this voltage value battery pack should not be exposed to any current in charge direction. */ -#define SOF_VOLTAGE_LIMIT_CHARGE_mV (2550) - -/** - * Different alarm levels for the upper voltage limit where the derating of - * maximum charge current is fully applied. Above this value the battery pack - * should not deliver any current in charge direction. - * @{ - */ -#define SOF_MOL_VOLTAGE_LIMIT_CHARGE_mV (2550) -#define SOF_RSL_VOLTAGE_LIMIT_CHARGE_mV (2550) -#define SOF_MSL_VOLTAGE_LIMIT_CHARGE_mV (2550) -/**@}*/ +#define SOF_VOLTAGE_LIMIT_CHARGE_mV (BC_VOLTAGE_MAX_RSL_mV) /** * Below this voltage value battery pack should not deliver full current in discharge direction. */ -#define SOF_VOLTAGE_CUTOFF_DISCHARGE_mV (2000) - -/** - * Different alarm levels for the lower voltage limit where the derating of - * maximum discharge current starts. Below this value the battery pack - * should not deliver full current in discharge direction. - * @{ - */ -#define SOF_MOL_VOLTAGE_CUTOFF_DISCHARGE_mV (2000) -#define SOF_RSL_VOLTAGE_CUTOFF_DISCHARGE_mV (2000) -#define SOF_MSL_VOLTAGE_CUTOFF_DISCHARGE_mV (2000) -/**@}*/ +#define SOF_VOLTAGE_CUTOFF_DISCHARGE_mV (BC_VOLTAGE_MIN_MOL_mV) /** * Below this voltage value battery pack should not deliver any current in discharge direction. */ -#define SOF_VOLTAGE_LIMIT_DISCHARGE_mV (1750) - -/** - * Different alarm levels for the lower voltage limit where the derating of - * maximum discharge is fully applied. Below this value the battery pack - * should not deliver any current in discharge direction. - * @{ - */ -#define SOF_MOL_VOLTAGE_LIMIT_DISCHARGE_mV (1750) -#define SOF_RSL_VOLTAGE_LIMIT_DISCHARGE_mV (1750) -#define SOF_MSL_VOLTAGE_LIMIT_DISCHARGE_mV (1750) -/**@}*/ +#define SOF_VOLTAGE_LIMIT_DISCHARGE_mV (BC_VOLTAGE_MIN_RSL_mV) /** * structure for configuration of SoF Calculation @@ -355,16 +196,6 @@ typedef struct { */ extern const SOF_CONFIG_s sof_recommendedCurrent; -/** - * Configuration values for the SOF window of the different alarm levels (MOL, - * RSL and MSL) - * @{ - */ -extern const SOF_CONFIG_s sof_maximumOperatingLimit; -extern const SOF_CONFIG_s sof_recommendedSafetyLimit; -extern const SOF_CONFIG_s sof_configMaximumSafetyLimit; -/**@}*/ - /*========== Extern Function Prototypes =====================================*/ /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ diff --git a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.c b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.c index 9516320b..7b0b00db 100644 --- a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.c +++ b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.c @@ -43,8 +43,8 @@ * @file soh_debug.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.h b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.h index 2e797bea..64ccef94 100644 --- a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.h +++ b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug.h @@ -43,8 +43,8 @@ * @file soh_debug.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.c b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.c index 1876d59e..e8747776 100644 --- a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.c +++ b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.c @@ -43,8 +43,8 @@ * @file soh_debug_cfg.c * @author foxBMS Team * @date 2021-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.h b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.h index 16ebbdf6..11c2b0c3 100644 --- a/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.h +++ b/src/app/application/algorithm/state_estimation/soh/debug/soh_debug_cfg.h @@ -43,8 +43,8 @@ * @file soh_debug_cfg.h * @author foxBMS Team * @date 2021-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/none/soh_none.c b/src/app/application/algorithm/state_estimation/soh/none/soh_none.c index 1157bd41..c1d8eb74 100644 --- a/src/app/application/algorithm/state_estimation/soh/none/soh_none.c +++ b/src/app/application/algorithm/state_estimation/soh/none/soh_none.c @@ -43,8 +43,8 @@ * @file soh_none.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/none/soh_none.h b/src/app/application/algorithm/state_estimation/soh/none/soh_none.h index d55e92f7..315dca13 100644 --- a/src/app/application/algorithm/state_estimation/soh/none/soh_none.h +++ b/src/app/application/algorithm/state_estimation/soh/none/soh_none.h @@ -43,8 +43,8 @@ * @file soh_none.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.c b/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.c index 12bbc66e..2316ce15 100644 --- a/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.c +++ b/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.c @@ -43,8 +43,8 @@ * @file soh_none_cfg.c * @author foxBMS Team * @date 2021-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.h b/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.h index 5f772f47..57c9a2bc 100644 --- a/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.h +++ b/src/app/application/algorithm/state_estimation/soh/none/soh_none_cfg.h @@ -43,8 +43,8 @@ * @file soh_none_cfg.h * @author foxBMS Team * @date 2021-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOH * diff --git a/src/app/application/algorithm/state_estimation/state_estimation.c b/src/app/application/algorithm/state_estimation/state_estimation.c index ba8845d2..a9cfcac9 100644 --- a/src/app/application/algorithm/state_estimation/state_estimation.c +++ b/src/app/application/algorithm/state_estimation/state_estimation.c @@ -43,8 +43,8 @@ * @file state_estimation.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SE * diff --git a/src/app/application/algorithm/state_estimation/state_estimation.h b/src/app/application/algorithm/state_estimation/state_estimation.h index edff32e4..5803f7eb 100644 --- a/src/app/application/algorithm/state_estimation/state_estimation.h +++ b/src/app/application/algorithm/state_estimation/state_estimation.h @@ -43,8 +43,8 @@ * @file state_estimation.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SE * diff --git a/src/app/application/bal/bal.c b/src/app/application/bal/bal.c index 11cdc97f..32675089 100644 --- a/src/app/application/bal/bal.c +++ b/src/app/application/bal/bal.c @@ -43,8 +43,8 @@ * @file bal.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BAL * diff --git a/src/app/application/bal/bal.h b/src/app/application/bal/bal.h index 3fd03a57..7bf2b153 100644 --- a/src/app/application/bal/bal.h +++ b/src/app/application/bal/bal.h @@ -43,8 +43,8 @@ * @file bal.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BAL * diff --git a/src/app/application/bal/history/bal_strategy_history.c b/src/app/application/bal/history/bal_strategy_history.c index 124fb8ee..2d7b400f 100644 --- a/src/app/application/bal/history/bal_strategy_history.c +++ b/src/app/application/bal/history/bal_strategy_history.c @@ -43,8 +43,8 @@ * @file bal_strategy_history.c * @author foxBMS Team * @date 2020-05-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BAL * diff --git a/src/app/application/bal/history/bal_strategy_history.h b/src/app/application/bal/history/bal_strategy_history.h index 3a496005..6ba29873 100644 --- a/src/app/application/bal/history/bal_strategy_history.h +++ b/src/app/application/bal/history/bal_strategy_history.h @@ -43,8 +43,8 @@ * @file bal_strategy_history.h * @author foxBMS Team * @date 2020-05-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BALS * diff --git a/src/app/application/bal/none/bal_strategy_none.c b/src/app/application/bal/none/bal_strategy_none.c index 62f927c7..94ca875d 100644 --- a/src/app/application/bal/none/bal_strategy_none.c +++ b/src/app/application/bal/none/bal_strategy_none.c @@ -43,8 +43,8 @@ * @file bal_strategy_none.c * @author foxBMS Team * @date 2020-07-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BAL * diff --git a/src/app/application/bal/none/bal_strategy_none.h b/src/app/application/bal/none/bal_strategy_none.h index f1fea3f1..b9b685f3 100644 --- a/src/app/application/bal/none/bal_strategy_none.h +++ b/src/app/application/bal/none/bal_strategy_none.h @@ -43,8 +43,8 @@ * @file bal_strategy_none.h * @author foxBMS Team * @date 2020-08-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BALS * diff --git a/src/app/application/bal/voltage/bal_strategy_voltage.c b/src/app/application/bal/voltage/bal_strategy_voltage.c index 5b2ed2dc..80a89bb9 100644 --- a/src/app/application/bal/voltage/bal_strategy_voltage.c +++ b/src/app/application/bal/voltage/bal_strategy_voltage.c @@ -43,8 +43,8 @@ * @file bal_strategy_voltage.c * @author foxBMS Team * @date 2020-05-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BAL * diff --git a/src/app/application/bal/voltage/bal_strategy_voltage.h b/src/app/application/bal/voltage/bal_strategy_voltage.h index 1516eb54..7c2cc637 100644 --- a/src/app/application/bal/voltage/bal_strategy_voltage.h +++ b/src/app/application/bal/voltage/bal_strategy_voltage.h @@ -43,8 +43,8 @@ * @file bal_strategy_voltage.h * @author foxBMS Team * @date 2020-05-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix BALS * diff --git a/src/app/application/bms/bms.c b/src/app/application/bms/bms.c index 7cbb4db6..1878b2af 100644 --- a/src/app/application/bms/bms.c +++ b/src/app/application/bms/bms.c @@ -43,8 +43,8 @@ * @file bms.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix BMS * @@ -58,7 +58,6 @@ #include "afe.h" #include "bal.h" -#include "contactor.h" #include "database.h" #include "diag.h" #include "foxmath.h" @@ -85,33 +84,36 @@ * contains the state of the bms state machine */ static BMS_STATE_s bms_state = { - .timer = 0, - .stateRequest = BMS_STATE_NO_REQUEST, - .state = BMS_STATEMACH_UNINITIALIZED, - .substate = BMS_ENTRY, - .laststate = BMS_STATEMACH_UNINITIALIZED, - .lastsubstate = BMS_ENTRY, - .triggerentry = 0u, - .ErrRequestCounter = 0u, - .initFinished = STD_NOT_OK, - .counter = 0u, - .OscillationTimeout = 0u, - .PrechargeTryCounter = 0u, - .powerPath = BMS_POWER_PATH_OPEN, - .closedStrings = {0u}, - .closedPrechargeContactors = {0u}, - .numberOfClosedStrings = 0u, - .deactivatedStrings = {0}, - .firstClosedString = 0u, - .stringOpenTimeout = 0u, - .nextstringclosedtimer = 0u, - .stringCloseTimeout = 0u, - .nextstate = BMS_STATEMACH_STANDBY, - .restTimer_10ms = BS_RELAXATION_PERIOD_10ms, - .currentFlowState = BMS_RELAXATION, - .remainingDelay_ms = BMS_NO_ACTIVE_DELAY_TIME_ms, - .minimumActiveDelay_ms = BMS_NO_ACTIVE_DELAY_TIME_ms, - .transitionToErrorState = false, + .timer = 0, + .stateRequest = BMS_STATE_NO_REQUEST, + .state = BMS_STATEMACH_UNINITIALIZED, + .substate = BMS_ENTRY, + .laststate = BMS_STATEMACH_UNINITIALIZED, + .lastsubstate = BMS_ENTRY, + .triggerentry = 0u, + .ErrRequestCounter = 0u, + .initFinished = STD_NOT_OK, + .counter = 0u, + .OscillationTimeout = 0u, + .PrechargeTryCounter = 0u, + .powerPath = BMS_POWER_PATH_OPEN, + .closedStrings = {0u}, + .closedPrechargeContactors = {0u}, + .numberOfClosedStrings = 0u, + .deactivatedStrings = {0}, + .firstClosedString = 0u, + .stringOpenTimeout = 0u, + .nextstringclosedtimer = 0u, + .stringCloseTimeout = 0u, + .nextstate = BMS_STATEMACH_STANDBY, + .restTimer_10ms = BS_RELAXATION_PERIOD_10ms, + .currentFlowState = BMS_RELAXATION, + .remainingDelay_ms = BMS_NO_ACTIVE_DELAY_TIME_ms, + .minimumActiveDelay_ms = BMS_NO_ACTIVE_DELAY_TIME_ms, + .transitionToErrorState = false, + .timeAboveContactorBreakCurrent_ms = 0u, + .stringToBeOpened = 0u, + .contactorToBeOpened = CONT_UNDEFINED, }; /** local copies of database tables */ @@ -184,6 +186,15 @@ static bool BMS_IsAnyFatalErrorFlagSet(void); */ static STD_RETURN_TYPE_e BMS_IsBatterySystemStateOkay(void); +/** + * @brief Checks if the contactor feedback for a specific contactor is valid + * need to be opened. + * @details Reads error flag database entry and checks if the feedback for this + * specific contactor is valid or not. + * @return true if no error detected feedback is valid, otherwise false + */ +static bool BMS_IsContactorFeedbackValid(uint8_t stringNumber, CONT_TYPE_e contactorType); + /** Get latest database entries for static module variables */ static void BMS_GetMeasurementValues(void); @@ -268,6 +279,32 @@ static int32_t BMS_GetAverageStringCurrent(DATA_BLOCK_PACK_VALUES_s *pPackValues */ static void BMS_UpdateBatsysState(DATA_BLOCK_PACK_VALUES_s *pPackValues); +/** + * @brief Get first string contactor that should be opened depending on the + * actual current flow direction + * @details Check the mounting direction of the contactors and open the + * contactor that is mounted in the preferred current flow direction. + * Open the plus contactor first if, there is no contactor in + * preferred direction to the curren flow to open available. This may + * be either because both contactors are installed in the same + * direction or because the contactors are bidirectional. + * @param stringNumber string that will be opened + * @param flowDirection current flow direction (charging or discharging) + * @return #CONT_TYPE_e contactor that should be opened + */ +static CONT_TYPE_e BMS_GetFirstContactorToBeOpened(uint8_t stringNumber, BMS_CURRENT_FLOW_STATE_e flowDirection); + +/** + * @brief Get second string contactor that should be opened + * @details Mounting direction of the contactor does not need to be checked + * for the second contactor as the current has already been + * interrupted opening the first contactor. + * @param stringNumber string that will be opened + * @param firstOpenedContactorType type of first contactor that has been opened + * @return #CONT_TYPE_e contactor that should be opened + */ +static CONT_TYPE_e BMS_GetSecondContactorToBeOpened(uint8_t stringNumber, CONT_TYPE_e firstOpenedContactorType); + /*========== Static Function Implementations ================================*/ static BMS_RETURN_TYPE_e BMS_CheckStateRequest(BMS_STATE_REQUEST_e statereq) { @@ -451,6 +488,37 @@ static STD_RETURN_TYPE_e BMS_IsBatterySystemStateOkay(void) { return retVal; } +static bool BMS_IsContactorFeedbackValid(uint8_t stringNumber, CONT_TYPE_e contactorType) { + FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); + FAS_ASSERT(contactorType != CONT_UNDEFINED); + bool feedbackValid = false; + /* Read latest error flags from database */ + DATA_BLOCK_ERRORSTATE_s tableErrorFlags = {.header.uniqueId = DATA_BLOCK_ID_ERRORSTATE}; + DATA_READ_DATA(&tableErrorFlags); + /* Check if contactor feedback is valid */ + switch (contactorType) { + case CONT_PLUS: + if (tableErrorFlags.stringPlusContactor[stringNumber] == 0u) { + feedbackValid = true; + } + break; + case CONT_MINUS: + if (tableErrorFlags.stringMinusContactor[stringNumber] == 0u) { + feedbackValid = true; + } + break; + case CONT_PRECHARGE: + if (tableErrorFlags.prechargeContactor[stringNumber] == 0u) { + feedbackValid = true; + } + break; + default: + /* CONT_UNDEFINED already prevent via assert */ + break; + } + return feedbackValid; +} + static uint8_t BMS_GetHighestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues) { FAS_ASSERT(pPackValues != NULL_PTR); uint8_t highest_string_index = BMS_NO_STRING_AVAILABLE; @@ -622,6 +690,97 @@ static void BMS_UpdateBatsysState(DATA_BLOCK_PACK_VALUES_s *pPackValues) { } } +static CONT_TYPE_e BMS_GetFirstContactorToBeOpened(uint8_t stringNumber, BMS_CURRENT_FLOW_STATE_e flowDirection) { + FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); + /* AXIVION Routine Generic-MissingParameterAssert: flowDirection: parameter accepts all defined enums */ + CONT_TYPE_e contactorToBeOpened = CONT_UNDEFINED; + CONT_CURRENT_BREAKING_DIRECTION_e breakingDirection = CONT_BIDIRECTIONAL; + /* Required preferred opening direction dependent on the current direction */ + if (flowDirection == BMS_CHARGING) { + breakingDirection = CONT_CHARGING_DIRECTION; + } else { + breakingDirection = CONT_DISCHARGING_DIRECTION; + } + /* Iterate over contactor array and search for wanted contactor */ + uint8_t contactor = 0u; + for (; contactor < BS_NR_OF_CONTACTORS; contactor++) { + /* Search for: + * 1. contactor from requested string + * 2. contactor mounted in preferred opening direction or is bidirectional + * 3. is no precharge contactor */ + bool correctString = (bool)(stringNumber == cont_contactorStates[contactor].stringIndex); + bool inPreferredDirection = (bool)(breakingDirection == cont_contactorStates[contactor].breakingDirection); + bool hasNoPreferredDirection = (bool)(cont_contactorStates[contactor].breakingDirection == CONT_BIDIRECTIONAL); + bool noPrechargeContactor = (bool)(cont_contactorStates[contactor].type != CONT_PRECHARGE); + if (correctString && noPrechargeContactor && (inPreferredDirection || hasNoPreferredDirection)) { + contactorToBeOpened = cont_contactorStates[contactor].type; + break; + } + } + if (contactor == BS_NR_OF_CONTACTORS) { + /* No contactor mounted in preferred current direction found. Select + * the PLUS contactor found in array cont_contactorStates from the + * passed string */ + for (contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { + /* Search for: + * 1. contactor from requested string + * 2. is PLUS contactor */ + if ((stringNumber == cont_contactorStates[contactor].stringIndex) && + (cont_contactorStates[contactor].type == CONT_PLUS)) { + contactorToBeOpened = cont_contactorStates[contactor].type; + break; + } + } + } + if (contactor == BS_NR_OF_CONTACTORS) { + /* No PLUS contactor found. Select MINUS contactor found in array + * cont_contactorStates from the passed string */ + for (contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { + /* Search for: + * 1. contactor from requested string + * 2. is PLUS contactor */ + if ((stringNumber == cont_contactorStates[contactor].stringIndex) && + (cont_contactorStates[contactor].type == CONT_MINUS)) { + contactorToBeOpened = cont_contactorStates[contactor].type; + break; + } + } + } + if (contactor == BS_NR_OF_CONTACTORS) { + /* No PLUS or MAIN_MINUS contactor found in requested string. */ + FAS_ASSERT(FAS_TRAP); + } + return contactorToBeOpened; +} + +static CONT_TYPE_e BMS_GetSecondContactorToBeOpened(uint8_t stringNumber, CONT_TYPE_e firstOpenedContactorType) { + FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); + FAS_ASSERT((firstOpenedContactorType != CONT_UNDEFINED) && (firstOpenedContactorType != CONT_PRECHARGE)); + CONT_TYPE_e contactorToBeOpened = CONT_UNDEFINED; + /* Check what contactor has already been opened and select the other one */ + if (firstOpenedContactorType == CONT_PLUS) { + contactorToBeOpened = CONT_MINUS; + } else { + contactorToBeOpened = CONT_PLUS; + } + /* Iterate over contactor array and search for wanted contactor */ + uint8_t contactor = 0u; + for (; contactor < BS_NR_OF_CONTACTORS; contactor++) { + /* Search for specific contactor from requested string */ + if ((stringNumber == cont_contactorStates[contactor].stringIndex) && + (contactorToBeOpened == cont_contactorStates[contactor].type)) { + contactorToBeOpened = cont_contactorStates[contactor].type; + break; + } + } + if (contactor == BS_NR_OF_CONTACTORS) { + /* No PLUS or MAIN_MINUS contactor found in requested string. + * Apparently, only one contactor has been defined for this string */ + FAS_ASSERT(FAS_TRAP); + } + return contactorToBeOpened; +} + /*========== Extern Function Implementations ================================*/ extern STD_RETURN_TYPE_e BMS_GetInitializationState(void) { @@ -647,15 +806,16 @@ BMS_RETURN_TYPE_e BMS_SetStateRequest(BMS_STATE_REQUEST_e statereq) { } void BMS_Trigger(void) { - BMS_STATE_REQUEST_e statereq = BMS_STATE_NO_REQUEST; - DATA_BLOCK_SYSTEMSTATE_s systemstate = {.header.uniqueId = DATA_BLOCK_ID_SYSTEMSTATE}; - uint32_t timestamp = OS_GetTickCount(); - static uint32_t nextOpenWireCheck = 0; - STD_RETURN_TYPE_e retVal = STD_NOT_OK; - static uint8_t stringNumber = 0u; - static uint8_t nextStringNumber = 0u; - CONT_ELECTRICAL_STATE_TYPE_e contstate = CONT_SWITCH_OFF; - STD_RETURN_TYPE_e contRetVal = STD_NOT_OK; + BMS_STATE_REQUEST_e statereq = BMS_STATE_NO_REQUEST; + DATA_BLOCK_SYSTEMSTATE_s systemstate = {.header.uniqueId = DATA_BLOCK_ID_SYSTEMSTATE}; + uint32_t timestamp = OS_GetTickCount(); + static uint32_t nextOpenWireCheck = 0; + STD_RETURN_TYPE_e retVal = STD_NOT_OK; + static uint8_t stringNumber = 0u; + static uint8_t nextStringNumber = 0u; + CONT_ELECTRICAL_STATE_TYPE_e contactorState = CONT_SWITCH_UNDEFINED; + bool contactorFeedbackValid = false; + STD_RETURN_TYPE_e contRetVal = STD_NOT_OK; if (bms_state.state != BMS_STATEMACH_UNINITIALIZED) { BMS_GetMeasurementValues(); @@ -715,6 +875,8 @@ void BMS_Trigger(void) { /****************************INITIALIZATION***************************/ case BMS_STATEMACH_INITIALIZATION: BMS_SAVELASTSTATES(); + /* Reset ALERT mode flag */ + DIAG_Handler(DIAG_ID_ALERT_MODE, DIAG_EVENT_OK, DIAG_SYSTEM, 0u); bms_state.initFinished = STD_OK; bms_state.timer = BMS_STATEMACH_LONGTIME; bms_state.state = BMS_STATEMACH_INITIALIZED; @@ -748,7 +910,7 @@ void BMS_Trigger(void) { } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS) { if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; @@ -758,22 +920,16 @@ void BMS_Trigger(void) { break; } } else if (bms_state.substate == BMS_CHECK_STATE_REQUESTS) { - if (BMS_CheckCanRequests() == BMS_REQ_ID_STANDBY) { - bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; - bms_state.nextstate = BMS_STATEMACH_STANDBY; - bms_state.substate = BMS_ENTRY; - break; - } else { - bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.substate = BMS_CHECK_ERROR_FLAGS; - break; - } + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; + bms_state.nextstate = BMS_STATEMACH_STANDBY; + bms_state.substate = BMS_ENTRY; + break; } break; /****************************OPEN CONTACTORS**************************/ - case BMS_STATEMACH_OPENCONTACTORS: + case BMS_STATEMACH_OPEN_CONTACTORS: BMS_SAVELASTSTATES(); if (bms_state.substate == BMS_ENTRY) { @@ -782,57 +938,130 @@ void BMS_Trigger(void) { bms_state.substate = BMS_OPEN_ALL_PRECHARGES; break; } else if (bms_state.substate == BMS_OPEN_ALL_PRECHARGES) { - for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { - if (bs_stringsWithPrecharge[s] == BS_STRING_WITH_PRECHARGE) { - CONT_OpenPrecharge(s); - bms_state.closedPrechargeContactors[s] = 0u; - } - } - /* Now go to string opening */ + /* Precharge contactors can always be opened as the precharge + * resistor limits the maximum current */ + CONT_OpenAllPrechargeContactors(); + + /* Now go to string opening - open one string after another */ stringNumber = BS_NR_OF_STRINGS - 1u; /* Select last string */ - bms_state.substate = BMS_OPEN_STRINGS; + bms_state.substate = BMS_OPEN_FIRST_STRING_CONTACTOR; bms_state.timer = BMS_TIME_WAIT_AFTER_OPENING_PRECHARGE; - } else if (bms_state.substate == BMS_OPEN_STRINGS) { - CONT_OpenString(stringNumber); - bms_state.timer = BMS_TIME_WAIT_AFTER_OPENING_STRING; - bms_state.substate = BMS_CHECK_STRING_OPEN; - bms_state.stringOpenTimeout = BMS_STRING_OPEN_TIMEOUT; + } else if (bms_state.substate == BMS_OPEN_FIRST_STRING_CONTACTOR) { + /* Precharge contactors have been opened -> start opening first string contactor */ + /* TODO: Check if precharge contactors have been opened? */ + + if ((bms_tablePackValues.invalidStringCurrent[stringNumber] == 0u) && + (MATH_AbsInt32_t(bms_tablePackValues.stringCurrent_mA[stringNumber]) < + BS_MAIN_CONTACTORS_MAXIMUM_BREAK_CURRENT_mA)) { + /* Current is below maximum break current -> open first contactor + * Check the mounting direction of the contactors and open the contactor that is mounted in the + * preferred current flow direction. Open the plus contactor first if, there is no contactor + * in preferred direction to the curren flow to open available. This may be either because both + * contactors are installed in the same direction or because the contactors are bidirectional. + */ + const BMS_CURRENT_FLOW_STATE_e flowDirection = + BMS_GetCurrentFlowDirection(bms_tablePackValues.stringCurrent_mA[stringNumber]); + bms_state.contactorToBeOpened = BMS_GetFirstContactorToBeOpened(stringNumber, flowDirection); + bms_state.stringToBeOpened = stringNumber; + /* Open first contactor */ + CONT_OpenContactor(stringNumber, bms_state.contactorToBeOpened); + bms_state.timer = BMS_WAIT_TIME_AFTER_OPENING_STRING_CONTACTOR; + bms_state.substate = BMS_OPEN_SECOND_STRING_CONTACTOR; + bms_state.stringOpenTimeout = BMS_STRING_OPEN_TIMEOUT; + } else { + /* Current is above maximum contactor break current -> contactor can not be opened */ + bms_state.timeAboveContactorBreakCurrent_ms += BMS_STATEMACHINE_TASK_CYCLE_CONTEXT_MS; + if (bms_state.timeAboveContactorBreakCurrent_ms > BS_MAIN_FUSE_MAXIMUM_TRIGGER_DURATION_ms) { + /* Fuse should have been triggered by now but apparently has not yet. Do not wait any + * longer. Activate ALERT mode and nevertheless start opening the contactors */ + DIAG_Handler(DIAG_ID_ALERT_MODE, DIAG_EVENT_NOT_OK, DIAG_SYSTEM, 0u); + const BMS_CURRENT_FLOW_STATE_e flowDirection = + BMS_GetCurrentFlowDirection(bms_tablePackValues.stringCurrent_mA[stringNumber]); + bms_state.contactorToBeOpened = BMS_GetFirstContactorToBeOpened(stringNumber, flowDirection); + bms_state.stringToBeOpened = stringNumber; + /* Open first contactor */ + CONT_OpenContactor(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + bms_state.timer = BMS_WAIT_TIME_AFTER_OPENING_STRING_CONTACTOR; + bms_state.substate = BMS_OPEN_SECOND_STRING_CONTACTOR; + } + } break; - } else if (bms_state.substate == BMS_CHECK_STRING_OPEN) { - contstate = CONT_GetState(stringNumber); - if (contstate == CONT_SWITCH_OFF) { + } else if (bms_state.substate == BMS_OPEN_SECOND_STRING_CONTACTOR) { + /* Check if first contactor has been opened correctly */ + contactorState = CONT_GetContactorState(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + contactorFeedbackValid = + BMS_IsContactorFeedbackValid(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + /* If we want to open the contactors because of a feedback + * error for this contactor, the statement will never be true. + * Thus, also continue if a feedback error for this contactor + * is detected as we are not able to get a valid feedback + * information at this point */ + if ((contactorState == CONT_SWITCH_OFF) || (contactorFeedbackValid == false)) { + /* First contactor opened correctly. + * Open second contactor. Pass first opened contactor into function */ + bms_state.contactorToBeOpened = + BMS_GetSecondContactorToBeOpened(stringNumber, bms_state.contactorToBeOpened); + /* Open second contactor */ + CONT_OpenContactor(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + bms_state.timer = BMS_WAIT_TIME_AFTER_OPENING_STRING_CONTACTOR; + bms_state.substate = BMS_CHECK_SECOND_STRING_CONTACTOR; + } else { + /* String not opened, re-issue closing request */ + CONT_OpenContactor(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + bms_state.timer = BMS_STATEMACH_SHORTTIME; + /* TODO: add timeout */ + } + } else if (bms_state.substate == BMS_CHECK_SECOND_STRING_CONTACTOR) { + /* Check if second contactor has been opened correctly */ + contactorState = CONT_GetContactorState(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + contactorFeedbackValid = + BMS_IsContactorFeedbackValid(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); + /* If we want to open the contactors because of a feedback + * error for this contactor, the statement will never be true. + * Thus, also continue if a feedback error for this contactor + * is detected as we are not able to get a valid feedback + * information at this point */ + if ((contactorState == CONT_SWITCH_OFF) || (contactorFeedbackValid == false)) { + /* Opening for this string finished. Reset state variables used for opening */ + bms_state.contactorToBeOpened = CONT_UNDEFINED; + bms_state.stringToBeOpened = 0u; + /* String opened. Decrement string counter */ if (bms_state.numberOfClosedStrings > 0u) { bms_state.numberOfClosedStrings--; } bms_state.closedStrings[stringNumber] = 0u; if (stringNumber > 0u) { + /* Not all strings opened yet -> open next string */ stringNumber--; - bms_state.substate = BMS_OPEN_STRINGS; + bms_state.substate = BMS_OPEN_FIRST_STRING_CONTACTOR; bms_state.timer = BMS_STATEMACH_SHORTTIME; break; } else { + /* All strings opened -> prepare to leave state BMS_STATEMACH_OPEN_CONTACTORS */ bms_state.substate = BMS_OPEN_STRINGS_EXIT; bms_state.timer = BMS_STATEMACH_SHORTTIME; } break; } else if (bms_state.stringOpenTimeout == 0u) { - /* String takes too long to close, go to next string */ + /* String takes too long to open, go to next string */ bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.substate = BMS_OPEN_STRINGS; + bms_state.substate = BMS_OPEN_FIRST_STRING_CONTACTOR; break; } else { /* String not opened, re-issue closing request */ - CONT_OpenString(nextStringNumber); + CONT_OpenContactor(bms_state.stringToBeOpened, bms_state.contactorToBeOpened); bms_state.timer = BMS_STATEMACH_SHORTTIME; break; } } else if (bms_state.substate == BMS_OPEN_STRINGS_EXIT) { if (bms_state.nextstate == BMS_STATEMACH_STANDBY) { + /* Opening due to STANDBY request -> switch to BMS_STATEMACH_STANDBY */ bms_state.timer = BMS_STATEMACH_SHORTTIME; bms_state.state = BMS_STATEMACH_STANDBY; bms_state.substate = BMS_ENTRY; break; } else { + /* Opening due to detected error -> switch to BMS_STATEMACH_ERROR */ bms_state.timer = BMS_STATEMACH_SHORTTIME; bms_state.state = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; @@ -859,7 +1088,7 @@ void BMS_Trigger(void) { } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS_INTERLOCK) { if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; @@ -875,7 +1104,7 @@ void BMS_Trigger(void) { } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS) { if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; @@ -931,43 +1160,67 @@ void BMS_Trigger(void) { } if (stringNumber == BMS_NO_STRING_AVAILABLE) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } bms_state.firstClosedString = stringNumber; if (bms_state.OscillationTimeout == 0u) { - bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.substate = BMS_PRECHARGE_CLOSE_PRECHARGE; + /* Close MINUS string contactor */ + if (CONT_CloseContactor(bms_state.firstClosedString, CONT_MINUS) == STD_OK) { + bms_state.stringCloseTimeout = BMS_STRING_CLOSE_TIMEOUT; + bms_state.timer = BMS_WAIT_TIME_AFTER_CLOSING_STRING_CONTACTOR; + bms_state.substate = BMS_PRECHARGE_CLOSE_PRECHARGE; + } else { + /* Invalid contactor requested */ + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; + bms_state.nextstate = BMS_STATEMACH_ERROR; + bms_state.substate = BMS_ENTRY; + } } else if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { /* If precharge re-enter timeout not elapsed, wait (and check errors while waiting) */ bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } break; } else if (bms_state.substate == BMS_PRECHARGE_CLOSE_PRECHARGE) { - bms_state.OscillationTimeout = BMS_OSCILLATION_TIMEOUT; - contRetVal = CONT_ClosePrecharge(bms_state.firstClosedString); - bms_state.closedPrechargeContactors[stringNumber] = 1u; - if (contRetVal == STD_OK) { - bms_state.timer = BMS_TIME_WAIT_AFTER_CLOSING_PRECHARGE; - bms_state.substate = BMS_CHECK_ERROR_FLAGS_CLOSINGPRECHARGE; - bms_state.PrechargeTryCounter = 0u; - } else { + /* Check if MINUS contactor has been successfully closed */ + contactorState = CONT_GetContactorState(bms_state.firstClosedString, CONT_MINUS); + if (contactorState == CONT_SWITCH_ON) { + bms_state.OscillationTimeout = BMS_OSCILLATION_TIMEOUT; + contRetVal = CONT_ClosePrecharge(bms_state.firstClosedString); + bms_state.closedPrechargeContactors[stringNumber] = 1u; + if (contRetVal == STD_OK) { + bms_state.timer = BMS_TIME_WAIT_AFTER_CLOSING_PRECHARGE; + bms_state.substate = BMS_CHECK_ERROR_FLAGS_CLOSINGPRECHARGE; + bms_state.PrechargeTryCounter = 0u; + } else { + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; + bms_state.nextstate = BMS_STATEMACH_ERROR; + bms_state.substate = BMS_ENTRY; + } + } else if (bms_state.stringCloseTimeout == 0u) { + /* String takes too long to close */ bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; + } else { + /* String not closed, re-issue closing request */ + CONT_CloseContactor(bms_state.firstClosedString, CONT_MINUS); + bms_state.timer = BMS_STATEMACH_SHORTTIME; } break; } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS_CLOSINGPRECHARGE) { if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; @@ -979,7 +1232,7 @@ void BMS_Trigger(void) { } else if (bms_state.substate == BMS_CHECK_STATE_REQUESTS) { if (BMS_CheckCanRequests() == BMS_REQ_ID_STANDBY) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_STANDBY; bms_state.substate = BMS_ENTRY; break; @@ -988,15 +1241,21 @@ void BMS_Trigger(void) { bms_state.substate = BMS_PRECHARGE_CHECK_VOLTAGES; } } else if (bms_state.substate == BMS_PRECHARGE_CHECK_VOLTAGES) { - retVal = BMS_CheckPrecharge(bms_state.firstClosedString, &bms_tablePackValues); - if (retVal == STD_OK) { - CONT_CloseString(bms_state.firstClosedString); - bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.substate = BMS_CLOSE_FIRST_STRING_PRECHARGE_STATE; + contactorState = CONT_GetContactorState(bms_state.firstClosedString, CONT_PRECHARGE); + retVal = BMS_CheckPrecharge(bms_state.firstClosedString, &bms_tablePackValues); + /* Check if precharge contactor is closed and precharge is finished */ + if ((contactorState == CONT_SWITCH_ON) && (retVal == STD_OK)) { + /* Successfully precharged. Close string PLUS contactor */ + CONT_CloseContactor(bms_state.firstClosedString, CONT_PLUS); + bms_state.stringCloseTimeout = BMS_STRING_CLOSE_TIMEOUT; + bms_state.timer = BMS_WAIT_TIME_AFTER_CLOSING_STRING_CONTACTOR; + bms_state.substate = BMS_CHECK_CLOSE_SECOND_STRING_CONTACTOR_PRECHARGE_STATE; break; } else { + /* Precharging failed. Open precharge contactor. */ + contRetVal = CONT_OpenPrecharge(bms_state.firstClosedString); + /* Check if retry limit has been reached */ if (bms_state.PrechargeTryCounter < (BMS_PRECHARGE_TRIES - 1u)) { - contRetVal = CONT_OpenPrecharge(bms_state.firstClosedString); bms_state.closedPrechargeContactors[stringNumber] = 0u; if (contRetVal == STD_OK) { bms_state.timer = BMS_TIME_WAIT_AFTERPRECHARGEFAIL; @@ -1004,44 +1263,38 @@ void BMS_Trigger(void) { bms_state.PrechargeTryCounter++; } else { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; } break; } else { - contRetVal = CONT_OpenPrecharge(bms_state.firstClosedString); bms_state.closedPrechargeContactors[stringNumber] = 0u; bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } } - } else if (bms_state.substate == BMS_CLOSE_FIRST_STRING_PRECHARGE_STATE) { - CONT_CloseString(bms_state.firstClosedString); - bms_state.stringCloseTimeout = BMS_STRING_CLOSE_TIMEOUT; - bms_state.timer = BMS_TIME_WAIT_AFTER_STRING_CLOSED; - bms_state.substate = BMS_CHECK_CLOSE_FIRST_STRING_PRECHARGE_STATE; - } else if (bms_state.substate == BMS_CHECK_CLOSE_FIRST_STRING_PRECHARGE_STATE) { - contstate = CONT_GetState(bms_state.firstClosedString); - if (contstate == CONT_SWITCH_ON) { + } else if (bms_state.substate == BMS_CHECK_CLOSE_SECOND_STRING_CONTACTOR_PRECHARGE_STATE) { + contactorState = CONT_GetContactorState(bms_state.firstClosedString, CONT_PLUS); + if (contactorState == CONT_SWITCH_ON) { bms_state.closedStrings[bms_state.firstClosedString] = 1u; bms_state.numberOfClosedStrings++; - bms_state.timer = BMS_TIME_WAIT_AFTER_STRING_CLOSED; + bms_state.timer = BMS_WAIT_TIME_AFTER_CLOSING_STRING_CONTACTOR; bms_state.substate = BMS_CHECK_ERROR_FLAGS_PRECHARGE_CLOSINGSTRINGS; break; } else if (bms_state.stringCloseTimeout == 0u) { /* String takes too long to close */ bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } else { /* String not closed, re-issue closing request */ - CONT_CloseString(bms_state.firstClosedString); + CONT_CloseContactor(bms_state.firstClosedString, CONT_PLUS); bms_state.timer = BMS_STATEMACH_SHORTTIME; bms_state.substate = BMS_CHECK_ERROR_FLAGS_PRECHARGE_FIRST_STRING; break; @@ -1049,20 +1302,20 @@ void BMS_Trigger(void) { } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS_PRECHARGE_FIRST_STRING) { if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } else { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.substate = BMS_CHECK_CLOSE_FIRST_STRING_PRECHARGE_STATE; + bms_state.substate = BMS_CHECK_CLOSE_SECOND_STRING_CONTACTOR_PRECHARGE_STATE; break; } } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS_PRECHARGE_CLOSINGSTRINGS) { /* Always make one error check after the first string was closed successfully */ if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; @@ -1076,15 +1329,35 @@ void BMS_Trigger(void) { if (contRetVal == STD_OK) { bms_state.closedPrechargeContactors[stringNumber] = 0u; bms_state.timer = BMS_TIME_WAIT_AFTER_OPENING_PRECHARGE; - bms_state.state = BMS_STATEMACH_NORMAL; - bms_state.substate = BMS_ENTRY; + bms_state.substate = BMS_PRECHARGE_CHECK_OPEN_PRECHARGE; } else { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; } break; + } else if (bms_state.substate == BMS_PRECHARGE_CHECK_OPEN_PRECHARGE) { + contactorState = CONT_GetContactorState(bms_state.firstClosedString, CONT_PRECHARGE); + if (contactorState == CONT_SWITCH_OFF) { + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_NORMAL; + bms_state.substate = BMS_ENTRY; + break; + } else if (bms_state.stringCloseTimeout == 0u) { + /* Precharge contactor takes too long to open */ + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; + bms_state.nextstate = BMS_STATEMACH_ERROR; + bms_state.substate = BMS_ENTRY; + break; + } else { + /* Precharge contactor not opened, re-issue open request */ + CONT_OpenPrecharge(bms_state.firstClosedString); + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.substate = BMS_CHECK_ERROR_FLAGS_PRECHARGE_FIRST_STRING; + break; + } } else { FAS_ASSERT(FAS_TRAP); } @@ -1111,9 +1384,10 @@ void BMS_Trigger(void) { break; } else if (bms_state.substate == BMS_CHECK_ERROR_FLAGS) { if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { - bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_ERROR; - bms_state.substate = BMS_ENTRY; + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; + bms_state.nextstate = BMS_STATEMACH_ERROR; + bms_state.substate = BMS_ENTRY; break; } else { bms_state.timer = BMS_STATEMACH_SHORTTIME; @@ -1123,7 +1397,7 @@ void BMS_Trigger(void) { } else if (bms_state.substate == BMS_CHECK_STATE_REQUESTS) { if (BMS_CheckCanRequests() == BMS_REQ_ID_STANDBY) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_STANDBY; bms_state.substate = BMS_ENTRY; break; @@ -1150,11 +1424,11 @@ void BMS_Trigger(void) { (BMS_GetStringVoltageDifference(nextStringNumber, &bms_tablePackValues) <= BMS_NEXT_STRING_VOLTAGE_LIMIT_MV) && (BMS_GetAverageStringCurrent(&bms_tablePackValues) <= BMS_AVERAGE_STRING_CURRENT_LIMIT_MA)) { - /* Voltage/current conditions suitable to close a further string */ - CONT_CloseString(nextStringNumber); + /* Voltage/current conditions suitable to close a further string. Close first string contactor */ + CONT_CloseContactor(nextStringNumber, CONT_MINUS); bms_state.nextstringclosedtimer = BMS_STRING_CLOSE_TIMEOUT; - bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.substate = BMS_CHECK_STRING_CLOSED; + bms_state.timer = BMS_WAIT_TIME_AFTER_CLOSING_STRING_CONTACTOR; + bms_state.substate = BMS_NORMAL_CLOSE_SECOND_STRING_CONTACTOR; break; } } else { @@ -1162,37 +1436,57 @@ void BMS_Trigger(void) { bms_state.substate = BMS_CHECK_ERROR_FLAGS; break; } + } else if (bms_state.substate == BMS_NORMAL_CLOSE_SECOND_STRING_CONTACTOR) { + contactorState = CONT_GetContactorState(nextStringNumber, CONT_MINUS); + if (contactorState == CONT_SWITCH_ON) { + /* First string contactor closed. Close second string contactor */ + CONT_CloseContactor(nextStringNumber, CONT_PLUS); + bms_state.timer = BMS_WAIT_TIME_AFTER_CLOSING_STRING_CONTACTOR; + bms_state.substate = BMS_NORMAL_CLOSE_SECOND_STRING_CONTACTOR; + } else if (bms_state.stringCloseTimeout == 0u) { + /* String takes too long to close */ + bms_state.timer = BMS_STATEMACH_SHORTTIME; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; + bms_state.nextstate = BMS_STATEMACH_ERROR; + bms_state.substate = BMS_ENTRY; + break; + } else { + /* String minus contactor has not been closed successfully. Re-trigger closing */ + CONT_CloseContactor(nextStringNumber, CONT_MINUS); + bms_state.timer = BMS_STATEMACH_SHORTTIME; + } + break; } else if (bms_state.substate == BMS_CHECK_STRING_CLOSED) { - contstate = CONT_GetState(nextStringNumber); - if (contstate == CONT_SWITCH_ON) { + contactorState = CONT_GetContactorState(nextStringNumber, CONT_PLUS); + if (contactorState == CONT_SWITCH_ON) { bms_state.numberOfClosedStrings++; bms_state.closedStrings[nextStringNumber] = 1u; - bms_state.nextstringclosedtimer = BMS_TIME_WAIT_AFTER_STRING_CLOSED; + bms_state.nextstringclosedtimer = BMS_WAIT_TIME_BETWEEN_CLOSING_STRINGS; /* Go to begin of NORMAL case to redo the full procedure with error check and request check */ bms_state.substate = BMS_CHECK_ERROR_FLAGS; break; } else if (bms_state.stringCloseTimeout == 0u) { /* String takes too long to close */ bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } else if (BMS_IsBatterySystemStateOkay() == STD_NOT_OK) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_ERROR; bms_state.substate = BMS_ENTRY; break; } else if (BMS_CheckCanRequests() == BMS_REQ_ID_STANDBY) { bms_state.timer = BMS_STATEMACH_SHORTTIME; - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_STANDBY; bms_state.substate = BMS_ENTRY; break; } else { /* String not closed, re-issue closing request */ - CONT_CloseString(nextStringNumber); + CONT_CloseContactor(nextStringNumber, CONT_PLUS); bms_state.timer = BMS_STATEMACH_SHORTTIME; break; } @@ -1248,7 +1542,7 @@ void BMS_Trigger(void) { /* Verify that all contactors are opened and switch to * STANDBY state afterwards */ - bms_state.state = BMS_STATEMACH_OPENCONTACTORS; + bms_state.state = BMS_STATEMACH_OPEN_CONTACTORS; bms_state.nextstate = BMS_STATEMACH_STANDBY; bms_state.substate = BMS_ENTRY; break; diff --git a/src/app/application/bms/bms.h b/src/app/application/bms/bms.h index e28d61fb..dae654fc 100644 --- a/src/app/application/bms/bms.h +++ b/src/app/application/bms/bms.h @@ -43,8 +43,8 @@ * @file bms.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix BMS * @@ -60,6 +60,8 @@ #include "battery_system_cfg.h" #include "bms_cfg.h" +#include "contactor.h" + /*========== Macros and Definitions =========================================*/ /** Symbolic names for battery system state */ @@ -90,7 +92,7 @@ typedef enum { BMS_STATEMACH_INITIALIZATION, BMS_STATEMACH_INITIALIZED, BMS_STATEMACH_IDLE, - BMS_STATEMACH_OPENCONTACTORS, + BMS_STATEMACH_OPEN_CONTACTORS, BMS_STATEMACH_STANDBY, BMS_STATEMACH_PRECHARGE, BMS_STATEMACH_NORMAL, @@ -130,41 +132,42 @@ typedef enum { BMS_PRECHARGE_CLOSE_PRECHARGE, BMS_PRECHARGE_CHECK_VOLTAGES, BMS_PRECHARGE_OPEN_PRECHARGE, + BMS_PRECHARGE_CHECK_OPEN_PRECHARGE, BMS_OPEN_FIRST_CONTACTOR, BMS_OPEN_SECOND_CONTACTOR_MINUS, BMS_OPEN_SECOND_CONTACTOR_PLUS, - BMS_CLOSE_FIRST_STRING_PRECHARGE_STATE, - BMS_CHECK_CLOSE_FIRST_STRING_PRECHARGE_STATE, + BMS_CHECK_CLOSE_SECOND_STRING_CONTACTOR_PRECHARGE_STATE, BMS_CHECK_ERROR_FLAGS_PRECHARGE, BMS_CHECK_ERROR_FLAGS_PRECHARGE_FIRST_STRING, BMS_PRECHARGE_CLOSE_NEXT_STRING, + BMS_CLOSE_SECOND_CONTACTOR_PLUS, BMS_CHECK_STRING_CLOSED, BMS_CHECK_ERROR_FLAGS_PRECHARGE_CLOSINGSTRINGS, BMS_CHECK_ERROR_FLAGS_CLOSINGPRECHARGE, BMS_NORMAL_CLOSE_NEXT_STRING, + BMS_NORMAL_CLOSE_SECOND_STRING_CONTACTOR, BMS_OPEN_ALL_PRECHARGES, BMS_CHECK_ALL_PRECHARGES_OPEN, BMS_OPEN_STRINGS_ENTRY, - BMS_OPEN_STRINGS, - BMS_CHECK_STRING_OPEN, + BMS_OPEN_FIRST_STRING_CONTACTOR, + BMS_OPEN_SECOND_STRING_CONTACTOR, + BMS_CHECK_SECOND_STRING_CONTACTOR, BMS_OPEN_STRINGS_EXIT, } BMS_STATEMACH_SUB_e; -/** State requests for the BMS statemachine */ +/** State requests for the BMS state machine */ typedef enum { BMS_STATE_INIT_REQUEST, /*!< request for initialization */ BMS_STATE_ERROR_REQUEST, /*!< request for ERROR state */ BMS_STATE_NO_REQUEST, /*!< dummy request for no request */ } BMS_STATE_REQUEST_e; -/** - * Possible return values when state requests are made to the BMS statemachine - */ +/** Possible return values when state requests are made to the BMS state machine */ typedef enum { BMS_OK, /*!< request was successful */ BMS_REQUEST_PENDING, /*!< error: another request is currently processed */ BMS_ILLEGAL_REQUEST, /*!< error: request can not be executed */ - BMS_ALREADY_INITIALIZED, /*!< error: BMS statemachine already initialized */ + BMS_ALREADY_INITIALIZED, /*!< error: BMS state machine already initialized */ } BMS_RETURN_TYPE_e; /** Power path type (discharge or charge) */ @@ -181,31 +184,34 @@ typedef enum { */ typedef struct { uint16_t timer; /*!< time in ms before the state machine processes the next state, e.g. in counts of 1ms */ - BMS_STATE_REQUEST_e stateRequest; /*!< current state request made to the state machine */ - BMS_STATEMACH_e state; /*!< current state of State Machine */ - BMS_STATEMACH_SUB_e substate; /*!< current substate of the state machine */ - BMS_STATEMACH_e laststate; /*!< previous state of the state machine */ - BMS_STATEMACH_SUB_e lastsubstate; /*!< previous substate of the state machine */ - uint32_t ErrRequestCounter; /*!< counts the number of illegal requests to the LTC state machine */ - STD_RETURN_TYPE_e initFinished; /*!< #STD_OK if the initialization has passed, #STD_NOT_OK otherwise */ - uint8_t triggerentry; /*!< counter for re-entrance protection (function running flag) */ - uint8_t counter; /*!< general purpose counter */ - BMS_CURRENT_FLOW_STATE_e currentFlowState; /*!< state of battery system */ - uint32_t restTimer_10ms; /*!< timer until battery system is at rest */ - uint16_t OscillationTimeout; /*!< timeout to prevent oscillation of contactors */ - uint8_t PrechargeTryCounter; /*!< timeout to prevent oscillation of contactors */ - BMS_POWER_PATH_TYPE_e powerPath; /*!< power path type (discharge or charge) */ - uint8_t numberOfClosedStrings; /*!< number of closed strings */ - uint16_t stringOpenTimeout; /*!< timeout to abort if string opening takes too long */ - uint32_t nextstringclosedtimer; /*!< timer to wait if the next string was closed */ - uint16_t stringCloseTimeout; /*!< timeout to abort if a string takes too long to close */ - BMS_STATEMACH_e nextstate; /*!< next state of the State Machine */ - uint8_t firstClosedString; /*!< strings with highest or lowest voltage, that was closed first */ - uint16_t prechargeOpenTimeout; /*!< timeout to abort if string opening takes too long */ - uint16_t prechargeCloseTimeout; /*!< timeout to abort if a string takes too long to close */ - uint32_t remainingDelay_ms; /*!< time until statemachine should switch to error state */ - uint32_t minimumActiveDelay_ms; /*!< minimum delay time of all active fatal errors */ - bool transitionToErrorState; /*!< flag if fatal error has been detected and delay is active */ + BMS_STATE_REQUEST_e stateRequest; /*!< current state request made to the state machine */ + BMS_STATEMACH_e state; /*!< current state of State Machine */ + BMS_STATEMACH_SUB_e substate; /*!< current substate of the state machine */ + BMS_STATEMACH_e laststate; /*!< previous state of the state machine */ + BMS_STATEMACH_SUB_e lastsubstate; /*!< previous substate of the state machine */ + uint32_t ErrRequestCounter; /*!< counts the number of illegal requests to the LTC state machine */ + STD_RETURN_TYPE_e initFinished; /*!< #STD_OK if the initialization has passed, #STD_NOT_OK otherwise */ + uint8_t triggerentry; /*!< counter for re-entrance protection (function running flag) */ + uint8_t counter; /*!< general purpose counter */ + BMS_CURRENT_FLOW_STATE_e currentFlowState; /*!< state of battery system */ + uint32_t restTimer_10ms; /*!< timer until battery system is at rest */ + uint16_t OscillationTimeout; /*!< timeout to prevent oscillation of contactors */ + uint8_t PrechargeTryCounter; /*!< timeout to prevent oscillation of contactors */ + BMS_POWER_PATH_TYPE_e powerPath; /*!< power path type (discharge or charge) */ + uint8_t numberOfClosedStrings; /*!< number of closed strings */ + uint16_t stringOpenTimeout; /*!< timeout to abort if string opening takes too long */ + uint32_t nextstringclosedtimer; /*!< timer to wait if the next string was closed */ + uint16_t stringCloseTimeout; /*!< timeout to abort if a string takes too long to close */ + BMS_STATEMACH_e nextstate; /*!< next state of the State Machine */ + uint8_t firstClosedString; /*!< strings with highest or lowest voltage, that was closed first */ + uint16_t prechargeOpenTimeout; /*!< timeout to abort if string opening takes too long */ + uint16_t prechargeCloseTimeout; /*!< timeout to abort if a string takes too long to close */ + uint32_t remainingDelay_ms; /*!< time until state machine should switch to error state */ + uint32_t minimumActiveDelay_ms; /*!< minimum delay time of all active fatal errors */ + uint32_t timeAboveContactorBreakCurrent_ms; /*!< duration of current flow above maximum contactor break current */ + uint8_t stringToBeOpened; /*!< string that is currently opened */ + CONT_TYPE_e contactorToBeOpened; /*!< contactor that is currently opened */ + bool transitionToErrorState; /*!< flag if fatal error has been detected and delay is active */ uint8_t closedPrechargeContactors[BS_NR_OF_STRINGS]; /*!< strings whose precharge contactors are closed */ uint8_t closedStrings[BS_NR_OF_STRINGS]; /*!< strings whose contactors are closed */ uint8_t deactivatedStrings[BS_NR_OF_STRINGS]; /*!< Deactivated strings after error detection, cannot be closed */ diff --git a/src/app/application/config/bal_cfg.c b/src/app/application/config/bal_cfg.c index cdaacfe8..2e61fd1e 100644 --- a/src/app/application/config/bal_cfg.c +++ b/src/app/application/config/bal_cfg.c @@ -43,8 +43,8 @@ * @file bal_cfg.c * @author foxBMS Team * @date 2022-02-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix BAL * diff --git a/src/app/application/config/bal_cfg.h b/src/app/application/config/bal_cfg.h index 77da6401..130e5796 100644 --- a/src/app/application/config/bal_cfg.h +++ b/src/app/application/config/bal_cfg.h @@ -43,8 +43,8 @@ * @file bal_cfg.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix BAL * diff --git a/src/app/application/config/battery_cell_cfg.c b/src/app/application/config/battery_cell_cfg.c index 05c1afbd..4bef96fc 100644 --- a/src/app/application/config/battery_cell_cfg.c +++ b/src/app/application/config/battery_cell_cfg.c @@ -43,8 +43,8 @@ * @file battery_cell_cfg.c * @author foxBMS Team * @date 2020-10-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_CELL_CONFIGURATION * @prefix BC * diff --git a/src/app/application/config/battery_cell_cfg.h b/src/app/application/config/battery_cell_cfg.h index d6c5690f..b743d611 100644 --- a/src/app/application/config/battery_cell_cfg.h +++ b/src/app/application/config/battery_cell_cfg.h @@ -43,8 +43,8 @@ * @file battery_cell_cfg.h * @author foxBMS Team * @date 2017-03-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_CELL_CONFIGURATION * @prefix BC * diff --git a/src/app/application/config/battery_system_cfg.c b/src/app/application/config/battery_system_cfg.c index c7aaef43..31d4fc43 100644 --- a/src/app/application/config/battery_system_cfg.c +++ b/src/app/application/config/battery_system_cfg.c @@ -43,8 +43,8 @@ * @file battery_system_cfg.c * @author foxBMS Team * @date 2019-12-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_SYSTEM_CONFIGURATION * @prefix BS * diff --git a/src/app/application/config/battery_system_cfg.h b/src/app/application/config/battery_system_cfg.h index c78a649b..6ab46d8c 100644 --- a/src/app/application/config/battery_system_cfg.h +++ b/src/app/application/config/battery_system_cfg.h @@ -43,8 +43,8 @@ * @file battery_system_cfg.h * @author foxBMS Team * @date 2019-12-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_SYSTEM_CONFIGURATION * @prefix BS * @@ -71,11 +71,7 @@ typedef enum { BS_STRING_WITHOUT_PRECHARGE, } BS_STRING_PRECHARGE_PRESENT_e; -/** - * Symbolic identifiers for strings. - * Currently unused. - * Added for future compatibility. - */ +/** Symbolic identifiers for strings. */ typedef enum { BS_STRING0 = 0u, BS_STRING1 = 1u, @@ -218,6 +214,28 @@ typedef enum { #endif /* CURRENT_SENSOR_PRESENT == true */ +/** + * @brief Maximum break current of main contactors. + * @details The contacts of the main contactors can be welded, when attempting + * to interrupt the current flow while a current higher than the + * maximum break current of the contactor is flowing. + * + * Thus, the contactors will not be opened if the floating current is + * above this value. The fuse should trigger to interrupt current + * flows above this value. + */ +#define BS_MAIN_CONTACTORS_MAXIMUM_BREAK_CURRENT_mA (500000) + +/** + * @brief Maximum fuse trigger duration + * @details If the current is above #BS_MAIN_CONTACTORS_MAXIMUM_BREAK_CURRENT_mA, + * the BMS state machine will wait this time until the fuse triggers so + * that the current will be interrupted by the fuse and not the + * contactors. After this time, the BMS will nevertheless try to open + * the contactors. + */ +#define BS_MAIN_FUSE_MAXIMUM_TRIGGER_DURATION_ms (30000u) + /** * @brief Maximum string current limit in mA that is used in the SOA module * to check for string overcurrent @@ -256,23 +274,6 @@ typedef enum { */ #define BALANCING_DEFAULT_INACTIVE (true) -/** - * @ingroup CONFIG_BATTERYSYSTEM - * @brief Checking if current is in SOF limits of cells. - * @details If set to true the current is checked against the SOF limits. - * If set to false the current is checked against the constant values - * for charging and discharging: - * - #BC_CURRENT_MAX_DISCHARGE_MSL_mA - * - #BC_CURRENT_MAX_DISCHARGE_RSL_mA - * - #BC_CURRENT_MAX_DISCHARGE_MOL_mA - * - * - #BC_CURRENT_MAX_CHARGE_MSL_mA - * - #BC_CURRENT_MAX_CHARGE_RSL_mA - * - #BC_CURRENT_MAX_CHARGE_MOL_mA - * @ptype bool - */ -#define BMS_CHECK_SOF_CURRENT_LIMITS (true) - /** * @ingroup CONFIG_BATTERYSYSTEM * @brief Defines behaviour if an insulation error is detected @@ -299,7 +300,9 @@ typedef enum { /** Number of contactors in addition to string contactors (e.g., PRECHARGE).*/ #define BS_NR_OF_CONTACTORS_OUTSIDE_STRINGS (1u) -/** Number of contactors. One per string + main and precharge */ +/** Total number of contactors in system: + * - Two contactors per string (string+ and string-) + * - One optional precharge contactor for each string */ #define BS_NR_OF_CONTACTORS ((2u * BS_NR_OF_STRINGS) + BS_NR_OF_CONTACTORS_OUTSIDE_STRINGS) /** @@ -391,6 +394,8 @@ typedef enum { #define BS_ERROR_OPEN_WIRE_PERIOD_ms (30000) /**@}*/ +FAS_STATIC_ASSERT((BS_NR_OF_STRINGS <= (uint8_t)UINT8_MAX), "This code assumes BS_NR_OF_STRINGS fits into uint8_t"); + /*========== Extern Constant and Variable Declarations ======================*/ /** Precharge presence of not for each string */ extern BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS]; diff --git a/src/app/application/config/bms_cfg.h b/src/app/application/config/bms_cfg.h index 72a1413c..664d8d7e 100644 --- a/src/app/application/config/bms_cfg.h +++ b/src/app/application/config/bms_cfg.h @@ -43,8 +43,8 @@ * @file bms_cfg.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix BMS * @@ -95,28 +95,31 @@ #endif /** - * @brief BMS statemachine short time definition in #BMS_Trigger() calls + * @brief BMS state machine short time definition in #BMS_Trigger() calls * until next state/substate is processed */ #define BMS_STATEMACH_SHORTTIME (1u) /** - * @brief BMS statemachine medium time definition in #BMS_Trigger() calls + * @brief BMS state machine medium time definition in #BMS_Trigger() calls * until next state/substate is processed */ #define BMS_STATEMACH_MEDIUMTIME (5u) /** - * @brief BMS statemachine long time definition in #BMS_Trigger() calls until + * @brief BMS state machine long time definition in #BMS_Trigger() calls until * next state/substate is processed */ #define BMS_STATEMACH_LONGTIME (10u) -/** Time in #BMS_Trigger() calls to wait after closing a string */ -#define BMS_TIME_WAIT_AFTER_STRING_CLOSED (20u) +/** Time in #BMS_Trigger() calls to wait after closing any string minus or string plus contactor */ +#define BMS_WAIT_TIME_AFTER_CLOSING_STRING_CONTACTOR (20u) -/** Time in #BMS_Trigger() calls to wait after opening a string */ -#define BMS_TIME_WAIT_AFTER_OPENING_STRING (10u) +/** Time in #BMS_Trigger() calls to wait after opening any string minus or string plus contactor */ +#define BMS_WAIT_TIME_AFTER_OPENING_STRING_CONTACTOR (10u) + +/** Time in #BMS_Trigger() calls to wait between closing complete strings */ +#define BMS_WAIT_TIME_BETWEEN_CLOSING_STRINGS (10u) /** * @brief Timeout in #BMS_Trigger() calls when closing a string after which @@ -124,7 +127,10 @@ */ #define BMS_STRING_CLOSE_TIMEOUT (500u) -/** Timeout in #BMS_Trigger() calls to wait after opening a string */ +/** + * @brief Timeout in #BMS_Trigger() calls when opening a string after which + * the state machines goes to error if the string still has not opened + */ #define BMS_STRING_OPEN_TIMEOUT (1000u) /** diff --git a/src/app/application/config/plausibility_cfg.h b/src/app/application/config/plausibility_cfg.h index 75879545..d56c0700 100644 --- a/src/app/application/config/plausibility_cfg.h +++ b/src/app/application/config/plausibility_cfg.h @@ -43,8 +43,8 @@ * @file plausibility_cfg.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION_CONFIGURATION * @prefix PL * diff --git a/src/app/application/config/soa_cfg.c b/src/app/application/config/soa_cfg.c index e0d6e595..9e879285 100644 --- a/src/app/application/config/soa_cfg.c +++ b/src/app/application/config/soa_cfg.c @@ -43,8 +43,8 @@ * @file soa_cfg.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION_CONFIGURATION * @prefix SOA * diff --git a/src/app/application/config/soa_cfg.h b/src/app/application/config/soa_cfg.h index 19de6d77..7142c9c8 100644 --- a/src/app/application/config/soa_cfg.h +++ b/src/app/application/config/soa_cfg.h @@ -43,8 +43,8 @@ * @file soa_cfg.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION_CONFIGURATION * @prefix SOA * diff --git a/src/app/application/plausibility/plausibility.c b/src/app/application/plausibility/plausibility.c index a44c0077..1f7e4b44 100644 --- a/src/app/application/plausibility/plausibility.c +++ b/src/app/application/plausibility/plausibility.c @@ -43,8 +43,8 @@ * @file plausibility.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix PL * diff --git a/src/app/application/plausibility/plausibility.h b/src/app/application/plausibility/plausibility.h index fc7970aa..5a4ae380 100644 --- a/src/app/application/plausibility/plausibility.h +++ b/src/app/application/plausibility/plausibility.h @@ -43,8 +43,8 @@ * @file plausibility.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix PL * diff --git a/src/app/application/redundancy/redundancy.c b/src/app/application/redundancy/redundancy.c index 35602221..c50a9748 100644 --- a/src/app/application/redundancy/redundancy.c +++ b/src/app/application/redundancy/redundancy.c @@ -43,8 +43,8 @@ * @file redundancy.c * @author foxBMS Team * @date 2020-07-31 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix MRC * @@ -668,9 +668,11 @@ static void MRC_ValidateBatteryVoltageMeasurement(void) { if (0 != numberOfValidStringVoltages) { /* AXIVION Next Codeline Style MisraC2012Directive-4.1: truncation impossible; we sum INT32 values x times and divide by x, resulting in INT32 */ - mrc_tablePackValues.batteryVoltage_mV = (int32_t)(sumOfStringValues_mV / numberOfValidStringVoltages); + mrc_tablePackValues.batteryVoltage_mV = (int32_t)(sumOfStringValues_mV / numberOfValidStringVoltages); + mrc_tablePackValues.invalidBatteryVoltage = 0u; } else { - mrc_tablePackValues.batteryVoltage_mV = INT32_MAX; + mrc_tablePackValues.batteryVoltage_mV = INT32_MAX; + mrc_tablePackValues.invalidBatteryVoltage = 1u; } } diff --git a/src/app/application/redundancy/redundancy.h b/src/app/application/redundancy/redundancy.h index 787798ba..fe9892a6 100644 --- a/src/app/application/redundancy/redundancy.h +++ b/src/app/application/redundancy/redundancy.h @@ -43,8 +43,8 @@ * @file redundancy.h * @author foxBMS Team * @date 2020-07-31 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix MRC * diff --git a/src/app/application/soa/soa.c b/src/app/application/soa/soa.c index aa3870e6..1603b5c3 100644 --- a/src/app/application/soa/soa.c +++ b/src/app/application/soa/soa.c @@ -43,8 +43,8 @@ * @file soa.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOA * diff --git a/src/app/application/soa/soa.h b/src/app/application/soa/soa.h index bb4b9469..c677fa8b 100644 --- a/src/app/application/soa/soa.h +++ b/src/app/application/soa/soa.h @@ -43,8 +43,8 @@ * @file soa.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup APPLICATION * @prefix SOA * diff --git a/src/app/driver/adc/adc.c b/src/app/driver/adc/adc.c index 7c94af6a..ac90e958 100644 --- a/src/app/driver/adc/adc.c +++ b/src/app/driver/adc/adc.c @@ -43,8 +43,8 @@ * @file adc.c * @author foxBMS Team * @date 2019-01-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix ADC * @@ -78,19 +78,19 @@ static DATA_BLOCK_ADC_VOLTAGE_s adc_adc1Voltages = {.header.uniqueId = DATA_BLOC /** * @brief converts reading from ADC to a voltage in mV. - * @param adcValue_mV value read from ADC + * @param adcCounts digital value read by ADC * @return voltage in mV */ -static float ADC_ConvertVoltage(float adcValue_mV); +static float ADC_ConvertVoltage(uint16_t adcCounts); /*========== Static Function Implementations ================================*/ -static float ADC_ConvertVoltage(float adcValue_mV) { +static float ADC_ConvertVoltage(uint16_t adcCounts) { /* AXIVION Routine Generic-MissingParameterAssert: adcValue_mV: parameter accepts whole range */ /** For details to equation see Equation 28 in Technical Reference Manual SPNU563A - March 2018 page 852 */ - float result_mV = ((ADC_CONV_FACTOR_12BIT * (adcValue_mV - ADC_VREFLOW_mV)) / (ADC_VREFHIGH_mV - ADC_VREFLOW_mV)) - - 0.5f; + float result_mV = (((adcCounts + ADC_CONV_OFFSET) * (ADC_VREFHIGH_mV - ADC_VREFLOW_mV)) / ADC_CONV_FACTOR_12BIT) + + ADC_VREFLOW_mV; return result_mV; } @@ -120,8 +120,7 @@ extern void ADC_Control(void) { case ADC_CONVERSION_FINISHED: adcGetData(adcREG1, adcGROUP1, &adc_adc1RawVoltages[0]); for (uint8_t i = 0u; i < MCU_ADC1_MAX_NR_CHANNELS; i++) { - adc_adc1Voltages.adc1ConvertedVoltages_mV[i] = - ADC_ConvertVoltage((float)(adc_adc1RawVoltages[i].value)); + adc_adc1Voltages.adc1ConvertedVoltages_mV[i] = ADC_ConvertVoltage(adc_adc1RawVoltages[i].value); } DATA_WRITE_DATA(&adc_adc1Voltages); adc_conversionState = ADC_START_CONVERSION; diff --git a/src/app/driver/adc/adc.h b/src/app/driver/adc/adc.h index efb95c9e..7f29763d 100644 --- a/src/app/driver/adc/adc.h +++ b/src/app/driver/adc/adc.h @@ -43,8 +43,8 @@ * @file adc.h * @author foxBMS Team * @date 2019-01-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix ADC * @@ -72,6 +72,8 @@ #define ADC_CONV_FACTOR_12BIT (4096.0f) /** ADC conversion factor, 10 bit conversion */ #define ADC_CONV_FACTOR_10BIT (1024.0f) +/** ADC conversion offset */ +#define ADC_CONV_OFFSET (0.5f) /** End bit position in ADC Groupx Interrupt Flag Register */ #define ADC_CONVERSION_ENDDBIT (8u) diff --git a/src/app/driver/afe/api/afe.h b/src/app/driver/afe/api/afe.h index 90606ea0..158c36ca 100644 --- a/src/app/driver/afe/api/afe.h +++ b/src/app/driver/afe/api/afe.h @@ -43,8 +43,8 @@ * @file afe.h * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix AFE * diff --git a/src/app/driver/afe/api/afe_dma.h b/src/app/driver/afe/api/afe_dma.h index 64ee38f8..81c68858 100644 --- a/src/app/driver/afe/api/afe_dma.h +++ b/src/app/driver/afe/api/afe_dma.h @@ -43,8 +43,8 @@ * @file afe_dma.h * @author foxBMS Team * @date 2020-06-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/api/afe_plausibility.c b/src/app/driver/afe/api/afe_plausibility.c index cd2fbc57..1ae00da2 100644 --- a/src/app/driver/afe/api/afe_plausibility.c +++ b/src/app/driver/afe/api/afe_plausibility.c @@ -43,8 +43,8 @@ * @file afe_plausibility.c * @author foxBMS Team * @date 2019-01-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup MODULES * @prefix AFE * diff --git a/src/app/driver/afe/api/afe_plausibility.h b/src/app/driver/afe/api/afe_plausibility.h index 168743e0..f7202b01 100644 --- a/src/app/driver/afe/api/afe_plausibility.h +++ b/src/app/driver/afe/api/afe_plausibility.h @@ -43,8 +43,8 @@ * @file afe_plausibility.h * @author foxBMS Team * @date 2019-01-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup MODULES * @prefix AFE * diff --git a/src/app/driver/afe/debug/default/api/debug_default_afe.c b/src/app/driver/afe/debug/default/api/debug_default_afe.c index f2e5edc9..1c482cc7 100644 --- a/src/app/driver/afe/debug/default/api/debug_default_afe.c +++ b/src/app/driver/afe/debug/default/api/debug_default_afe.c @@ -43,8 +43,8 @@ * @file debug_default_afe.c * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix FAKE * diff --git a/src/app/driver/afe/debug/default/api/debug_default_afe.h b/src/app/driver/afe/debug/default/api/debug_default_afe.h index e27d2c19..c5181cca 100644 --- a/src/app/driver/afe/debug/default/api/debug_default_afe.h +++ b/src/app/driver/afe/debug/default/api/debug_default_afe.h @@ -43,8 +43,8 @@ * @file debug_default_afe.h * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FAKE * diff --git a/src/app/driver/afe/debug/default/api/debug_default_afe_dma.c b/src/app/driver/afe/debug/default/api/debug_default_afe_dma.c index a304c14c..81ef377d 100644 --- a/src/app/driver/afe/debug/default/api/debug_default_afe_dma.c +++ b/src/app/driver/afe/debug/default/api/debug_default_afe_dma.c @@ -43,8 +43,8 @@ * @file debug_default_afe_dma.c * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FAKE * diff --git a/src/app/driver/afe/debug/default/api/debug_default_afe_dma.h b/src/app/driver/afe/debug/default/api/debug_default_afe_dma.h index 3b0c9f0f..28e58aae 100644 --- a/src/app/driver/afe/debug/default/api/debug_default_afe_dma.h +++ b/src/app/driver/afe/debug/default/api/debug_default_afe_dma.h @@ -43,8 +43,8 @@ * @file debug_default_afe_dma.h * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FAKE * diff --git a/src/app/driver/afe/debug/default/config/debug_default_cfg.c b/src/app/driver/afe/debug/default/config/debug_default_cfg.c index 0e0f4c70..5105afc3 100644 --- a/src/app/driver/afe/debug/default/config/debug_default_cfg.c +++ b/src/app/driver/afe/debug/default/config/debug_default_cfg.c @@ -43,8 +43,8 @@ * @file debug_default_cfg.c * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix FAKE * diff --git a/src/app/driver/afe/debug/default/config/debug_default_cfg.h b/src/app/driver/afe/debug/default/config/debug_default_cfg.h index d28de25e..ed22132a 100644 --- a/src/app/driver/afe/debug/default/config/debug_default_cfg.h +++ b/src/app/driver/afe/debug/default/config/debug_default_cfg.h @@ -43,8 +43,8 @@ * @file debug_default_cfg.h * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix FAKE * diff --git a/src/app/driver/afe/debug/default/debug_default.c b/src/app/driver/afe/debug/default/debug_default.c index f589e645..a491cbd9 100644 --- a/src/app/driver/afe/debug/default/debug_default.c +++ b/src/app/driver/afe/debug/default/debug_default.c @@ -43,8 +43,8 @@ * @file debug_default.c * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix FAKE * @@ -72,19 +72,19 @@ #define FAKE_CELL_TEMPERATURE_ddegC ((BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC + BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC) / 2u) /** - * statemachine short time definition in #FAKE_TriggerAfe calls + * state machine short time definition in #FAKE_TriggerAfe calls * until next state is processed */ #define FAKE_FSM_SHORT_TIME (1u) /** - * statemachine medium time definition in #FAKE_TriggerAfe calls + * state machine medium time definition in #FAKE_TriggerAfe calls * until next state/substate is processed */ #define FAKE_FSM_MEDIUM_TIME (5u) /** - * statemachine long time definition in #FAKE_TriggerAfe calls + * state machine long time definition in #FAKE_TriggerAfe calls * until next state/substate is processed */ #define FAKE_FSM_LONG_TIME (10u) @@ -340,8 +340,10 @@ static STD_RETURN_TYPE_e FAKE_SaveFakeVoltageMeasurementData(FAKE_STATE_s *pFake STD_RETURN_TYPE_e successfullSave = STD_OK; for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { + pFakeState->data.cellVoltage->nrValidCellVoltages[s] = 0u; for (uint16_t i = 0u; i < BS_NR_OF_CELL_BLOCKS_PER_STRING; i++) { pFakeState->data.cellVoltage->cellVoltage_mV[s][i] = FAKE_CELL_VOLTAGE_mV; + pFakeState->data.cellVoltage->nrValidCellVoltages[s] += 1u; } } @@ -438,7 +440,7 @@ static FAKE_FSM_STATES_e FAKE_ProcessRunningState(FAKE_STATE_s *pFakeState) { break; case FAKE_FSM_SUBSTATE_RUNNING_SAVE_TEMPERATURE_MEASUREMENT_DATA: - if (STD_OK == FAKE_SaveFakeVoltageMeasurementData(pFakeState)) { + if (STD_OK == FAKE_SaveFakeTemperatureMeasurementData(pFakeState)) { FAKE_SetSubstate( pFakeState, FAKE_FSM_SUBSTATE_RUNNING_SAVE_VOLTAGE_MEASUREMENT_DATA, FAKE_FSM_LONG_TIME); } else { diff --git a/src/app/driver/afe/debug/default/debug_default.h b/src/app/driver/afe/debug/default/debug_default.h index 8b3b0522..df828cca 100644 --- a/src/app/driver/afe/debug/default/debug_default.h +++ b/src/app/driver/afe/debug/default/debug_default.h @@ -43,8 +43,8 @@ * @file debug_default.h * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FAKE * diff --git a/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.c b/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.c index 148e661b..f06b2f47 100644 --- a/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.c +++ b/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.c @@ -43,8 +43,8 @@ * @file ltc_6806_cfg.c * @author foxBMS Team * @date 2015-02-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix LTC * diff --git a/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.h b/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.h index 11255af0..299eec1b 100644 --- a/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.h +++ b/src/app/driver/afe/ltc/6806/config/ltc_6806_cfg.h @@ -43,8 +43,8 @@ * @file ltc_6806_cfg.h * @author foxBMS Team * @date 2015-02-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix LTC * diff --git a/src/app/driver/afe/ltc/6806/ltc_6806.c b/src/app/driver/afe/ltc/6806/ltc_6806.c index 29fdfcb2..d807a45b 100644 --- a/src/app/driver/afe/ltc/6806/ltc_6806.c +++ b/src/app/driver/afe/ltc/6806/ltc_6806.c @@ -43,8 +43,8 @@ * @file ltc_6806.c * @author foxBMS Team * @date 2019-09-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix LTC * diff --git a/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.c b/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.c index 801ba694..974da980 100644 --- a/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.c +++ b/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.c @@ -43,8 +43,8 @@ * @file ltc_6813-1_cfg.c * @author foxBMS Team * @date 2015-02-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix LTC * diff --git a/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.h b/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.h index 2b93f363..36927c7e 100644 --- a/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.h +++ b/src/app/driver/afe/ltc/6813-1/config/ltc_6813-1_cfg.h @@ -43,8 +43,8 @@ * @file ltc_6813-1_cfg.h * @author foxBMS Team * @date 2015-02-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix LTC * diff --git a/src/app/driver/afe/ltc/6813-1/ltc_6813-1.c b/src/app/driver/afe/ltc/6813-1/ltc_6813-1.c index d2f95c56..bc045913 100644 --- a/src/app/driver/afe/ltc/6813-1/ltc_6813-1.c +++ b/src/app/driver/afe/ltc/6813-1/ltc_6813-1.c @@ -43,8 +43,8 @@ * @file ltc_6813-1.c * @author foxBMS Team * @date 2019-09-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix LTC * diff --git a/src/app/driver/afe/ltc/api/ltc_afe.c b/src/app/driver/afe/ltc/api/ltc_afe.c index 4f571e9e..0a3f5a82 100644 --- a/src/app/driver/afe/ltc/api/ltc_afe.c +++ b/src/app/driver/afe/ltc/api/ltc_afe.c @@ -43,8 +43,8 @@ * @file ltc_afe.c * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix AFE * diff --git a/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.c b/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.c index 67080932..660fdafb 100644 --- a/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.c +++ b/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.c @@ -43,8 +43,8 @@ * @file ltc_afe_dma_cfg.c * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix DMA * diff --git a/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.h b/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.h index 52957deb..72ad5ac8 100644 --- a/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.h +++ b/src/app/driver/afe/ltc/common/config/ltc_afe_dma_cfg.h @@ -43,8 +43,8 @@ * @file ltc_afe_dma_cfg.h * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix DMA * diff --git a/src/app/driver/afe/ltc/common/config/ltc_cfg.h b/src/app/driver/afe/ltc/common/config/ltc_cfg.h index 52f5eecf..b08ff66c 100644 --- a/src/app/driver/afe/ltc/common/config/ltc_cfg.h +++ b/src/app/driver/afe/ltc/common/config/ltc_cfg.h @@ -43,8 +43,8 @@ * @file ltc_cfg.h * @author foxBMS Team * @date 2015-02-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix LTC * diff --git a/src/app/driver/afe/ltc/common/ltc.h b/src/app/driver/afe/ltc/common/ltc.h index c422d828..e3ffd18b 100644 --- a/src/app/driver/afe/ltc/common/ltc.h +++ b/src/app/driver/afe/ltc/common/ltc.h @@ -43,8 +43,8 @@ * @file ltc.h * @author foxBMS Team * @date 2015-09-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix LTC * diff --git a/src/app/driver/afe/ltc/common/ltc_afe_dma.c b/src/app/driver/afe/ltc/common/ltc_afe_dma.c index 20f59a9f..ecc17f94 100644 --- a/src/app/driver/afe/ltc/common/ltc_afe_dma.c +++ b/src/app/driver/afe/ltc/common/ltc_afe_dma.c @@ -43,8 +43,8 @@ * @file ltc_afe_dma.c * @author foxBMS Team * @date 2020-05-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/ltc/common/ltc_afe_dma.h b/src/app/driver/afe/ltc/common/ltc_afe_dma.h index 596224ae..97e6aec8 100644 --- a/src/app/driver/afe/ltc/common/ltc_afe_dma.h +++ b/src/app/driver/afe/ltc/common/ltc_afe_dma.h @@ -43,8 +43,8 @@ * @file ltc_afe_dma.h * @author foxBMS Team * @date 2020-05-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/ltc/common/ltc_defs.h b/src/app/driver/afe/ltc/common/ltc_defs.h index 4e5a2223..de207eb6 100644 --- a/src/app/driver/afe/ltc/common/ltc_defs.h +++ b/src/app/driver/afe/ltc/common/ltc_defs.h @@ -43,8 +43,8 @@ * @file ltc_defs.h * @author foxBMS Team * @date 2015-09-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix LTC * diff --git a/src/app/driver/afe/maxim/api/mxm_afe.c b/src/app/driver/afe/maxim/api/mxm_afe.c index 2c53c377..7622475d 100644 --- a/src/app/driver/afe/maxim/api/mxm_afe.c +++ b/src/app/driver/afe/maxim/api/mxm_afe.c @@ -43,8 +43,8 @@ * @file mxm_afe.c * @author foxBMS Team * @date 2020-06-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix AFE * diff --git a/src/app/driver/afe/maxim/common/config/mxm_cfg.c b/src/app/driver/afe/maxim/common/config/mxm_cfg.c index 77f5a18e..0379c3a7 100644 --- a/src/app/driver/afe/maxim/common/config/mxm_cfg.c +++ b/src/app/driver/afe/maxim/common/config/mxm_cfg.c @@ -43,8 +43,8 @@ * @file mxm_cfg.c * @author foxBMS Team * @date 2019-01-09 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/config/mxm_cfg.h b/src/app/driver/afe/maxim/common/config/mxm_cfg.h index 34257a6d..8e4c0d4f 100644 --- a/src/app/driver/afe/maxim/common/config/mxm_cfg.h +++ b/src/app/driver/afe/maxim/common/config/mxm_cfg.h @@ -43,8 +43,8 @@ * @file mxm_cfg.h * @author foxBMS Team * @date 2019-01-09 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_17841b.c b/src/app/driver/afe/maxim/common/mxm_17841b.c index cdd8e3f5..6dc03bee 100644 --- a/src/app/driver/afe/maxim/common/mxm_17841b.c +++ b/src/app/driver/afe/maxim/common/mxm_17841b.c @@ -43,8 +43,8 @@ * @file mxm_17841b.c * @author foxBMS Team * @date 2018-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_17841b.h b/src/app/driver/afe/maxim/common/mxm_17841b.h index 242f1186..57acee47 100644 --- a/src/app/driver/afe/maxim/common/mxm_17841b.h +++ b/src/app/driver/afe/maxim/common/mxm_17841b.h @@ -43,8 +43,8 @@ * @file mxm_17841b.h * @author foxBMS Team * @date 2018-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_1785x.c b/src/app/driver/afe/maxim/common/mxm_1785x.c index 4cad0ac2..5a530fe9 100644 --- a/src/app/driver/afe/maxim/common/mxm_1785x.c +++ b/src/app/driver/afe/maxim/common/mxm_1785x.c @@ -43,8 +43,8 @@ * @file mxm_1785x.c * @author foxBMS Team * @date 2019-01-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_1785x.h b/src/app/driver/afe/maxim/common/mxm_1785x.h index 15a42bc6..03f79bc4 100644 --- a/src/app/driver/afe/maxim/common/mxm_1785x.h +++ b/src/app/driver/afe/maxim/common/mxm_1785x.h @@ -43,8 +43,8 @@ * @file mxm_1785x.h * @author foxBMS Team * @date 2019-01-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_1785x_tools.c b/src/app/driver/afe/maxim/common/mxm_1785x_tools.c index e1932ffd..4ba3609d 100644 --- a/src/app/driver/afe/maxim/common/mxm_1785x_tools.c +++ b/src/app/driver/afe/maxim/common/mxm_1785x_tools.c @@ -43,8 +43,8 @@ * @file mxm_1785x_tools.c * @author foxBMS Team * @date 2020-07-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_1785x_tools.h b/src/app/driver/afe/maxim/common/mxm_1785x_tools.h index f72b965f..f3679611 100644 --- a/src/app/driver/afe/maxim/common/mxm_1785x_tools.h +++ b/src/app/driver/afe/maxim/common/mxm_1785x_tools.h @@ -43,8 +43,8 @@ * @file mxm_1785x_tools.h * @author foxBMS Team * @date 2020-07-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_41b_register_map.h b/src/app/driver/afe/maxim/common/mxm_41b_register_map.h index 64d00e0c..2f15b400 100644 --- a/src/app/driver/afe/maxim/common/mxm_41b_register_map.h +++ b/src/app/driver/afe/maxim/common/mxm_41b_register_map.h @@ -43,8 +43,8 @@ * @file mxm_41b_register_map.h * @author foxBMS Team * @date 2020-06-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_afe_dma.c b/src/app/driver/afe/maxim/common/mxm_afe_dma.c index 21f270d2..1635cbb0 100644 --- a/src/app/driver/afe/maxim/common/mxm_afe_dma.c +++ b/src/app/driver/afe/maxim/common/mxm_afe_dma.c @@ -43,8 +43,8 @@ * @file mxm_afe_dma.c * @author foxBMS Team * @date 2020-06-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/maxim/common/mxm_afe_dma.h b/src/app/driver/afe/maxim/common/mxm_afe_dma.h index ae7a3c01..bcc1c274 100644 --- a/src/app/driver/afe/maxim/common/mxm_afe_dma.h +++ b/src/app/driver/afe/maxim/common/mxm_afe_dma.h @@ -43,8 +43,8 @@ * @file mxm_afe_dma.h * @author foxBMS Team * @date 2020-06-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/maxim/common/mxm_basic_defines.h b/src/app/driver/afe/maxim/common/mxm_basic_defines.h index d466b6f3..e1003660 100644 --- a/src/app/driver/afe/maxim/common/mxm_basic_defines.h +++ b/src/app/driver/afe/maxim/common/mxm_basic_defines.h @@ -43,8 +43,8 @@ * @file mxm_basic_defines.h * @author foxBMS Team * @date 2020-02-11 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_battery_management.c b/src/app/driver/afe/maxim/common/mxm_battery_management.c index 022f9c8a..536ec905 100644 --- a/src/app/driver/afe/maxim/common/mxm_battery_management.c +++ b/src/app/driver/afe/maxim/common/mxm_battery_management.c @@ -43,8 +43,8 @@ * @file mxm_battery_management.c * @author foxBMS Team * @date 2019-01-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_battery_management.h b/src/app/driver/afe/maxim/common/mxm_battery_management.h index 9f23c8d2..895cdf59 100644 --- a/src/app/driver/afe/maxim/common/mxm_battery_management.h +++ b/src/app/driver/afe/maxim/common/mxm_battery_management.h @@ -43,8 +43,8 @@ * @file mxm_battery_management.h * @author foxBMS Team * @date 2019-01-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_bitextract.c b/src/app/driver/afe/maxim/common/mxm_bitextract.c index 7482b9e3..45316a8d 100644 --- a/src/app/driver/afe/maxim/common/mxm_bitextract.c +++ b/src/app/driver/afe/maxim/common/mxm_bitextract.c @@ -43,8 +43,8 @@ * @file mxm_bitextract.c * @author foxBMS Team * @date 2019-01-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_bitextract.h b/src/app/driver/afe/maxim/common/mxm_bitextract.h index 528a5195..9f80889c 100644 --- a/src/app/driver/afe/maxim/common/mxm_bitextract.h +++ b/src/app/driver/afe/maxim/common/mxm_bitextract.h @@ -43,8 +43,8 @@ * @file mxm_bitextract.h * @author foxBMS Team * @date 2019-01-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_crc8.c b/src/app/driver/afe/maxim/common/mxm_crc8.c index 8e69307a..b8defe87 100644 --- a/src/app/driver/afe/maxim/common/mxm_crc8.c +++ b/src/app/driver/afe/maxim/common/mxm_crc8.c @@ -43,8 +43,8 @@ * @file mxm_crc8.c * @author foxBMS Team * @date 2019-02-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_crc8.h b/src/app/driver/afe/maxim/common/mxm_crc8.h index 4ccfe2cd..70e29f8c 100644 --- a/src/app/driver/afe/maxim/common/mxm_crc8.h +++ b/src/app/driver/afe/maxim/common/mxm_crc8.h @@ -43,8 +43,8 @@ * @file mxm_crc8.h * @author foxBMS Team * @date 2019-02-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_register_map.h b/src/app/driver/afe/maxim/common/mxm_register_map.h index e9e02e1f..0cda4e25 100644 --- a/src/app/driver/afe/maxim/common/mxm_register_map.h +++ b/src/app/driver/afe/maxim/common/mxm_register_map.h @@ -43,8 +43,8 @@ * @file mxm_register_map.h * @author foxBMS Team * @date 2019-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_registry.c b/src/app/driver/afe/maxim/common/mxm_registry.c index f53b005e..a99b6ea2 100644 --- a/src/app/driver/afe/maxim/common/mxm_registry.c +++ b/src/app/driver/afe/maxim/common/mxm_registry.c @@ -43,8 +43,8 @@ * @file mxm_registry.c * @author foxBMS Team * @date 2020-07-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/common/mxm_registry.h b/src/app/driver/afe/maxim/common/mxm_registry.h index 3057b2c4..f4343784 100644 --- a/src/app/driver/afe/maxim/common/mxm_registry.h +++ b/src/app/driver/afe/maxim/common/mxm_registry.h @@ -43,8 +43,8 @@ * @file mxm_registry.h * @author foxBMS Team * @date 2020-07-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/maxim/max17852/mxm_17852.c b/src/app/driver/afe/maxim/max17852/mxm_17852.c index a736975f..c202e46b 100644 --- a/src/app/driver/afe/maxim/max17852/mxm_17852.c +++ b/src/app/driver/afe/maxim/max17852/mxm_17852.c @@ -43,8 +43,8 @@ * @file mxm_17852.c * @author foxBMS Team * @date 2021-11-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MXM * diff --git a/src/app/driver/afe/nxp/api/nxp_afe.c b/src/app/driver/afe/nxp/api/nxp_afe.c index 6aaea2ad..07f3d3de 100644 --- a/src/app/driver/afe/nxp/api/nxp_afe.c +++ b/src/app/driver/afe/nxp/api/nxp_afe.c @@ -43,8 +43,8 @@ * @file nxp_afe.c * @author foxBMS Team * @date 2020-05-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix AFE * diff --git a/src/app/driver/afe/nxp/api/nxp_afe.h b/src/app/driver/afe/nxp/api/nxp_afe.h index 06960c05..3b37a77b 100644 --- a/src/app/driver/afe/nxp/api/nxp_afe.h +++ b/src/app/driver/afe/nxp/api/nxp_afe.h @@ -43,8 +43,8 @@ * @file nxp_afe.h * @author foxBMS Team * @date 2021-06-04 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix NXP * diff --git a/src/app/driver/afe/nxp/mc33775a/api/nxp_mc33775a_afe.c b/src/app/driver/afe/nxp/mc33775a/api/nxp_mc33775a_afe.c index b20d907f..6bc04238 100644 --- a/src/app/driver/afe/nxp/mc33775a/api/nxp_mc33775a_afe.c +++ b/src/app/driver/afe/nxp/mc33775a/api/nxp_mc33775a_afe.c @@ -43,8 +43,8 @@ * @file nxp_mc33775a_afe.c * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix N775 * diff --git a/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.c b/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.c index 3c3347b6..7ab1e14d 100644 --- a/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.c +++ b/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.c @@ -43,8 +43,8 @@ * @file nxp_afe_dma_cfg.c * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix DMA * diff --git a/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.h b/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.h index aa38049d..fc867856 100644 --- a/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.h +++ b/src/app/driver/afe/nxp/mc33775a/config/nxp_afe_dma_cfg.h @@ -43,8 +43,8 @@ * @file nxp_afe_dma_cfg.h * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix DMA * diff --git a/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.c b/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.c index 234a7cba..757bc2d1 100644 --- a/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.c +++ b/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.c @@ -43,8 +43,8 @@ * @file nxp_mc33775a_cfg.c * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix N775 * diff --git a/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.h b/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.h index 375f9687..f8aa355d 100644 --- a/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.h +++ b/src/app/driver/afe/nxp/mc33775a/config/nxp_mc33775a_cfg.h @@ -43,8 +43,8 @@ * @file nxp_mc33775a_cfg.h * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix N775 * diff --git a/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.c b/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.c index 38e195f2..dd9abb97 100644 --- a/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.c +++ b/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.c @@ -43,8 +43,8 @@ * @file nxp_afe_dma.c * @author foxBMS Team * @date 2020-05-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.h b/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.h index 2654dd34..17530999 100644 --- a/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.h +++ b/src/app/driver/afe/nxp/mc33775a/nxp_afe_dma.h @@ -43,8 +43,8 @@ * @file nxp_afe_dma.h * @author foxBMS Team * @date 2020-05-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix AFE * diff --git a/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.c b/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.c index f9a5bda4..a01f03d6 100644 --- a/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.c +++ b/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.c @@ -43,8 +43,8 @@ * @file nxp_mc33775a.c * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix N775 * diff --git a/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.h b/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.h index 7dc96ad1..7469cd6e 100644 --- a/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.h +++ b/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a.h @@ -43,8 +43,8 @@ * @file nxp_mc33775a.h * @author foxBMS Team * @date 2020-05-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix N775 * diff --git a/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a_defs.h b/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a_defs.h index 79ab445d..ce955b3e 100644 --- a/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a_defs.h +++ b/src/app/driver/afe/nxp/mc33775a/nxp_mc33775a_defs.h @@ -43,8 +43,8 @@ * @file nxp_mc33775a_defs.h * @author foxBMS Team * @date 2020-09-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix N775 * diff --git a/src/app/driver/can/can.c b/src/app/driver/can/can.c index 48dd98be..57945baa 100644 --- a/src/app/driver/can/can.c +++ b/src/app/driver/can/can.c @@ -43,8 +43,8 @@ * @file can.c * @author foxBMS Team * @date 2019-12-04 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CAN * @@ -77,24 +77,6 @@ /** upper limit of timestamp counts for a valid CAN timing */ #define CAN_TIMING_UPPER_LIMIT_COUNTS (105u) -/** maximum distance from release that can be encoded in the boot message */ -#define CAN_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE (31u) -#if CAN_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE > UINT8_MAX -#error "This code assumes that the define is smaller or equal to UINT8_MAX") -#endif - -/** bit position of boot message byte 3 version control flag */ -#define CAN_BOOT_MESSAGE_BYTE_3_BIT_VERSION_CONTROL (0u) - -/** bit position of boot message byte 3 dirty flag */ -#define CAN_BOOT_MESSAGE_BYTE_3_BIT_DIRTY_FLAG (1u) - -/** bit position of boot message byte 3 release distance overflow flag */ -#define CAN_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_OVERFLOW_FLAG (2u) - -/** bit position of boot message byte 3 release distance counter */ -#define CAN_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_COUNTER (3u) - /** return value of function canGetData if no data was lost during reception */ #define CAN_HAL_RETVAL_NO_DATA_LOST (1u) @@ -202,7 +184,7 @@ static void CAN_InitializeTransceiver(void) { static void CAN_ValidateConfiguredTxMessagePeriod(void) { for (uint16_t i = 0u; i < can_txLength; i++) { - if (can_txMessages[i].repetitionTime == 0u) { + if (can_txMessages[i].timing.period == 0u) { FAS_ASSERT(FAS_TRAP); } } @@ -218,7 +200,7 @@ extern void CAN_Initialize(void) { extern STD_RETURN_TYPE_e CAN_DataSend(canBASE_t *pNode, uint32_t id, uint8 *pData) { FAS_ASSERT(pNode != NULL_PTR); FAS_ASSERT(pData != NULL_PTR); - FAS_ASSERT((pNode == CAN1_NODE) || (pNode == CAN2_NODE)); + FAS_ASSERT((pNode == CAN_NODE_1) || (pNode == CAN_NODE_2)); /* AXIVION Routine Generic-MissingParameterAssert: id: parameter accepts whole range */ STD_RETURN_TYPE_e result = STD_NOT_OK; @@ -256,19 +238,14 @@ static STD_RETURN_TYPE_e CAN_PeriodicTransmit(void) { uint8_t data[8] = {0}; for (uint16_t i = 0u; i < can_txLength; i++) { - if (((counterTicks * CAN_TICK_ms) % (can_txMessages[i].repetitionTime)) == can_txMessages[i].repetitionPhase) { + if (((counterTicks * CAN_TICK_ms) % (can_txMessages[i].timing.period)) == can_txMessages[i].timing.phase) { if (can_txMessages[i].callbackFunction != NULL_PTR) { can_txMessages[i].callbackFunction( - can_txMessages[i].id, - can_txMessages[i].dlc, - can_txMessages[i].endianness, - data, - can_txMessages[i].pMuxId, - &can_kShim); + can_txMessages[i].message, data, can_txMessages[i].pMuxId, &can_kShim); /* CAN messages are currently discarded if all message boxes * are full. They will not be retransmitted within the next * call of CAN_PeriodicTransmit() */ - CAN_DataSend(can_txMessages[i].canNode, can_txMessages[i].id, data); + CAN_DataSend(can_txMessages[i].canNode, can_txMessages[i].message.id, data); retVal = STD_OK; } } @@ -353,19 +330,15 @@ static void CAN_CheckCanTiming(void) { } extern void CAN_ReadRxBuffer(void) { - CAN_BUFFERELEMENT_s can_rxBuffer = {0}; + CAN_BUFFER_ELEMENT_s can_rxBuffer = {0}; if (ftsk_allQueuesCreated == true) { while (OS_ReceiveFromQueue(ftsk_canRxQueue, (void *)&can_rxBuffer, 0u) == OS_SUCCESS) { /* data queue was not empty */ for (uint16_t i = 0u; i < can_rxLength; i++) { - if ((can_rxBuffer.canNode == can_rxMessages[i].canNode) && (can_rxBuffer.id == can_rxMessages[i].id)) { + if ((can_rxBuffer.canNode == can_rxMessages[i].canNode) && + (can_rxBuffer.id == can_rxMessages[i].message.id)) { if (can_rxMessages[i].callbackFunction != NULL_PTR) { - can_rxMessages[i].callbackFunction( - can_rxMessages[i].id, - can_rxMessages[i].dlc, - can_rxMessages[i].endianness, - can_rxBuffer.data, - &can_kShim); + can_rxMessages[i].callbackFunction(can_rxMessages[i].message, can_rxBuffer.data, &can_kShim); } } } @@ -447,8 +420,8 @@ static void CAN_TxInterrupt(canBASE_t *pNode, uint32 messageBox) { static void CAN_RxInterrupt(canBASE_t *pNode, uint32 messageBox) { FAS_ASSERT(pNode != NULL_PTR); - CAN_BUFFERELEMENT_s can_rxBuffer = {0u}; - uint8_t messageData[CAN_DLC] = {0u}; + CAN_BUFFER_ELEMENT_s can_rxBuffer = {0u}; + uint8_t messageData[CAN_DEFAULT_DLC] = {0u}; /** * Read even if queues are not created, otherwise message boxes get full. * Possible return values: @@ -498,78 +471,6 @@ void UNIT_TEST_WEAK_IMPL canMessageNotification(canBASE_t *node, uint32 messageB } } -extern STD_RETURN_TYPE_e CAN_TransmitBootMessage(void) { - uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))}; - - /* Set major number */ - data[CAN_BYTE_0_POSITION] = ver_foxbmsVersionInformation.major; - /* Set minor number */ - data[CAN_BYTE_1_POSITION] = ver_foxbmsVersionInformation.minor; - /* Set patch number */ - data[CAN_BYTE_2_POSITION] = ver_foxbmsVersionInformation.patch; - - /* intermediate variable for message byte 3 */ - uint8_t versionControlByte = 0u; - - /* Set version control flags */ - if (ver_foxbmsVersionInformation.underVersionControl == true) { - versionControlByte |= (0x01u << CAN_BOOT_MESSAGE_BYTE_3_BIT_VERSION_CONTROL); - } - if (ver_foxbmsVersionInformation.isDirty == true) { - versionControlByte |= (0x01u << CAN_BOOT_MESSAGE_BYTE_3_BIT_DIRTY_FLAG); - } - /* Set overflow flag (if release distance is larger than 31) */ - if (ver_foxbmsVersionInformation.distanceFromLastRelease > CAN_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE) { - /* we need to set the overflow flag */ - versionControlByte |= (0x01u << CAN_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_OVERFLOW_FLAG); - } - - /* Set release distance (capped to maximum value) */ - const uint8_t distanceCapped = (uint8_t)MATH_MinimumOfTwoUint16_t( - ver_foxbmsVersionInformation.distanceFromLastRelease, (uint16_t)CAN_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE); - versionControlByte |= (distanceCapped << CAN_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_COUNTER); - - /* assign assembled byte to databyte */ - data[CAN_BYTE_3_POSITION] = versionControlByte; - - /* Read out device register with unique ID */ - const uint32_t deviceRegister = systemREG1->DEVID; - - /* Set unique ID */ - data[CAN_BYTE_4_POSITION] = (uint8_t)((deviceRegister >> 24u) & 0xFFu); - data[CAN_BYTE_5_POSITION] = (uint8_t)((deviceRegister >> 16u) & 0xFFu); - data[CAN_BYTE_6_POSITION] = (uint8_t)((deviceRegister >> 8u) & 0xFFu); - data[CAN_BYTE_7_POSITION] = (uint8_t)(deviceRegister & 0xFFu); - - STD_RETURN_TYPE_e retval = CAN_DataSend(CAN1_NODE, CAN_ID_BOOT_MESSAGE, &data[0]); - - return retval; -} - -extern STD_RETURN_TYPE_e CAN_TransmitDieId(void) { - uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))}; - - /* Read out device register with die ID low and high */ - const uint32_t dieIdLow = systemREG1->DIEIDL; - const uint32_t dieIdHigh = systemREG1->DIEIDH; - - /* set die ID */ - /* AXIVION Disable Style Generic-NoMagicNumbers: The magic numbers are used to divide down the registers into the CAN message */ - data[CAN_BYTE_0_POSITION] = (uint8_t)((dieIdHigh >> 24u) & 0xFFu); - data[CAN_BYTE_1_POSITION] = (uint8_t)((dieIdHigh >> 16u) & 0xFFu); - data[CAN_BYTE_2_POSITION] = (uint8_t)((dieIdHigh >> 8u) & 0xFFu); - data[CAN_BYTE_3_POSITION] = (uint8_t)(dieIdHigh & 0xFFu); - data[CAN_BYTE_4_POSITION] = (uint8_t)((dieIdLow >> 24u) & 0xFFu); - data[CAN_BYTE_5_POSITION] = (uint8_t)((dieIdLow >> 16u) & 0xFFu); - data[CAN_BYTE_6_POSITION] = (uint8_t)((dieIdLow >> 8u) & 0xFFu); - data[CAN_BYTE_7_POSITION] = (uint8_t)(dieIdLow & 0xFFu); - /* AXIVION Enable Style Generic-NoMagicNumbers: */ - - STD_RETURN_TYPE_e retval = CAN_DataSend(CAN1_NODE, CAN_ID_DIE_ID, &data[0]); - - return retval; -} - /*========== Getter for static Variables (Unit Test) ========================*/ #ifdef UNITY_UNIT_TEST extern CAN_STATE_s *TEST_CAN_GetCANState(void) { diff --git a/src/app/driver/can/can.h b/src/app/driver/can/can.h index a20b0a07..4891c4bd 100644 --- a/src/app/driver/can/can.h +++ b/src/app/driver/can/can.h @@ -43,8 +43,8 @@ * @file can.h * @author foxBMS Team * @date 2019-12-04 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CAN * @@ -89,7 +89,7 @@ typedef struct { /** * @brief Sends over CAN the data passed in parameters. - * This function goes over the messageboxes and marks the ones that should + * This function goes over the message boxes and marks the ones that should * be sent. * @param[in,out] pNode CAN interface to use * @param[in] id ID of message to send @@ -148,18 +148,6 @@ extern bool CAN_IsCurrentSensorCcPresent(uint8_t stringNumber); */ extern bool CAN_IsCurrentSensorEcPresent(uint8_t stringNumber); -/** - * @brief Transmit startup boot message - * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK - */ -extern STD_RETURN_TYPE_e CAN_TransmitBootMessage(void); - -/** - * @brief Transmit chip id - * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK - */ -extern STD_RETURN_TYPE_e CAN_TransmitDieId(void); - /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ #ifdef UNITY_UNIT_TEST extern CAN_STATE_s *TEST_CAN_GetCANState(void); diff --git a/src/app/driver/can/cbs/can_helper.c b/src/app/driver/can/cbs/can_helper.c index 0a02672f..d200c21e 100644 --- a/src/app/driver/can/cbs/can_helper.c +++ b/src/app/driver/can/cbs/can_helper.c @@ -43,8 +43,8 @@ * @file can_helper.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CAN * diff --git a/src/app/driver/can/cbs/can_helper.h b/src/app/driver/can/cbs/can_helper.h index 5dabd1c2..dac4df04 100644 --- a/src/app/driver/can/cbs/can_helper.h +++ b/src/app/driver/can/cbs/can_helper.h @@ -43,8 +43,8 @@ * @file can_helper.h * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CAN * @@ -105,7 +105,7 @@ extern void CAN_TxPrepareSignalData(float *pSignal, CAN_SIGNAL_TYPE_s signalProp * This function takes the raw signal data and * applies offset and factor to convert * the raw value. - * @param[out] pSignalConverted coverted signal data + * @param[out] pSignalConverted converted signal data * @param[in] signalRaw raw signal data * @param[in] signalProperties signal properties (factor, offset, min, max) */ diff --git a/src/app/driver/can/cbs/rx/can_cbs_rx.h b/src/app/driver/can/cbs/rx/can_cbs_rx.h new file mode 100644 index 00000000..734e8a77 --- /dev/null +++ b/src/app/driver/can/cbs/rx/can_cbs_rx.h @@ -0,0 +1,147 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cbs_rx.h + * @author foxBMS Team + * @date 2021-04-20 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVER + * @prefix CANRX + * + * @brief CAN callbacks header + * + */ + +#ifndef FOXBMS__CAN_CBS_RX_H_ +#define FOXBMS__CAN_CBS_RX_H_ + +/*========== Includes =======================================================*/ +#include "general.h" + +#include "can_cfg.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Extern Constant and Variable Declarations ======================*/ + +/*========== Extern Function Prototypes =====================================*/ + +/** RX callback functions @{ */ +/** + * @brief can rx callback function for IMD info messages + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_ImdInfo( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** + * @brief can rx callback function for IMD response messages + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_ImdResponse( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** + * @brief can rx callback function for state requests + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_BmsStateRequest( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** + * @brief can rx callback function for SW reset + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_SoftwareReset( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** + * @brief can rx callback function for current sensor measurements + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_CurrentSensor( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** + * @brief can rx callback function for debug messages + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_Debug( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** + * @brief can rx callback function for SW version + * @param[in] message contains the message ID, DLC and endianness + * @param[in] kpkCanData payload of can frame + * @param[in] kpkCanShim shim to the database entries + */ +extern uint32_t CANRX_SoftwareVersion( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim); +/** @} */ + +/*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ +#ifdef UNITY_UNIT_TEST + +#endif + +#endif /* FOXBMS__CAN_CBS_RX_H_ */ diff --git a/src/app/driver/can/cbs/can_cbs_rx_current_sensor.c b/src/app/driver/can/cbs/rx/can_cbs_rx_current-sensor.c similarity index 75% rename from src/app/driver/can/cbs/can_cbs_rx_current_sensor.c rename to src/app/driver/can/cbs/rx/can_cbs_rx_current-sensor.c index 500b0395..7e5bcca8 100644 --- a/src/app/driver/can/cbs/can_cbs_rx_current_sensor.c +++ b/src/app/driver/can/cbs/rx/can_cbs_rx_current-sensor.c @@ -40,32 +40,33 @@ */ /** - * @file can_cbs_rx_current_sensor.c + * @file can_cbs_rx_current-sensor.c * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANRX * * @brief CAN driver Rx callback implementation * @details CAN Rx callback for current sensor measurements */ /*========== Includes =======================================================*/ -#include "can_cbs.h" +#include "can_cbs_rx.h" +#include "can_cfg_rx-message-definitions.h" #include "can_helper.h" /*========== Macros and Definitions =========================================*/ /** Overcurrent flag */ -#define CAN_CURRENT_SENSOR_DIAGNOSIS_OVERCURRENT (0x1u) +#define CANRX_CURRENT_SENSOR_DIAGNOSIS_OVERCURRENT_BITMASK (0x1u) /** Actual measurement error flag */ -#define CAN_CURRENT_SENSOR_DIAGNOSIS_ACTUAL_MEASUREMENT_ERROR (0x2u) +#define CANRX_CURRENT_SENSOR_DIAGNOSIS_ACTUAL_MEASUREMENT_ERROR_BITMASK (0x2u) /** Any measurement error flag */ -#define CAN_CURRENT_SENSOR_DIAGNOSIS_ANY_MEASUREMENT_ERROR (0x4u) +#define CANRX_CURRENT_SENSOR_DIAGNOSIS_ANY_MEASUREMENT_ERROR_BITMASK (0x4u) /** System error flag */ -#define CAN_CURRENT_SENSOR_DIAGNOSIS_SYSTEM_ERROR (0x8u) +#define CANRX_CURRENT_SENSOR_DIAGNOSIS_SYSTEM_ERROR_BITMASK (0x8u) /*========== Static Constant and Variable Definitions =======================*/ @@ -76,14 +77,12 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_RxCurrentSensor( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_CurrentSensor( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(((message.id >= CANRX_STRING0_CURRENT_ID) && (message.id <= CANRX_STRING0_ENERGY_COUNTER_ID))); + FAS_ASSERT(message.dlc == CANRX_CURRENT_SENSOR_MESSAGES_DLC); FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); @@ -95,74 +94,54 @@ extern uint32_t CAN_RxCurrentSensor( const CAN_SIGNAL_TYPE_s currentSensorStatus = {7u, 8u, 1.0f, 0.0f, 0.0f, 255.0f}; const CAN_SIGNAL_TYPE_s currentSensorData = {23u, 32u, 1.0f, 0.0f, -2147483648.0f, 2147483648.0f}; - uint64_t message = 0u; - uint64_t canSignal = 0u; + uint64_t messageData = 0u; + uint64_t canSignal = 0u; int32_t sensorSignalValue = 0; uint8_t diagInfo = 0u; uint8_t stringNumber = 0u; - if (id <= CAN_ID_STRING0_ENERGY_COUNTER) { + if (message.id <= CANRX_STRING0_ENERGY_COUNTER_ID) { stringNumber = 0u; - } else if (id <= CAN_ID_STRING1_ENERGY_COUNTER) { - stringNumber = 1u; - } else { - stringNumber = 2u; } - CAN_RxGetMessageDataFromCanData(&message, kpkCanData, endianness); + CAN_RxGetMessageDataFromCanData(&messageData, kpkCanData, message.endianness); /* Get status*/ CAN_RxGetSignalDataFromMessageData( - message, currentSensorStatus.bitStart, currentSensorStatus.bitLength, &canSignal, endianness); + messageData, currentSensorStatus.bitStart, currentSensorStatus.bitLength, &canSignal, message.endianness); /* only high nibble contains diag info */ diagInfo = canSignal & 0xF0u; diagInfo >>= 4u; - if ((diagInfo & CAN_CURRENT_SENSOR_DIAGNOSIS_OVERCURRENT) != 0u) { + if ((diagInfo & CANRX_CURRENT_SENSOR_DIAGNOSIS_OVERCURRENT_BITMASK) != 0u) { /* Overcurrent detected. This feature is currently not supported. */ } - if ((diagInfo & CAN_CURRENT_SENSOR_DIAGNOSIS_ACTUAL_MEASUREMENT_ERROR) != 0u) { - switch (id) { - case CAN_ID_STRING0_CURRENT: /* Current status */ - case CAN_ID_STRING1_CURRENT: - case CAN_ID_STRING2_CURRENT: + if ((diagInfo & CANRX_CURRENT_SENSOR_DIAGNOSIS_ACTUAL_MEASUREMENT_ERROR_BITMASK) != 0u) { + switch (message.id) { + case CANRX_STRING0_CURRENT_ID: /* Current status */ kpkCanShim->pTableCurrentSensor->invalidCurrentMeasurement[stringNumber] = 1; break; - case CAN_ID_STRING0_VOLTAGE1: /* Voltage status */ - case CAN_ID_STRING1_VOLTAGE1: - case CAN_ID_STRING2_VOLTAGE1: + case CANRX_STRING0_VOLTAGE1_ID: /* Voltage status */ kpkCanShim->pTableCurrentSensor->invalidHighVoltageMeasurement[stringNumber][0] = 1; break; - case CAN_ID_STRING0_VOLTAGE2: - case CAN_ID_STRING1_VOLTAGE2: - case CAN_ID_STRING2_VOLTAGE2: + case CANRX_STRING0_VOLTAGE2_ID: kpkCanShim->pTableCurrentSensor->invalidHighVoltageMeasurement[stringNumber][1] = 1; break; - case CAN_ID_STRING0_VOLTAGE3: - case CAN_ID_STRING1_VOLTAGE3: - case CAN_ID_STRING2_VOLTAGE3: + case CANRX_STRING0_VOLTAGE3_ID: kpkCanShim->pTableCurrentSensor->invalidHighVoltageMeasurement[stringNumber][2] = 1; break; - case CAN_ID_STRING0_TEMPERATURE: /* Temperature status */ - case CAN_ID_STRING1_TEMPERATURE: - case CAN_ID_STRING2_TEMPERATURE: + case CANRX_STRING0_TEMPERATURE_ID: /* Temperature status */ kpkCanShim->pTableCurrentSensor->invalidSensorTemperatureMeasurement[stringNumber] = 1; break; - case CAN_ID_STRING0_POWER: /* Power status */ - case CAN_ID_STRING1_POWER: - case CAN_ID_STRING2_POWER: + case CANRX_STRING0_POWER_ID: /* Power status */ kpkCanShim->pTableCurrentSensor->invalidPowerMeasurement[stringNumber] = 1; break; - case CAN_ID_STRING0_CURRENT_COUNTER: /* CC status */ - case CAN_ID_STRING1_CURRENT_COUNTER: - case CAN_ID_STRING2_CURRENT_COUNTER: + case CANRX_STRING0_CURRENT_COUNTER_ID: /* CC status */ kpkCanShim->pTableCurrentSensor->invalidCurrentCountingMeasurement[stringNumber] = 1; break; - case CAN_ID_STRING0_ENERGY_COUNTER: /* EC status */ - case CAN_ID_STRING1_ENERGY_COUNTER: - case CAN_ID_STRING2_ENERGY_COUNTER: + case CANRX_STRING0_ENERGY_COUNTER_ID: /* EC status */ kpkCanShim->pTableCurrentSensor->invalidEnergyCountingMeasurement[stringNumber] = 1; break; default: @@ -180,8 +159,8 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->invalidEnergyCountingMeasurement[stringNumber] = 0; } - if (((diagInfo & CAN_CURRENT_SENSOR_DIAGNOSIS_ANY_MEASUREMENT_ERROR) != 0u) || - ((diagInfo & CAN_CURRENT_SENSOR_DIAGNOSIS_SYSTEM_ERROR) != 0u)) { + if (((diagInfo & CANRX_CURRENT_SENSOR_DIAGNOSIS_ANY_MEASUREMENT_ERROR_BITMASK) != 0u) || + ((diagInfo & CANRX_CURRENT_SENSOR_DIAGNOSIS_SYSTEM_ERROR_BITMASK) != 0u)) { kpkCanShim->pTableCurrentSensor->invalidCurrentMeasurement[stringNumber] = 1; kpkCanShim->pTableCurrentSensor->invalidHighVoltageMeasurement[stringNumber][0] = 1; kpkCanShim->pTableCurrentSensor->invalidHighVoltageMeasurement[stringNumber][1] = 1; @@ -194,12 +173,10 @@ extern uint32_t CAN_RxCurrentSensor( /* Get measurement */ CAN_RxGetSignalDataFromMessageData( - message, currentSensorData.bitStart, currentSensorData.bitLength, &canSignal, endianness); - switch (id) { + messageData, currentSensorData.bitStart, currentSensorData.bitLength, &canSignal, message.endianness); + switch (message.id) { /* Current measurement */ - case CAN_ID_STRING0_CURRENT: - case CAN_ID_STRING1_CURRENT: - case CAN_ID_STRING2_CURRENT: + case CANRX_STRING0_CURRENT_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->current_mA[stringNumber] = sensorSignalValue; kpkCanShim->pTableCurrentSensor->newCurrent++; @@ -208,9 +185,7 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->timestampCurrent[stringNumber] = OS_GetTickCount(); break; /* Voltage measurement U1 */ - case CAN_ID_STRING0_VOLTAGE1: - case CAN_ID_STRING1_VOLTAGE1: - case CAN_ID_STRING2_VOLTAGE1: + case CANRX_STRING0_VOLTAGE1_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->highVoltage_mV[stringNumber][0] = sensorSignalValue; kpkCanShim->pTableCurrentSensor->previousTimestampHighVoltage[stringNumber][0] = @@ -218,9 +193,7 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->timestampHighVoltage[stringNumber][0] = OS_GetTickCount(); break; /* Voltage measurement U2 */ - case CAN_ID_STRING0_VOLTAGE2: - case CAN_ID_STRING1_VOLTAGE2: - case CAN_ID_STRING2_VOLTAGE2: + case CANRX_STRING0_VOLTAGE2_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->highVoltage_mV[stringNumber][1] = sensorSignalValue; kpkCanShim->pTableCurrentSensor->previousTimestampHighVoltage[stringNumber][1] = @@ -228,9 +201,7 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->timestampHighVoltage[stringNumber][1] = OS_GetTickCount(); break; /* Voltage measurement U3 */ - case CAN_ID_STRING0_VOLTAGE3: - case CAN_ID_STRING1_VOLTAGE3: - case CAN_ID_STRING2_VOLTAGE3: + case CANRX_STRING0_VOLTAGE3_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->highVoltage_mV[stringNumber][2] = sensorSignalValue; kpkCanShim->pTableCurrentSensor->previousTimestampHighVoltage[stringNumber][2] = @@ -238,16 +209,12 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->timestampHighVoltage[stringNumber][2] = OS_GetTickCount(); break; /* Temperature measurement */ - case CAN_ID_STRING0_TEMPERATURE: - case CAN_ID_STRING1_TEMPERATURE: - case CAN_ID_STRING2_TEMPERATURE: + case CANRX_STRING0_TEMPERATURE_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->sensorTemperature_ddegC[stringNumber] = sensorSignalValue; break; /* Power measurement */ - case CAN_ID_STRING0_POWER: - case CAN_ID_STRING1_POWER: - case CAN_ID_STRING2_POWER: + case CANRX_STRING0_POWER_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->power_W[stringNumber] = sensorSignalValue; kpkCanShim->pTableCurrentSensor->newPower++; @@ -256,9 +223,7 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->timestampPower[stringNumber] = OS_GetTickCount(); break; /* CC measurement */ - case CAN_ID_STRING0_CURRENT_COUNTER: - case CAN_ID_STRING1_CURRENT_COUNTER: - case CAN_ID_STRING2_CURRENT_COUNTER: + case CANRX_STRING0_CURRENT_COUNTER_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->previousTimestampCurrentCounting[stringNumber] = kpkCanShim->pTableCurrentSensor->timestampCurrentCounting[stringNumber]; @@ -266,9 +231,7 @@ extern uint32_t CAN_RxCurrentSensor( kpkCanShim->pTableCurrentSensor->currentCounter_As[stringNumber] = sensorSignalValue; break; /* EC measurement */ - case CAN_ID_STRING0_ENERGY_COUNTER: - case CAN_ID_STRING1_ENERGY_COUNTER: - case CAN_ID_STRING2_ENERGY_COUNTER: + case CANRX_STRING0_ENERGY_COUNTER_ID: sensorSignalValue = (int32_t)canSignal; kpkCanShim->pTableCurrentSensor->energyCounter_Wh[stringNumber] = sensorSignalValue; kpkCanShim->pTableCurrentSensor->previousTimestampEnergyCounting[stringNumber] = diff --git a/src/app/driver/can/cbs/can_cbs_rx_imd.c b/src/app/driver/can/cbs/rx/can_cbs_rx_imd.c similarity index 78% rename from src/app/driver/can/cbs/can_cbs_rx_imd.c rename to src/app/driver/can/cbs/rx/can_cbs_rx_imd.c index a30a0249..8eec2a18 100644 --- a/src/app/driver/can/cbs/can_cbs_rx_imd.c +++ b/src/app/driver/can/cbs/rx/can_cbs_rx_imd.c @@ -43,17 +43,18 @@ * @file can_cbs_rx_imd.c * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANRX * * @brief CAN driver Rx callback implementation * @details CAN Rx callback for IMD messages */ /*========== Includes =======================================================*/ -#include "can_cbs.h" +#include "can_cbs_rx.h" +#include "can_cfg_rx-message-definitions.h" #include "can_helper.h" #include "foxmath.h" @@ -68,24 +69,21 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_RxImdInfo( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_ImdInfo( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { /* This handler is only implemented for little endian */ - FAS_ASSERT(endianness == CAN_LITTLE_ENDIAN); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ - const uint8_t boundedDlc = MATH_MinimumOfTwoUint8_t(dlc, CAN_MAX_DLC); + FAS_ASSERT(message.endianness == CAN_LITTLE_ENDIAN); + FAS_ASSERT(message.id == CANRX_IMD_INFO_ID); + FAS_ASSERT(message.dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - CAN_BUFFERELEMENT_s canMessage = {0}; - uint32_t retVal = 1u; + CAN_BUFFER_ELEMENT_s canMessage = {0}; + uint32_t retVal = 1u; + const uint8_t boundedDlc = MATH_MinimumOfTwoUint8_t(message.dlc, CAN_MAX_DLC); - canMessage.id = id; + canMessage.id = message.id; for (uint8_t i = 0; i < boundedDlc; i++) { canMessage.data[i] = kpkCanData[i]; } @@ -95,25 +93,23 @@ extern uint32_t CAN_RxImdInfo( return retVal; } -extern uint32_t CAN_RxImdResponse( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_ImdResponse( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { /* This handler is only implemented for little endian */ - FAS_ASSERT(endianness == CAN_LITTLE_ENDIAN); - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.endianness == CAN_LITTLE_ENDIAN); + FAS_ASSERT(message.id == CANRX_IMD_RESPONSE_ID); + FAS_ASSERT(message.dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - const uint8_t boundedDlc = MATH_MinimumOfTwoUint8_t(dlc, CAN_MAX_DLC); + const uint8_t boundedDlc = MATH_MinimumOfTwoUint8_t(message.dlc, CAN_MAX_DLC); - CAN_BUFFERELEMENT_s canMessage = {0}; - uint32_t retVal = 1u; + CAN_BUFFER_ELEMENT_s canMessage = {0}; + uint32_t retVal = 1u; - canMessage.id = id; + canMessage.id = message.id; for (uint8_t i = 0; i < boundedDlc; i++) { canMessage.data[i] = kpkCanData[i]; } diff --git a/src/app/driver/can/cbs/can_cbs_rx_misc.c b/src/app/driver/can/cbs/rx/can_cbs_rx_misc.c similarity index 77% rename from src/app/driver/can/cbs/can_cbs_rx_misc.c rename to src/app/driver/can/cbs/rx/can_cbs_rx_misc.c index 294e5729..7fdb62c8 100644 --- a/src/app/driver/can/cbs/can_cbs_rx_misc.c +++ b/src/app/driver/can/cbs/rx/can_cbs_rx_misc.c @@ -43,17 +43,18 @@ * @file can_cbs_rx_misc.c * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANRX * * @brief CAN driver Rx callback implementation * @details CAN Rx callback for miscellanous messages */ /*========== Includes =======================================================*/ -#include "can_cbs.h" +#include "can_cbs_rx.h" +#include "can_cfg_rx-message-definitions.h" #include "can_helper.h" #include "diag.h" @@ -68,41 +69,36 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_RxSwReset( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_SoftwareReset( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { /* This handler is only implemented for little endian */ - FAS_ASSERT(endianness == CAN_LITTLE_ENDIAN); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.endianness == CAN_LITTLE_ENDIAN); + FAS_ASSERT(message.id == CANRX_SOFTWARE_RESET_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); return 0; } -extern uint32_t CAN_RxDebug( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_Debug( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANRX_DEBUG_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; - uint64_t signalData = 0; + uint64_t messageData = 0u; + uint64_t signalData = 0; - CAN_RxGetMessageDataFromCanData(&message, kpkCanData, endianness); + CAN_RxGetMessageDataFromCanData(&messageData, kpkCanData, message.endianness); uint64_t bitStart = 0; uint8_t bitLength = 8; - CAN_RxGetSignalDataFromMessageData(message, bitStart, bitLength, &signalData, endianness); + CAN_RxGetSignalDataFromMessageData(messageData, bitStart, bitLength, &signalData, message.endianness); switch ((uint8_t)signalData) { case 0xAA: @@ -117,17 +113,14 @@ extern uint32_t CAN_RxDebug( return 0; } -extern uint32_t CAN_RxSwVersion( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_SoftwareVersion( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { /* This handler is only implemented for little endian */ - FAS_ASSERT(endianness == CAN_LITTLE_ENDIAN); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.endianness == CAN_LITTLE_ENDIAN); + FAS_ASSERT(message.id == CANRX_SOFTWARE_VERSION_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); return 0; diff --git a/src/app/driver/can/cbs/can_cbs_rx_command.c b/src/app/driver/can/cbs/rx/can_cbs_rx_state-request.c similarity index 81% rename from src/app/driver/can/cbs/can_cbs_rx_command.c rename to src/app/driver/can/cbs/rx/can_cbs_rx_state-request.c index 97b0fc15..f6931395 100644 --- a/src/app/driver/can/cbs/can_cbs_rx_command.c +++ b/src/app/driver/can/cbs/rx/can_cbs_rx_state-request.c @@ -40,13 +40,13 @@ */ /** - * @file can_cbs_rx_command.c + * @file can_cbs_rx_state-request.c * @author foxBMS Team * @date 2021-07-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANRX * * @brief CAN driver Rx callback implementation * @details CAN Rx callback for command message @@ -56,7 +56,8 @@ #include "bms_cfg.h" #include "bal.h" -#include "can_cbs.h" +#include "can_cbs_rx.h" +#include "can_cfg_rx-message-definitions.h" #include "can_helper.h" #include "diag.h" #include "os.h" @@ -72,7 +73,7 @@ * - The new request is different than the old request. * - The old request is older than the timespan set in this define. */ -#define CAN_CAN_REQUEST_UPDATE_TIME_ms (3000u) +#define CANRX_CAN_REQUEST_UPDATE_TIME_ms (3000u) /*========== Static Constant and Variable Definitions =======================*/ @@ -87,29 +88,29 @@ * - sys mon violation flags * @param[in] signalData if it is 1u, flags are cleared */ -static void CAN_ClearAllPersistentFlags(uint64_t signalData); +static void CANRX_ClearAllPersistentFlags(uint64_t signalData); /** * @brief handles the mode request * @param[in] signalData extracted signal data * @param[in,out] kpkCanShim can shim with database entries */ -static void CAN_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const kpkCanShim); +static void CANRX_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const kpkCanShim); /** * @brief handles the balancing request * @param[in] signalData extracted signal data */ -static void CAN_HandleBalancingRequest(uint64_t signalData); +static void CANRX_HandleBalancingRequest(uint64_t signalData); /** * @brief sets the balancing threshold * @param[in] signalData extracted signal data */ -static void CAN_SetBalancingThreshold(uint64_t signalData); +static void CANRX_SetBalancingThreshold(uint64_t signalData); /*========== Static Function Implementations ================================*/ -static void CAN_ClearAllPersistentFlags(uint64_t signalData) { +static void CANRX_ClearAllPersistentFlags(uint64_t signalData) { /* AXIVION Routine Generic-MissingParameterAssert: signalData: parameter accepts whole range */ if (signalData == 1u) { /* clear deep discharge */ @@ -121,7 +122,7 @@ static void CAN_ClearAllPersistentFlags(uint64_t signalData) { } } -static void CAN_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const kpkCanShim) { +static void CANRX_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const kpkCanShim) { FAS_ASSERT(kpkCanShim != NULL_PTR); /* AXIVION Routine Generic-MissingParameterAssert: signalData: parameter accepts whole range */ @@ -149,7 +150,7 @@ static void CAN_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const k kpkCanShim->pTableStateRequest->stateRequestViaCan = stateRequest; if ((kpkCanShim->pTableStateRequest->stateRequestViaCan != kpkCanShim->pTableStateRequest->previousStateRequestViaCan) || - (OS_CheckTimeHasPassed(kpkCanShim->pTableStateRequest->header.timestamp, CAN_CAN_REQUEST_UPDATE_TIME_ms))) { + (OS_CheckTimeHasPassed(kpkCanShim->pTableStateRequest->header.timestamp, CANRX_CAN_REQUEST_UPDATE_TIME_ms))) { kpkCanShim->pTableStateRequest->stateRequestViaCanPending = stateRequest; } if (kpkCanShim->pTableStateRequest->stateCounter == (uint8_t)UINT8_MAX) { @@ -160,7 +161,7 @@ static void CAN_HandleModeRequest(uint64_t signalData, const CAN_SHIM_s *const k } } -static void CAN_HandleBalancingRequest(uint64_t signalData) { +static void CANRX_HandleBalancingRequest(uint64_t signalData) { /* AXIVION Routine Generic-MissingParameterAssert: signalData: parameter accepts whole range */ /* AXIVION Next Codeline Style MisraC2012-2.2 MisraC2012-14.3: Depending on implementation STD_NOT_OK might be returned. */ if (BAL_GetInitializationState() == STD_OK) { @@ -172,7 +173,7 @@ static void CAN_HandleBalancingRequest(uint64_t signalData) { } } -static void CAN_SetBalancingThreshold(uint64_t signalData) { +static void CANRX_SetBalancingThreshold(uint64_t signalData) { /* cap signal data to UINT16_MAX */ int32_t cappedSignalData = (int32_t)signalData; if (signalData > (uint64_t)UINT16_MAX) { @@ -182,42 +183,40 @@ static void CAN_SetBalancingThreshold(uint64_t signalData) { } /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_RxRequest( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANRX_BmsStateRequest( + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANRX_BMS_STATE_REQUEST_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(kpkCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); DATA_READ_DATA(kpkCanShim->pTableStateRequest); - uint64_t message = 0; - CAN_RxGetMessageDataFromCanData(&message, kpkCanData, endianness); + uint64_t messageData = 0u; + CAN_RxGetMessageDataFromCanData(&messageData, kpkCanData, message.endianness); uint64_t signalData = 0; /* Get mode request */ /* AXIVION Next Codeline Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - CAN_RxGetSignalDataFromMessageData(message, 1u, 2u, &signalData, endianness); - CAN_HandleModeRequest(signalData, kpkCanShim); + CAN_RxGetSignalDataFromMessageData(messageData, 1u, 2u, &signalData, message.endianness); + CANRX_HandleModeRequest(signalData, kpkCanShim); /* check for reset flag */ /* AXIVION Next Codeline Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - CAN_RxGetSignalDataFromMessageData(message, 2u, 1u, &signalData, endianness); - CAN_ClearAllPersistentFlags(signalData); + CAN_RxGetSignalDataFromMessageData(messageData, 2u, 1u, &signalData, message.endianness); + CANRX_ClearAllPersistentFlags(signalData); /* Get balancing request */ /* AXIVION Next Codeline Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - CAN_RxGetSignalDataFromMessageData(message, 8u, 1u, &signalData, endianness); - CAN_HandleBalancingRequest(signalData); + CAN_RxGetSignalDataFromMessageData(messageData, 8u, 1u, &signalData, message.endianness); + CANRX_HandleBalancingRequest(signalData); /* Get balancing threshold */ /* AXIVION Next Codeline Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - CAN_RxGetSignalDataFromMessageData(message, 23u, 8u, &signalData, endianness); - CAN_SetBalancingThreshold(signalData); + CAN_RxGetSignalDataFromMessageData(messageData, 23u, 8u, &signalData, message.endianness); + CANRX_SetBalancingThreshold(signalData); /* TODO: Implement missing signals */ diff --git a/src/app/driver/can/cbs/can_cbs.h b/src/app/driver/can/cbs/tx/can_cbs_tx.h similarity index 51% rename from src/app/driver/can/cbs/can_cbs.h rename to src/app/driver/can/cbs/tx/can_cbs_tx.h index dddcfa9a..974f302e 100644 --- a/src/app/driver/can/cbs/can_cbs.h +++ b/src/app/driver/can/cbs/tx/can_cbs_tx.h @@ -40,20 +40,20 @@ */ /** - * @file can_cbs.h + * @file can_cbs_tx.h * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN callbacks header * */ -#ifndef FOXBMS__CAN_CBS_H_ -#define FOXBMS__CAN_CBS_H_ +#ifndef FOXBMS__CAN_CBS_TX_H_ +#define FOXBMS__CAN_CBS_TX_H_ /*========== Includes =======================================================*/ #include "general.h" @@ -68,318 +68,165 @@ /** TX callback functions @{ */ /** * @brief can tx callback function for state - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxState( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_BmsState( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for detail state - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxDetailState( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_BmsStateDetails( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for cell voltages - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxVoltage( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_CellVoltages( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for cell temperatures - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxCellTemperature( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_CellTemperatures( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for limit values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxLimitValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_LimitValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for min/max values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxMinimumMaximumValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_MinimumMaximumValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for state estimation values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxStateEstimation( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_PackStateEstimation( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for pack values values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxPackValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_PackValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for string state values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxStringState( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringState( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for string values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxStringValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringValuesP0( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for string minimum and maximum values - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxStringMinimumMaximumValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringMinimumMaximumValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for string state estimation - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxStringStateEstimation( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringStateEstimation( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** * @brief can tx callback function for string values 2 - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian + * @param[in] message contains the message ID, DLC and endianness * @param[in] pCanData payload of can frame * @param[in] pMuxId multiplexer for multiplexed CAN messages * @param[in] kpkCanShim shim to the database entries */ -extern uint32_t CAN_TxStringValues2( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringValuesP1( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** @} */ -/** RX callback functions @{ */ -/** - * @brief can rx callback function for IMD info messages - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxImdInfo( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** - * @brief can rx callback function for IMD response messages - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxImdResponse( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** - * @brief can rx callback function for state requests - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxRequest( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** - * @brief can rx callback function for SW reset - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxSwReset( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** - * @brief can rx callback function for current sensor measurements - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxCurrentSensor( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** - * @brief can rx callback function for debug messages - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxDebug( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** - * @brief can rx callback function for SW version - * @param[in] id CAN ID - * @param[in] dlc CAN Data Length Code - * @param[in] endianness big or little endian - * @param[in] kpkCanData payload of can frame - * @param[in] kpkCanShim shim to the database entries - */ -extern uint32_t CAN_RxSwVersion( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - const uint8_t *const kpkCanData, - const CAN_SHIM_s *const kpkCanShim); -/** @} */ - /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ #ifdef UNITY_UNIT_TEST #endif -#endif /* FOXBMS__CAN_CBS_H_ */ +#endif /* FOXBMS__CAN_CBS_TX_H_ */ diff --git a/src/app/driver/can/cbs/can_cbs_tx_temperature.c b/src/app/driver/can/cbs/tx/can_cbs_tx_cell-temperatures.c similarity index 68% rename from src/app/driver/can/cbs/can_cbs_tx_temperature.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_cell-temperatures.c index d71372ad..c10154d5 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_temperature.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_cell-temperatures.c @@ -40,20 +40,21 @@ */ /** - * @file can_cbs_tx_temperature.c + * @file can_cbs_tx_cell-temperatures.c * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for cell temperatures */ /*========== Includes =======================================================*/ -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" #include "foxmath.h" @@ -66,28 +67,28 @@ * Parameters: * bit start, bit length, factor, offset, minimum value, maximum value */ -static const CAN_SIGNAL_TYPE_s can_cellTemperatureMultiplexer = {7u, 8u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell0TemperatureInvalidFlag = {8u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell1TemperatureInvalidFlag = {9u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell2TemperatureInvalidFlag = {10u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell3TemperatureInvalidFlag = {11u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell4TemperatureInvalidFlag = {12u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell5TemperatureInvalidFlag = {13u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cell0Temperature_degC = {23u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; -static const CAN_SIGNAL_TYPE_s can_cell1Temperature_degC = {31u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; -static const CAN_SIGNAL_TYPE_s can_cell2Temperature_degC = {39u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; -static const CAN_SIGNAL_TYPE_s can_cell3Temperature_degC = {47u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; -static const CAN_SIGNAL_TYPE_s can_cell4Temperature_degC = {55u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; -static const CAN_SIGNAL_TYPE_s can_cell5Temperature_degC = {63u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellTemperatureMultiplexer = {7u, 8u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell0TemperatureInvalidFlag = {8u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell1TemperatureInvalidFlag = {9u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell2TemperatureInvalidFlag = {10u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell3TemperatureInvalidFlag = {11u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell4TemperatureInvalidFlag = {12u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell5TemperatureInvalidFlag = {13u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell0Temperature_degC = {23u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell1Temperature_degC = {31u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell2Temperature_degC = {39u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell3Temperature_degC = {47u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell4Temperature_degC = {55u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cell5Temperature_degC = {63u, 8u, 1.0f, 0.0f, -128.0f, 127.0f}; /*========== Extern Constant and Variable Definitions =======================*/ /*========== Static Function Prototypes =====================================*/ /** - * @brief Helper function for CAN_TxCellTemperature() + * @brief Helper function for CANTX_CellTemperatures() * - * Used in the CAN_TxCellTemperature() callback to set + * Used in the CANTX_CellTemperatures() callback to set * invalid flag data and temperature data * in the CAN frame. * @@ -98,7 +99,7 @@ static const CAN_SIGNAL_TYPE_s can_cell5Temperature_degC = {63u, 8u, 1.0f, * @param[in] endianness big or little endianness of data * @param[in] kpkCanShim shim to the database entries */ -static void CAN_TxTemperatureSetData( +static void CANTX_TemperatureSetData( uint8_t muxId, uint64_t *pMessage, CAN_SIGNAL_TYPE_s cellTemperatureSignal, @@ -108,7 +109,7 @@ static void CAN_TxTemperatureSetData( /*========== Static Function Implementations ================================*/ -static void CAN_TxTemperatureSetData( +static void CANTX_TemperatureSetData( uint8_t muxId, uint64_t *pMessage, CAN_SIGNAL_TYPE_s cellTemperatureSignal, @@ -125,7 +126,6 @@ static void CAN_TxTemperatureSetData( */ /* start_index end_index string * 000 071 string0 - * 072 143 string1 */ /* Get string, module and cell number */ @@ -167,19 +167,17 @@ static void CAN_TxTemperatureSetData( } /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxCellTemperature( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_CellTemperatures( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_CELL_TEMPERATURES_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(pMuxId != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; /* Reset mux if maximum was reached */ if (*pMuxId >= BS_NR_OF_TEMP_SENSORS) { @@ -194,41 +192,71 @@ extern uint32_t CAN_TxCellTemperature( /* Set mux signal in CAN frame */ uint32_t signalData = *pMuxId / 6u; /* 6 temperatures per module */ CAN_TxSetMessageDataWithSignalData( - &message, - can_cellTemperatureMultiplexer.bitStart, - can_cellTemperatureMultiplexer.bitLength, + &messageData, + cantx_cellTemperatureMultiplexer.bitStart, + cantx_cellTemperatureMultiplexer.bitLength, signalData, - endianness); + message.endianness); /* Set other signals in CAN frame */ /* Each temperature frame contains 6 temperatures, with a correspond invalid flag*/ - CAN_TxTemperatureSetData( - *pMuxId, &message, can_cell0Temperature_degC, can_cell0TemperatureInvalidFlag, endianness, kpkCanShim); + CANTX_TemperatureSetData( + *pMuxId, + &messageData, + cantx_cell0Temperature_degC, + cantx_cell0TemperatureInvalidFlag, + message.endianness, + kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxTemperatureSetData( - *pMuxId, &message, can_cell1Temperature_degC, can_cell1TemperatureInvalidFlag, endianness, kpkCanShim); + CANTX_TemperatureSetData( + *pMuxId, + &messageData, + cantx_cell1Temperature_degC, + cantx_cell1TemperatureInvalidFlag, + message.endianness, + kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxTemperatureSetData( - *pMuxId, &message, can_cell2Temperature_degC, can_cell2TemperatureInvalidFlag, endianness, kpkCanShim); + CANTX_TemperatureSetData( + *pMuxId, + &messageData, + cantx_cell2Temperature_degC, + cantx_cell2TemperatureInvalidFlag, + message.endianness, + kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxTemperatureSetData( - *pMuxId, &message, can_cell3Temperature_degC, can_cell3TemperatureInvalidFlag, endianness, kpkCanShim); + CANTX_TemperatureSetData( + *pMuxId, + &messageData, + cantx_cell3Temperature_degC, + cantx_cell3TemperatureInvalidFlag, + message.endianness, + kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxTemperatureSetData( - *pMuxId, &message, can_cell4Temperature_degC, can_cell4TemperatureInvalidFlag, endianness, kpkCanShim); + CANTX_TemperatureSetData( + *pMuxId, + &messageData, + cantx_cell4Temperature_degC, + cantx_cell4TemperatureInvalidFlag, + message.endianness, + kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxTemperatureSetData( - *pMuxId, &message, can_cell5Temperature_degC, can_cell5TemperatureInvalidFlag, endianness, kpkCanShim); + CANTX_TemperatureSetData( + *pMuxId, + &messageData, + cantx_cell5Temperature_degC, + cantx_cell5TemperatureInvalidFlag, + message.endianness, + kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; /* All signal data copied in CAN frame, now copy data in the buffer that will be use to send the frame */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } diff --git a/src/app/driver/can/cbs/can_cbs_tx_voltage.c b/src/app/driver/can/cbs/tx/can_cbs_tx_cell-voltages.c similarity index 73% rename from src/app/driver/can/cbs/can_cbs_tx_voltage.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_cell-voltages.c index 5f4a6609..9ebc7f6e 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_voltage.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_cell-voltages.c @@ -40,50 +40,51 @@ */ /** - * @file can_cbs_tx_voltage.c + * @file can_cbs_tx_cell-voltages.c * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for cell voltages */ /*========== Includes =======================================================*/ -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" /*========== Macros and Definitions =========================================*/ /*========== Static Constant and Variable Definitions =======================*/ /** the number of voltages per message-frame */ -#define NUMBER_OF_MUX_VOLTAGES_PER_MESSAGE (4u) +#define CANTX_NUMBER_OF_MUX_VOLTAGES_PER_MESSAGE (4u) /** * CAN signals used in this message * Parameters: * bit start, bit length, factor, offset, minimum value, maximum value */ -static const CAN_SIGNAL_TYPE_s can_cellVoltageMultiplexer = {7u, 8u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage0InvalidFlag = {12u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage1InvalidFlag = {13u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage2InvalidFlag = {14u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage3InvalidFlag = {15u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage0_mV = {11u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage1_mV = {30u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage2_mV = {33u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; -static const CAN_SIGNAL_TYPE_s can_cellVoltage3_mV = {52u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltageMultiplexer = {7u, 8u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage0InvalidFlag = {12u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage1InvalidFlag = {13u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage2InvalidFlag = {14u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage3InvalidFlag = {15u, 1u, 1.0f, 0.0f, 0.0f, 1.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage0_mV = {11u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage1_mV = {30u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage2_mV = {33u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; +static const CAN_SIGNAL_TYPE_s cantx_cellVoltage3_mV = {52u, 13u, 1.0f, 0.0f, 0.0f, 8192.0f}; /*========== Extern Constant and Variable Definitions =======================*/ /*========== Static Function Prototypes =====================================*/ /** - * @brief Helper function for CAN_TxVoltage() + * @brief Helper function for CANTX_CellVoltages() * - * Used in the CAN_TxVoltage() callback to set + * Used in the CANTX_CellVoltages() callback to set * invalid flag data and voltage data * in the CAN frame. * @@ -94,7 +95,7 @@ static const CAN_SIGNAL_TYPE_s can_cellVoltage3_mV = {52u, 13u, 1.0f, 0. * @param[in] endianness big or little endianness of data * @param[in] kpkCanShim shim to the database entries */ -static void CAN_TxVoltageSetData( +static void CANTX_VoltageSetData( uint8_t muxId, uint64_t *pMessage, CAN_SIGNAL_TYPE_s cellVoltageSignal, @@ -104,7 +105,7 @@ static void CAN_TxVoltageSetData( /*========== Static Function Implementations ================================*/ -static void CAN_TxVoltageSetData( +static void CANTX_VoltageSetData( uint8_t muxId, uint64_t *pMessage, CAN_SIGNAL_TYPE_s cellVoltageSignal, @@ -147,19 +148,17 @@ static void CAN_TxVoltageSetData( } /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxVoltage( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_CellVoltages( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_CELL_VOLTAGES_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(pMuxId != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; /* Reset mux if maximum was reached */ if (*pMuxId >= (BS_NR_OF_STRINGS * BS_NR_OF_CELL_BLOCKS_PER_STRING)) { @@ -171,30 +170,34 @@ extern uint32_t CAN_TxVoltage( } /* Set mux signal in CAN frame */ - uint32_t signalData = *pMuxId / NUMBER_OF_MUX_VOLTAGES_PER_MESSAGE; + uint32_t signalData = *pMuxId / CANTX_NUMBER_OF_MUX_VOLTAGES_PER_MESSAGE; CAN_TxSetMessageDataWithSignalData( - &message, - can_cellVoltageMultiplexer.bitStart, - can_cellVoltageMultiplexer.bitLength, + &messageData, + cantx_cellVoltageMultiplexer.bitStart, + cantx_cellVoltageMultiplexer.bitLength, (uint32_t)signalData, - endianness); + message.endianness); /* Set other signals in CAN frame */ - CAN_TxVoltageSetData(*pMuxId, &message, can_cellVoltage0_mV, can_cellVoltage0InvalidFlag, endianness, kpkCanShim); + CANTX_VoltageSetData( + *pMuxId, &messageData, cantx_cellVoltage0_mV, cantx_cellVoltage0InvalidFlag, message.endianness, kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxVoltageSetData(*pMuxId, &message, can_cellVoltage1_mV, can_cellVoltage1InvalidFlag, endianness, kpkCanShim); + CANTX_VoltageSetData( + *pMuxId, &messageData, cantx_cellVoltage1_mV, cantx_cellVoltage1InvalidFlag, message.endianness, kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxVoltageSetData(*pMuxId, &message, can_cellVoltage2_mV, can_cellVoltage2InvalidFlag, endianness, kpkCanShim); + CANTX_VoltageSetData( + *pMuxId, &messageData, cantx_cellVoltage2_mV, cantx_cellVoltage2InvalidFlag, message.endianness, kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; - CAN_TxVoltageSetData(*pMuxId, &message, can_cellVoltage3_mV, can_cellVoltage3InvalidFlag, endianness, kpkCanShim); + CANTX_VoltageSetData( + *pMuxId, &messageData, cantx_cellVoltage3_mV, cantx_cellVoltage3InvalidFlag, message.endianness, kpkCanShim); /* Increment multiplexer for next cell */ (*pMuxId)++; /* All signal data copied in CAN frame, now copy data in the buffer that will be use to send the frame */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } diff --git a/src/app/driver/can/cbs/can_cbs_tx_limits.c b/src/app/driver/can/cbs/tx/can_cbs_tx_limit-values.c similarity index 85% rename from src/app/driver/can/cbs/can_cbs_tx_limits.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_limit-values.c index 8d536ef9..4ee92260 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_limits.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_limit-values.c @@ -40,13 +40,13 @@ */ /** - * @file can_cbs_tx_limits.c + * @file can_cbs_tx_limit-values.c * @author foxBMS Team * @date 2021-07-21 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for state messages @@ -55,7 +55,8 @@ /*========== Includes =======================================================*/ #include "battery_cell_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" /*========== Macros and Definitions =========================================*/ @@ -69,21 +70,18 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxLimitValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_LimitValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { /* pMuxId is not used here, therefore has to be NULL_PTR */ FAS_ASSERT(pMuxId == NULL_PTR); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_LIMIT_VALUES_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; DATA_READ_DATA(kpkCanShim->pTableSof); @@ -95,7 +93,7 @@ extern uint32_t CAN_TxLimitValues( signalData = (signalData + offset) * factor; uint64_t data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 11u, 12u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 11u, 12u, data, message.endianness); /* maximum discharge current */ signalData = (float)kpkCanShim->pTableSof->recommendedContinuousPackDischargeCurrent_mA; @@ -104,7 +102,7 @@ extern uint32_t CAN_TxLimitValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 12u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 12u, data, message.endianness); /* TODO: maximum charge power */ /* TODO: maximum discharge power */ @@ -116,7 +114,7 @@ extern uint32_t CAN_TxLimitValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 63u, 8u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 63u, 8u, data, message.endianness); /* maximum pack voltage */ signalData = (float)(BS_NR_OF_CELL_BLOCKS_PER_STRING * BC_VOLTAGE_MAX_MSL_mV); @@ -125,11 +123,11 @@ extern uint32_t CAN_TxLimitValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 55u, 8u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 55u, 8u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } diff --git a/src/app/driver/can/cbs/can_cbs_tx_minmax.c b/src/app/driver/can/cbs/tx/can_cbs_tx_minimum-maximum-values.c similarity index 84% rename from src/app/driver/can/cbs/can_cbs_tx_minmax.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_minimum-maximum-values.c index 59284811..ed657dd2 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_minmax.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_minimum-maximum-values.c @@ -40,13 +40,13 @@ */ /** - * @file can_cbs_tx_minmax.c + * @file can_cbs_tx_minimum-maximum-values.c * @author foxBMS Team * @date 2021-04-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for min/max values @@ -54,7 +54,8 @@ /*========== Includes =======================================================*/ #include "bms.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" /*========== Macros and Definitions =========================================*/ @@ -68,21 +69,17 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxMinimumMaximumValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_MinimumMaximumValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - /* pMuxId is not used here, therefore has to be NULL_PTR */ - FAS_ASSERT(pMuxId == NULL_PTR); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_MINIMUM_MAXIMUM_VALUES_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); + FAS_ASSERT(pMuxId == NULL_PTR); /* pMuxId is not used here, therefore has to be NULL_PTR */ FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; DATA_READ_DATA(kpkCanShim->pTableMinMax); @@ -135,7 +132,7 @@ extern uint32_t CAN_TxMinimumMaximumValues( signalData = (signalData + offset) * factor; uint64_t data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 10u, 13u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 10u, 13u, data, message.endianness); /* Maximum cell voltage */ signalData = (float)packMaximumVoltage_mV; @@ -144,7 +141,7 @@ extern uint32_t CAN_TxMinimumMaximumValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 13u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 13u, data, message.endianness); /* Minimum cell temperature */ signalData = (float)packMinimumTemperature_ddegC; @@ -153,7 +150,7 @@ extern uint32_t CAN_TxMinimumMaximumValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 63u, 8u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 63u, 8u, data, message.endianness); /* Maximum cell temperature */ signalData = (float)packMaximumTemperature_ddegC; @@ -162,33 +159,31 @@ extern uint32_t CAN_TxMinimumMaximumValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 55u, 8u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 55u, 8u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } -extern uint32_t CAN_TxStringMinimumMaximumValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringMinimumMaximumValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_STRING_MIN_MAX_VALUES_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(pMuxId != NULL_PTR); FAS_ASSERT(*pMuxId < BS_NR_OF_STRINGS); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0u; + uint64_t messageData = 0u; /** Database entry with minimum and maximum values does not need to be read * within this callback as it is already read by function - * #CAN_TxMinimumMaximumValues */ + * #CANTX_MinimumMaximumValues */ const uint8_t stringNumber = *pMuxId; /* AXIVION Disable Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ @@ -199,7 +194,7 @@ extern uint32_t CAN_TxStringMinimumMaximumValues( signalData = (signalData + offset) * factor; uint64_t data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 18u, 13u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 18u, 13u, data, message.endianness); /* Maximum cell voltage */ signalData = (float)kpkCanShim->pTableMinMax->maximumCellVoltage_mV[stringNumber]; @@ -208,7 +203,7 @@ extern uint32_t CAN_TxStringMinimumMaximumValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 15u, 13u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 15u, 13u, data, message.endianness); /* Minimum cell temperature */ signalData = (float)kpkCanShim->pTableMinMax->minimumTemperature_ddegC[stringNumber]; @@ -217,7 +212,7 @@ extern uint32_t CAN_TxStringMinimumMaximumValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 44u, 9u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 44u, 9u, data, message.endianness); /* Maximum cell temperature */ signalData = (float)kpkCanShim->pTableMinMax->maximumTemperature_ddegC[stringNumber]; @@ -226,11 +221,11 @@ extern uint32_t CAN_TxStringMinimumMaximumValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 37, 9u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 37, 9u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be use to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); /* Increment multiplexer for next cell */ (*pMuxId)++; diff --git a/src/app/driver/can/cbs/can_cbs_tx_state_estimation.c b/src/app/driver/can/cbs/tx/can_cbs_tx_pack-state-estimation.c similarity index 60% rename from src/app/driver/can/cbs/can_cbs_tx_state_estimation.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_pack-state-estimation.c index 4a3b674c..a1fa9e59 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_state_estimation.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_pack-state-estimation.c @@ -40,13 +40,13 @@ */ /** - * @file can_cbs_tx_state_estimation.c + * @file can_cbs_tx_pack-state-estimation.c * @author foxBMS Team * @date 2021-07-21 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for state estimation messages @@ -54,7 +54,8 @@ /*========== Includes =======================================================*/ #include "bms.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" #include "foxmath.h" @@ -69,21 +70,17 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxStateEstimation( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_PackStateEstimation( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - /* pMuxId is not used here, therefore has to be NULL_PTR */ - FAS_ASSERT(pMuxId == NULL_PTR); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_PACK_STATE_ESTIMATION_ID); + FAS_ASSERT(message.dlc <= CAN_MAX_DLC); FAS_ASSERT(pCanData != NULL_PTR); + FAS_ASSERT(pMuxId == NULL_PTR); /* pMuxId is not used here, therefore has to be NULL_PTR */ FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; float minimumStringSoc_perc = FLT_MAX; float maximumStringSoc_perc = FLT_MIN; @@ -153,7 +150,7 @@ extern uint32_t CAN_TxStateEstimation( signalData = (signalData + offset) * factor; uint64_t data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 14u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 14u, data, message.endianness); /* SOE */ signalData = packSoe_perc; @@ -162,7 +159,7 @@ extern uint32_t CAN_TxStateEstimation( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 9u, 14u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 9u, 14u, data, message.endianness); /* Pack energy */ signalData = packEnergyLeft_Wh; @@ -171,7 +168,7 @@ extern uint32_t CAN_TxStateEstimation( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 47u, 24u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 47u, 24u, data, message.endianness); /* SOH */ signalData = 100.0f; /* TODO */ @@ -180,108 +177,10 @@ extern uint32_t CAN_TxStateEstimation( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 27u, 12u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 27u, 12u, data, message.endianness); /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); - - return 0; -} - -extern uint32_t CAN_TxStringStateEstimation( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, - uint8_t *pCanData, - uint8_t *pMuxId, - const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ - FAS_ASSERT(pCanData != NULL_PTR); - FAS_ASSERT(pMuxId != NULL_PTR); - FAS_ASSERT(*pMuxId < BS_NR_OF_STRINGS); - FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; - - /** Database entry with state estimation values does not need to be read - * within this callback as it is already read by function - * #CAN_TxStateEstimation */ - const uint8_t stringNumber = *pMuxId; - - /* set multiplexer in CAN frame */ - /* AXIVION Disable Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - uint64_t data = (uint64_t)stringNumber; - CAN_TxSetMessageDataWithSignalData(&message, 7u, 4u, data, endianness); - - /* Minimum SOC */ - float signalData = kpkCanShim->pTableSox->minimumSoc_perc[stringNumber]; - float offset = 0.0f; - float factor = 4.0f; /* convert from perc to 0.25perc */ - signalData = (signalData + offset) * factor; - data = (int64_t)signalData; - /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 3u, 9u, data, endianness); - - /* Average SOC */ - signalData = kpkCanShim->pTableSox->averageSoc_perc[stringNumber]; - offset = 0.0f; - factor = 4.0f; /* convert from perc to 0.25perc */ - signalData = (signalData + offset) * factor; - data = (int64_t)signalData; - /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 10u, 9u, data, endianness); - - /* Maximum SOC */ - signalData = kpkCanShim->pTableSox->maximumSoc_perc[stringNumber]; - offset = 0.0f; - factor = 4.0f; /* convert from perc to 0.25perc */ - signalData = (signalData + offset) * factor; - data = (int64_t)signalData; - /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 17u, 9u, data, endianness); - - /* SOE */ - if (BMS_CHARGING == BMS_GetCurrentFlowDirection(kpkCanShim->pTablePackValues->stringCurrent_mA[stringNumber])) { - signalData = kpkCanShim->pTableSox->maximumSoe_perc[stringNumber]; - } else { - signalData = kpkCanShim->pTableSox->minimumSoe_perc[stringNumber]; - } - offset = 0.0f; - factor = 4.0f; /* convert from perc to 0.25perc */ - signalData = (signalData + offset) * factor; - data = (int64_t)signalData; - /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 24u, 9u, data, endianness); - - /* SOH */ - signalData = 100.0f; - offset = 0.0f; - factor = 4.0f; /* convert from perc to 0.25perc */ - signalData = (signalData + offset) * factor; - data = (int64_t)signalData; - /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 47u, 9u, data, endianness); - - /* String energy */ - signalData = kpkCanShim->pTableSox->minimumSoe_Wh[stringNumber]; - offset = 0.0f; - factor = 0.1f; /* convert from Wh to 10Wh */ - signalData = (signalData + offset) * factor; - data = (int64_t)signalData; - /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 54u, 15u, data, endianness); - /* AXIVION Enable Style Generic-NoMagicNumbers: */ - - /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); - - /* Increment multiplexer for next cell */ - (*pMuxId)++; - - /* Check mux value */ - if (*pMuxId >= BS_NR_OF_STRINGS) { - *pMuxId = 0u; - } + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } diff --git a/src/app/driver/can/cbs/can_cbs_tx_state.c b/src/app/driver/can/cbs/tx/can_cbs_tx_state.c similarity index 67% rename from src/app/driver/can/cbs/can_cbs_tx_state.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_state.c index 2357e9f5..34ed11f9 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_state.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_state.c @@ -43,10 +43,10 @@ * @file can_cbs_tx_state.c * @author foxBMS Team * @date 2021-07-21 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for state messages @@ -54,7 +54,8 @@ /*========== Includes =======================================================*/ #include "bms.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" #include "diag.h" #include "sys_mon.h" @@ -67,10 +68,10 @@ /*========== Static Function Prototypes =====================================*/ /** get a boolean for if any timing error (current or recorded) occurred */ -static bool CAN_AnySysMonTimingIssueDetected(const CAN_SHIM_s *const kpkCanShim); +static bool CANTX_AnySysMonTimingIssueDetected(const CAN_SHIM_s *const kpkCanShim); /*========== Static Function Implementations ================================*/ -static bool CAN_AnySysMonTimingIssueDetected(const CAN_SHIM_s *const kpkCanShim) { +static bool CANTX_AnySysMonTimingIssueDetected(const CAN_SHIM_s *const kpkCanShim) { FAS_ASSERT(kpkCanShim != NULL_PTR); SYSM_TIMING_VIOLATION_RESPONSE_s recordedTimingViolations = {0}; SYSM_GetRecordedTimingViolations(&recordedTimingViolations); @@ -84,21 +85,17 @@ static bool CAN_AnySysMonTimingIssueDetected(const CAN_SHIM_s *const kpkCanShim) } /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxState( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_BmsState( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - /* pMuxId is not used here, therefore has to be NULL_PTR */ - FAS_ASSERT(pMuxId == NULL_PTR); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_BMS_STATE_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); + FAS_ASSERT(pMuxId == NULL_PTR); /* pMuxId is not used here, therefore has to be NULL_PTR */ FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; DATA_READ_DATA(kpkCanShim->pTableErrorState, kpkCanShim->pTableInsulation, kpkCanShim->pTableMsl); @@ -106,42 +103,42 @@ extern uint32_t CAN_TxState( /* State */ uint64_t data = (uint64_t)BMS_GetState(); /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 3u, 4u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 3u, 4u, data, message.endianness); /* Connected strings */ data = (uint64_t)BMS_GetNumberOfConnectedStrings(); /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 4u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 4u, data, message.endianness); /* General error - implement now */ data = CAN_ConvertBooleanToInteger(DIAG_IsAnyFatalErrorSet()); - CAN_TxSetMessageDataWithSignalData(&message, 11u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 11u, 1u, data, message.endianness); /* General warning: TODO */ /* Emergency shutoff */ data = CAN_ConvertBooleanToInteger(BMS_IsTransitionToErrorStateActive()); - CAN_TxSetMessageDataWithSignalData(&message, 10u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 10u, 1u, data, message.endianness); /* Number of deactivated strings: TODO */ /* sys mon error */ - data = CAN_ConvertBooleanToInteger(CAN_AnySysMonTimingIssueDetected(kpkCanShim)); - CAN_TxSetMessageDataWithSignalData(&message, 12u, 1u, data, endianness); + data = CAN_ConvertBooleanToInteger(CANTX_AnySysMonTimingIssueDetected(kpkCanShim)); + CAN_TxSetMessageDataWithSignalData(&messageData, 12u, 1u, data, message.endianness); /* Insulation monitoring active */ data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableInsulation->isImdRunning); - CAN_TxSetMessageDataWithSignalData(&message, 13u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 13u, 1u, data, message.endianness); /* Error: insulation */ data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableErrorState->criticalLowInsulationResistance); - CAN_TxSetMessageDataWithSignalData(&message, 23u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 23u, 1u, data, message.endianness); /* Insulation resistance */ float signalData = (float)kpkCanShim->pTableInsulation->insulationResistance_kOhm; signalData = signalData * 0.1f; /* convert kOhm to 10kOhm */ data = (uint64_t)signalData; - CAN_TxSetMessageDataWithSignalData(&message, 63u, 8u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 63u, 8u, data, message.endianness); /* Charging complete: TODO */ @@ -153,51 +150,47 @@ extern uint32_t CAN_TxState( /* Error: MCU die temperature */ data = kpkCanShim->pTableErrorState->mcuDieTemperature; - CAN_TxSetMessageDataWithSignalData(&message, 18u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 18u, 1u, data, message.endianness); /* Error: master overtemperature: TODO */ /* Error: master undertemperature: TODO */ /* Error: interlock */ data = kpkCanShim->pTableErrorState->interlock; - CAN_TxSetMessageDataWithSignalData(&message, 22u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 22u, 1u, data, message.endianness); /* Main fuse state: TODO */ /* Error: Can timing */ data = kpkCanShim->pTableErrorState->canTiming; - CAN_TxSetMessageDataWithSignalData(&message, 24u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 24u, 1u, data, message.endianness); /* Error: Overcurrent pack charge */ data = kpkCanShim->pTableMsl->packChargeOvercurrent; - CAN_TxSetMessageDataWithSignalData(&message, 25u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 25u, 1u, data, message.endianness); /* Error: Overcurrent pack discharge */ data = kpkCanShim->pTableMsl->packDischargeOvercurrent; - CAN_TxSetMessageDataWithSignalData(&message, 26u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 26u, 1u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be use to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } -extern uint32_t CAN_TxDetailState( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_BmsStateDetails( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - /* pMuxId is not used here, therefore has to be NULL_PTR */ - FAS_ASSERT(pMuxId == NULL_PTR); - - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_BMS_STATE_DETAILS_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); + FAS_ASSERT(pMuxId == NULL_PTR); /* pMuxId is not used here, therefore has to be NULL_PTR */ FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; DATA_READ_DATA(kpkCanShim->pTableErrorState); SYSM_TIMING_VIOLATION_RESPONSE_s recordedTimingViolations = {0}; @@ -206,58 +199,56 @@ extern uint32_t CAN_TxDetailState( /* AXIVION Disable Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ /* current violation engine */ uint64_t data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableErrorState->timingViolationEngine); - CAN_TxSetMessageDataWithSignalData(&message, 0u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 0u, 1u, data, message.endianness); /* current violation 1ms */ data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableErrorState->timingViolation1ms); - CAN_TxSetMessageDataWithSignalData(&message, 1u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 1u, 1u, data, message.endianness); /* current violation 10ms */ data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableErrorState->timingViolation10ms); - CAN_TxSetMessageDataWithSignalData(&message, 2u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 2u, 1u, data, message.endianness); /* current violation 100ms */ data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableErrorState->timingViolation100ms); - CAN_TxSetMessageDataWithSignalData(&message, 3u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 3u, 1u, data, message.endianness); /* current violation 100ms algorithm */ data = CAN_ConvertBooleanToInteger(kpkCanShim->pTableErrorState->timingViolation100msAlgo); - CAN_TxSetMessageDataWithSignalData(&message, 4u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 4u, 1u, data, message.endianness); /* recorded violation engine */ data = CAN_ConvertBooleanToInteger(recordedTimingViolations.recordedViolationEngine); - CAN_TxSetMessageDataWithSignalData(&message, 8u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 8u, 1u, data, message.endianness); /* recorded violation 1ms */ data = CAN_ConvertBooleanToInteger(recordedTimingViolations.recordedViolation1ms); - CAN_TxSetMessageDataWithSignalData(&message, 9u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 9u, 1u, data, message.endianness); /* recorded violation 10ms */ data = CAN_ConvertBooleanToInteger(recordedTimingViolations.recordedViolation10ms); - CAN_TxSetMessageDataWithSignalData(&message, 10u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 10u, 1u, data, message.endianness); /* recorded violation 100ms */ data = CAN_ConvertBooleanToInteger(recordedTimingViolations.recordedViolation100ms); - CAN_TxSetMessageDataWithSignalData(&message, 11u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 11u, 1u, data, message.endianness); /* recorded violation 100ms algorithm */ data = CAN_ConvertBooleanToInteger(recordedTimingViolations.recordedViolation100msAlgo); - CAN_TxSetMessageDataWithSignalData(&message, 12u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 12u, 1u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be use to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } -extern uint32_t CAN_TxStringState( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringState( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_STRING_STATE_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(pMuxId != NULL_PTR); FAS_ASSERT(*pMuxId < BS_NR_OF_STRINGS); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; - uint64_t data = 0; + uint64_t messageData = 0u; + uint64_t data = 0; const uint8_t stringNumber = *pMuxId; @@ -272,11 +263,11 @@ extern uint32_t CAN_TxStringState( /* mux value */ data = (uint64_t)stringNumber; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 3u, 4u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 3u, 4u, data, message.endianness); /* String connected */ data = CAN_ConvertBooleanToInteger(BMS_IsStringClosed(stringNumber)); - CAN_TxSetMessageDataWithSignalData(&message, 4u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 4u, 1u, data, message.endianness); /* Balancing active: TODO */ @@ -287,27 +278,27 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 6u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 6u, 1u, data, message.endianness); /* Error: Deep-discharge */ data = kpkCanShim->pTableErrorState->deepDischargeDetected[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 7u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 1u, data, message.endianness); /* Error: Overtemperature charge */ data = kpkCanShim->pTableMsl->overtemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 8u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 8u, 1u, data, message.endianness); /* Error: Undertemperature charge */ data = kpkCanShim->pTableMsl->undertemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 9u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 9u, 1u, data, message.endianness); /* Error: Overtemperature discharge */ data = kpkCanShim->pTableMsl->overtemperatureDischarge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 10u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 10u, 1u, data, message.endianness); /* Error: Undertemperature discharge */ data = kpkCanShim->pTableMsl->undertemperatureDischarge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 11u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 11u, 1u, data, message.endianness); /* Error: Overcurrent charge */ if ((kpkCanShim->pTableMsl->cellChargeOvercurrent[stringNumber] == 1u) || @@ -316,7 +307,7 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 12u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 12u, 1u, data, message.endianness); /* Error: Overcurrent discharge */ if ((kpkCanShim->pTableMsl->cellDischargeOvercurrent[stringNumber] == 1u) || @@ -325,31 +316,31 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 13u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 13u, 1u, data, message.endianness); /* Error: Overvoltage */ data = kpkCanShim->pTableMsl->overVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 14u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 14u, 1u, data, message.endianness); /* Error: Undervoltage */ data = kpkCanShim->pTableMsl->underVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 15u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 15u, 1u, data, message.endianness); /* Info: Overtemperature charge - MOL */ data = kpkCanShim->pTableMol->overtemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 16u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 16u, 1u, data, message.endianness); /* Info: Undertemperature charge - MOL */ data = kpkCanShim->pTableMol->undertemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 17u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 17u, 1u, data, message.endianness); /* Info: Overtemperature discharge - MOL */ data = kpkCanShim->pTableMol->overtemperatureDischarge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 18u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 18u, 1u, data, message.endianness); /* Info: Undertemperature discharge - MOL */ data = kpkCanShim->pTableMol->undertemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 19u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 19u, 1u, data, message.endianness); /* Info: Overcurrent charge - MOL */ if ((kpkCanShim->pTableMol->cellChargeOvercurrent[stringNumber] == 1u) || @@ -358,7 +349,7 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 20u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 20u, 1u, data, message.endianness); /* Info: Overcurrent discharge - MOL */ if ((kpkCanShim->pTableMol->cellDischargeOvercurrent[stringNumber] == 1u) || @@ -367,31 +358,31 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 21u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 21u, 1u, data, message.endianness); /* Info: Overvoltage - MOL */ data = kpkCanShim->pTableMol->overVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 22u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 22u, 1u, data, message.endianness); /* Info: Undervoltage - MOL */ data = kpkCanShim->pTableMol->underVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 23u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 23u, 1u, data, message.endianness); /* Warning: Overtemperature charge - RSL */ data = kpkCanShim->pTableRsl->overtemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 24u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 24u, 1u, data, message.endianness); /* Warning: Undertemperature charge - RSL */ data = kpkCanShim->pTableRsl->undertemperatureCharge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 25u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 25u, 1u, data, message.endianness); /* Warning: Overtemperature discharge - RSL */ data = kpkCanShim->pTableRsl->overtemperatureDischarge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 26u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 26u, 1u, data, message.endianness); /* Warning: Undertemperature discharge - RSL */ data = kpkCanShim->pTableRsl->undertemperatureDischarge[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 27u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 27u, 1u, data, message.endianness); /* Warning: Overcurrent charge - RSL */ if ((kpkCanShim->pTableRsl->cellChargeOvercurrent[stringNumber] == 1u) || @@ -400,7 +391,7 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 28u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 28u, 1u, data, message.endianness); /* Warning: Overcurrent discharge - RSL */ if ((kpkCanShim->pTableMol->cellDischargeOvercurrent[stringNumber] == 1u) || @@ -409,15 +400,15 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 29u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 29u, 1u, data, message.endianness); /* Warning: Overvoltage - RSL */ data = kpkCanShim->pTableRsl->overVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 30u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 30u, 1u, data, message.endianness); /* Warning: Undervoltage - RSL */ data = kpkCanShim->pTableRsl->underVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 31u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 31u, 1u, data, message.endianness); /* Error: Positive string contactor: TODO */ /* Error: Negative string contactor: TODO */ @@ -425,22 +416,22 @@ extern uint32_t CAN_TxStringState( /* Error: Daisy-chain base: communication */ data = kpkCanShim->pTableErrorState->spiError[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 35u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 35u, 1u, data, message.endianness); /* Error: Daisy-chain redundancy: communication: TODO */ /* Error: Daisy-chain base: CRC */ data = kpkCanShim->pTableErrorState->crcError[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 37u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 37u, 1u, data, message.endianness); /* Error: Daisy-chain redundancy: CRC: TODO */ /* Error: Daisy-chain base: Voltage out of operating range */ data = kpkCanShim->pTableErrorState->afeCellVoltageError[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 39u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 39u, 1u, data, message.endianness); /* Error: Daisy-chain redundancy: Voltage out of operating range: TODO */ /* Error: Daisy-chain base: Temperature out of operating range */ data = kpkCanShim->pTableErrorState->afeCellTemperatureError[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 41u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 41u, 1u, data, message.endianness); /* Error: Daisy-chain redundancy: Voltage out of operating range: TODO */ @@ -451,54 +442,54 @@ extern uint32_t CAN_TxStringState( } else { data = 0u; } - CAN_TxSetMessageDataWithSignalData(&message, 43u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 43u, 1u, data, message.endianness); /* Error: Coulomb counting measurement */ data = kpkCanShim->pTableErrorState->canTimingCc[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 44u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 44u, 1u, data, message.endianness); /* Error: Energy counting measurement */ data = kpkCanShim->pTableErrorState->canTimingEc[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 45u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 45u, 1u, data, message.endianness); /* Error: Current sensor V1 measurement */ data = kpkCanShim->pTableErrorState->currentSensorTimeoutV1[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 46u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 46u, 1u, data, message.endianness); /* Error: Current sensor V2 measurement: TODO */ /* Error: Current sensor V3 measurement */ data = kpkCanShim->pTableErrorState->currentSensorTimeoutV3[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 48u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 48u, 1u, data, message.endianness); /* Error: Open wire */ data = kpkCanShim->pTableErrorState->open_wire[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 49u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 49u, 1u, data, message.endianness); /* Error: Plausibility: Cell temperature */ data = kpkCanShim->pTableErrorState->plausibilityCheckCelltemperature[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 51u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 51u, 1u, data, message.endianness); /* Error: Plausibility: Cell voltage */ data = kpkCanShim->pTableErrorState->plausibilityCheckCellVoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 52u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 52u, 1u, data, message.endianness); /* Error: Plausibility: String voltage */ data = kpkCanShim->pTableErrorState->plausibilityCheckPackvoltage[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 53u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 53u, 1u, data, message.endianness); /* Error: Plausibility: Cell temperature spread */ data = kpkCanShim->pTableErrorState->plausibilityCheckCelltemperatureSpread[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 54u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 54u, 1u, data, message.endianness); /* Error: Plausibility: Cell voltage spread */ data = kpkCanShim->pTableErrorState->plausibilityCheckCellVoltageSpread[stringNumber]; - CAN_TxSetMessageDataWithSignalData(&message, 55u, 1u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 55u, 1u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* Open wire number: TODO */ /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); /* Increment multiplexer for next cell */ (*pMuxId)++; diff --git a/src/app/driver/can/cbs/tx/can_cbs_tx_string-state-estimation.c b/src/app/driver/can/cbs/tx/can_cbs_tx_string-state-estimation.c new file mode 100644 index 00000000..832d932a --- /dev/null +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_string-state-estimation.c @@ -0,0 +1,173 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cbs_tx_string-state-estimation.c + * @author foxBMS Team + * @date 2021-07-21 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVER + * @prefix CANTX + * + * @brief CAN driver Tx callback implementation + * @details CAN Tx callback for state estimation messages + */ + +/*========== Includes =======================================================*/ +#include "bms.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" +#include "can_helper.h" +#include "foxmath.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +extern uint32_t CANTX_StringStateEstimation( + CAN_MESSAGE_PROPERTIES_s message, + uint8_t *pCanData, + uint8_t *pMuxId, + const CAN_SHIM_s *const kpkCanShim) { + FAS_ASSERT(message.id == CANTX_STRING_STATE_ESTIMATION_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); + FAS_ASSERT(pCanData != NULL_PTR); + FAS_ASSERT(pMuxId != NULL_PTR); + FAS_ASSERT(*pMuxId < BS_NR_OF_STRINGS); + FAS_ASSERT(kpkCanShim != NULL_PTR); + uint64_t messageData = 0u; + + /** Database entry with state estimation values does not need to be read + * within this callback as it is already read by function + * #CANTX_PackStateEstimation */ + const uint8_t stringNumber = *pMuxId; + + /* set multiplexer in CAN frame */ + /* AXIVION Disable Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ + uint64_t data = (uint64_t)stringNumber; + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 4u, data, message.endianness); + + /* Minimum SOC */ + float signalData = kpkCanShim->pTableSox->minimumSoc_perc[stringNumber]; + float offset = 0.0f; + float factor = 4.0f; /* convert from perc to 0.25perc */ + signalData = (signalData + offset) * factor; + data = (int64_t)signalData; + /* set data in CAN frame */ + CAN_TxSetMessageDataWithSignalData(&messageData, 3u, 9u, data, message.endianness); + + /* Average SOC */ + signalData = kpkCanShim->pTableSox->averageSoc_perc[stringNumber]; + offset = 0.0f; + factor = 4.0f; /* convert from perc to 0.25perc */ + signalData = (signalData + offset) * factor; + data = (int64_t)signalData; + /* set data in CAN frame */ + CAN_TxSetMessageDataWithSignalData(&messageData, 10u, 9u, data, message.endianness); + + /* Maximum SOC */ + signalData = kpkCanShim->pTableSox->maximumSoc_perc[stringNumber]; + offset = 0.0f; + factor = 4.0f; /* convert from perc to 0.25perc */ + signalData = (signalData + offset) * factor; + data = (int64_t)signalData; + /* set data in CAN frame */ + CAN_TxSetMessageDataWithSignalData(&messageData, 17u, 9u, data, message.endianness); + + /* SOE */ + if (BMS_CHARGING == BMS_GetCurrentFlowDirection(kpkCanShim->pTablePackValues->stringCurrent_mA[stringNumber])) { + signalData = kpkCanShim->pTableSox->maximumSoe_perc[stringNumber]; + } else { + signalData = kpkCanShim->pTableSox->minimumSoe_perc[stringNumber]; + } + offset = 0.0f; + factor = 4.0f; /* convert from perc to 0.25perc */ + signalData = (signalData + offset) * factor; + data = (int64_t)signalData; + /* set data in CAN frame */ + CAN_TxSetMessageDataWithSignalData(&messageData, 24u, 9u, data, message.endianness); + + /* SOH */ + signalData = 100.0f; + offset = 0.0f; + factor = 4.0f; /* convert from perc to 0.25perc */ + signalData = (signalData + offset) * factor; + data = (int64_t)signalData; + /* set data in CAN frame */ + CAN_TxSetMessageDataWithSignalData(&messageData, 47u, 9u, data, message.endianness); + + /* String energy */ + signalData = kpkCanShim->pTableSox->minimumSoe_Wh[stringNumber]; + offset = 0.0f; + factor = 0.1f; /* convert from Wh to 10Wh */ + signalData = (signalData + offset) * factor; + data = (int64_t)signalData; + /* set data in CAN frame */ + CAN_TxSetMessageDataWithSignalData(&messageData, 54u, 15u, data, message.endianness); + /* AXIVION Enable Style Generic-NoMagicNumbers: */ + + /* now copy data in the buffer that will be used to send data */ + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); + + /* Increment multiplexer for next cell */ + (*pMuxId)++; + + /* Check mux value */ + if (*pMuxId >= BS_NR_OF_STRINGS) { + *pMuxId = 0u; + } + + return 0; +} + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ +#ifdef UNITY_UNIT_TEST + +#endif diff --git a/src/app/driver/can/cbs/can_cbs_tx_system_values.c b/src/app/driver/can/cbs/tx/can_cbs_tx_system-values.c similarity index 77% rename from src/app/driver/can/cbs/can_cbs_tx_system_values.c rename to src/app/driver/can/cbs/tx/can_cbs_tx_system-values.c index c362fe90..21193138 100644 --- a/src/app/driver/can/cbs/can_cbs_tx_system_values.c +++ b/src/app/driver/can/cbs/tx/can_cbs_tx_system-values.c @@ -40,20 +40,21 @@ */ /** - * @file can_cbs_tx_system_values.c + * @file can_cbs_tx_system-values.c * @author foxBMS Team * @date 2021-07-21 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER - * @prefix CAN + * @prefix CANTX * * @brief CAN driver Tx callback implementation * @details CAN Tx callback for pack value and string value messages */ /*========== Includes =======================================================*/ -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" /*========== Macros and Definitions =========================================*/ @@ -67,21 +68,19 @@ /*========== Static Function Implementations ================================*/ /*========== Extern Function Implementations ================================*/ -extern uint32_t CAN_TxPackValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_PackValues( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { /* pMuxId is not used here, therefore has to be NULL_PTR */ FAS_ASSERT(pMuxId == NULL_PTR); - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_PACK_VALUES_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; + uint64_t messageData = 0u; /* Read database entry */ DATA_READ_DATA(kpkCanShim->pTablePackValues); @@ -94,7 +93,7 @@ extern uint32_t CAN_TxPackValues( signalData = (signalData + offset) * factor; uint64_t data = (uint64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 14u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 14u, data, message.endianness); /* System voltage */ signalData = kpkCanShim->pTablePackValues->highVoltageBusVoltage_mV; @@ -103,7 +102,7 @@ extern uint32_t CAN_TxPackValues( signalData = (signalData + offset) * factor; data = (uint64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 9u, 14u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 9u, 14u, data, message.endianness); /* System current */ signalData = kpkCanShim->pTablePackValues->packCurrent_mA; @@ -112,7 +111,7 @@ extern uint32_t CAN_TxPackValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 41u, 18u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 41u, 18u, data, message.endianness); /* System power */ signalData = kpkCanShim->pTablePackValues->packPower_W; @@ -121,40 +120,38 @@ extern uint32_t CAN_TxPackValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 27u, 18u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 27u, 18u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); return 0; } -extern uint32_t CAN_TxStringValues( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringValuesP0( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_STRING_VALUES_P0_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(pMuxId != NULL_PTR); FAS_ASSERT(*pMuxId < BS_NR_OF_STRINGS); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0; - uint64_t data = 0; - float signalData = 0.0f; - float offset = 0.0f; - float factor = 0.0f; + uint64_t messageData = 0u; + uint64_t data = 0; + float signalData = 0.0f; + float offset = 0.0f; + float factor = 0.0f; const uint8_t stringNumber = *pMuxId; /* First signal to transmit cell voltages: get database values */ if (stringNumber == 0u) { /* Do not read pTableMsl and pTableErrorState as they already are read - * with a higher frequency from CAN_TxState callback */ + * with a higher frequency from CANTX_BmsState callback */ DATA_READ_DATA(kpkCanShim->pTablePackValues); } @@ -162,7 +159,7 @@ extern uint32_t CAN_TxStringValues( data = (uint64_t)stringNumber; /* set data in CAN frame */ /* AXIVION Disable Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 3u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 3u, data, message.endianness); /* String voltage */ signalData = (float)kpkCanShim->pTablePackValues->stringVoltage_mV[stringNumber]; @@ -171,7 +168,7 @@ extern uint32_t CAN_TxStringValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 4u, 17u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 4u, 17u, data, message.endianness); /* String current */ signalData = (float)kpkCanShim->pTablePackValues->stringCurrent_mA[stringNumber]; @@ -180,7 +177,7 @@ extern uint32_t CAN_TxStringValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 19u, 18u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 19u, 18u, data, message.endianness); /* String power */ signalData = (float)kpkCanShim->pTablePackValues->stringPower_W[stringNumber]; @@ -189,11 +186,11 @@ extern uint32_t CAN_TxStringValues( signalData = (signalData + offset) * factor; data = (int64_t)signalData; /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 33u, 18u, data, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 33u, 18u, data, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); /* Increment multiplexer for next cell */ (*pMuxId)++; @@ -206,28 +203,26 @@ extern uint32_t CAN_TxStringValues( return 0; } -extern uint32_t CAN_TxStringValues2( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +extern uint32_t CANTX_StringValuesP1( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) { - FAS_ASSERT(id < CAN_MAX_11BIT_ID); /* Currently standard ID, 11 bit */ - FAS_ASSERT(dlc <= CAN_MAX_DLC); /* Currently max 8 bytes in a CAN frame */ + FAS_ASSERT(message.id == CANTX_STRING_VALUES_P1_ID); + FAS_ASSERT(message.dlc == CAN_FOXBMS_MESSAGES_DEFAULT_DLC); FAS_ASSERT(pCanData != NULL_PTR); FAS_ASSERT(pMuxId != NULL_PTR); FAS_ASSERT(*pMuxId < BS_NR_OF_STRINGS); FAS_ASSERT(kpkCanShim != NULL_PTR); - uint64_t message = 0u; - uint64_t signalData = 0u; + uint64_t messageData = 0u; + uint64_t signalData = 0u; const uint8_t stringNumber = *pMuxId; /* First signal to transmit cell voltages: get database values */ if (stringNumber == 0u) { /* Do not read pTableMsl and pTableErrorState as they already are read - * with a higher frequency from CAN_TxState callback */ + * with a higher frequency from CANTX_BmsState callback */ DATA_READ_DATA(kpkCanShim->pTableCurrentSensor); } @@ -235,18 +230,18 @@ extern uint32_t CAN_TxStringValues2( signalData = (uint64_t)stringNumber; /* set data in CAN frame */ /* AXIVION Disable Style Generic-NoMagicNumbers: Signal data defined in .dbc file. */ - CAN_TxSetMessageDataWithSignalData(&message, 7u, 4u, signalData, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 7u, 4u, signalData, message.endianness); /* String voltage */ OS_EnterTaskCritical(); /* this access has to be protected as it conflicts with the 1ms task */ signalData = (int64_t)kpkCanShim->pTableCurrentSensor->energyCounter_Wh[stringNumber]; OS_ExitTaskCritical(); /* set data in CAN frame */ - CAN_TxSetMessageDataWithSignalData(&message, 15u, 32u, signalData, endianness); + CAN_TxSetMessageDataWithSignalData(&messageData, 15u, 32u, signalData, message.endianness); /* AXIVION Enable Style Generic-NoMagicNumbers: */ /* now copy data in the buffer that will be used to send data */ - CAN_TxSetCanDataWithMessageData(message, pCanData, endianness); + CAN_TxSetCanDataWithMessageData(messageData, pCanData, message.endianness); /* Increment multiplexer for next cell */ (*pMuxId)++; diff --git a/src/app/driver/checksum/checksum.c b/src/app/driver/checksum/checksum.c index 0567d78f..bab1a11f 100644 --- a/src/app/driver/checksum/checksum.c +++ b/src/app/driver/checksum/checksum.c @@ -43,8 +43,8 @@ * @file checksum.c * @author foxBMS Team * @date 2019-12-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TODO * @prefix CHK * diff --git a/src/app/driver/checksum/checksum.h b/src/app/driver/checksum/checksum.h index 72165340..b0d2d61b 100644 --- a/src/app/driver/checksum/checksum.h +++ b/src/app/driver/checksum/checksum.h @@ -43,8 +43,8 @@ * @file checksum.h * @author foxBMS Team * @date 2019-12-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TODO * @prefix CHK * diff --git a/src/app/driver/config/can_cfg.c b/src/app/driver/config/can_cfg.c index da645411..e3a00d5f 100644 --- a/src/app/driver/config/can_cfg.c +++ b/src/app/driver/config/can_cfg.c @@ -43,8 +43,8 @@ * @file can_cfg.c * @author foxBMS Team * @date 2019-12-04 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix CAN * @@ -59,7 +59,6 @@ /*========== Includes =======================================================*/ #include "can_cfg.h" -#include "can_cbs.h" #include "database.h" #include "ftask.h" @@ -69,283 +68,8 @@ /*========== Static Constant and Variable Definitions =======================*/ -/** Multiplexer values @{*/ -static uint8_t can_voltageMux = 0u; -static uint8_t can_temperatureMux = 0u; -static uint8_t can_stringStateMux = 0u; -static uint8_t can_stringValuesMux = 0u; -static uint8_t can_stringMinMaxMux = 0u; -static uint8_t can_stringStateEstimationMux = 0u; -static uint8_t can_stringValues2Mux = 0u; -/**@}*/ - /*========== Extern Constant and Variable Definitions =======================*/ -/* *************************************** - * Configure TX messages here - ****************************************/ - -/** registry of CAN TX messages */ -const CAN_MSG_TX_TYPE_s can_txMessages[] = { - {CAN1_NODE, - CAN_ID_TX_STATE, - CAN_DLC, - CAN_TX_STATE_PERIOD_MS, - CAN_TX_STATE_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxState, - NULL_PTR}, /*!< State */ - {CAN1_NODE, - CAN_ID_TX_DETAIL_STATE, - CAN_DLC, - CAN_TX_DETAIL_STATE_PERIOD_MS, - CAN_TX_DETAIL_STATE_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxDetailState, - NULL_PTR}, /*!< Detail State */ - {CAN1_NODE, - CAN_ID_TX_VOLTAGES, - CAN_DLC, - CAN_TX_VOLTAGES_PERIOD_MS, - CAN_TX_VOLTAGES_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxVoltage, - &can_voltageMux}, /*!< Cell voltages */ - {CAN1_NODE, - CAN_ID_TX_TEMPERATURES, - CAN_DLC, - CAN_TX_TEMPERATURES_PERIOD_MS, - CAN_TX_TEMPERATURES_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxCellTemperature, - &can_temperatureMux}, /*!< Cell temperatures */ - {CAN1_NODE, - CAN_ID_TX_LIMIT_VALUES, - CAN_DLC, - CAN_TX_LIMIT_VALUES_PERIOD_MS, - CAN_TX_LIMIT_VALUES_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxLimitValues, - NULL_PTR}, /*!< Limits */ - {CAN1_NODE, - CAN_ID_TX_MINIMUM_MAXIMUM_VALUES, - CAN_DLC, - CAN_TX_MINIMUM_MAXIMUM_VALUES_PERIOD_MS, - CAN_TX_MINIMUM_MAXIMUM_VALUES_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxMinimumMaximumValues, - NULL_PTR}, /*!< Pack minimum and maximum values */ - {CAN1_NODE, - CAN_ID_TX_PACK_STATE_ESTIMATION, - CAN_DLC, - CAN_TX_PACK_STATE_ESTIMATION_PERIOD_MS, - CAN_TX_PACK_STATE_ESTIMATION_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxStateEstimation, - NULL_PTR}, /*!< Pack state estimation */ - {CAN1_NODE, - CAN_ID_TX_PACK_VALUES, - CAN_DLC, - CAN_TX_PACK_VALUES_PERIOD_MS, - CAN_TX_PACK_VALUES_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxPackValues, - NULL_PTR}, /*!< Pack values */ - {CAN1_NODE, - CAN_ID_TX_STRING_STATE, - CAN_DLC, - CAN_TX_STRING_STATE_PERIOD_MS, - CAN_TX_STRING_STATE_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxStringState, - &can_stringStateMux}, /*!< String state values */ - {CAN1_NODE, - CAN_ID_TX_STRING_VALUES, - CAN_DLC, - CAN_TX_STRING_VALUES_PERIOD_MS, - CAN_TX_STRING_VALUES_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxStringValues, - &can_stringValuesMux}, /*!< String values */ - {CAN1_NODE, - CAN_ID_TX_STRING_MINIMUM_MAXIMUM, - CAN_DLC, - CAN_TX_STRING_MINIMUM_MAXIMUM_PERIOD_MS, - CAN_TX_STRING_MINIMUM_MAXIMUM_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxStringMinimumMaximumValues, - &can_stringMinMaxMux}, /*!< String minimum maximum values */ - {CAN1_NODE, - CAN_ID_TX_STRING_STATE_ESTIMATION, - CAN_DLC, - CAN_TX_STRING_STATE_ESTIMATION_PERIOD_MS, - CAN_TX_STRING_STATE_ESTIMATION_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxStringStateEstimation, - &can_stringStateEstimationMux}, /*!< String minimum maximum values */ - {CAN1_NODE, - CAN_ID_TX_STRING_VALUES_2, - CAN_DLC, - CAN_TX_STRING_VALUES_2_PERIOD_MS, - CAN_TX_STRING_VALUES_2_PHASE_MS, - CAN_BIG_ENDIAN, - &CAN_TxStringValues2, - &can_stringValues2Mux}, /*!< String minimum maximum values */ -}; - -/* *************************************** - * Configure RX messages here - ****************************************/ - -/** registry of CAN RX messages */ -const CAN_MSG_RX_TYPE_s can_rxMessages[] = { - {CAN1_NODE, CAN_ID_IMD_INFO, CAN_DLC, CAN_LITTLE_ENDIAN, &CAN_RxImdInfo}, /*!< info message from iso165c */ - {CAN1_NODE, - CAN_ID_IMD_RESPONSE, - CAN_DLC, - CAN_LITTLE_ENDIAN, - &CAN_RxImdResponse}, /*!< response message from iso165c */ - - {CAN1_NODE, CAN_ID_COMMAND, CAN_DLC, CAN_BIG_ENDIAN, &CAN_RxRequest}, /*!< state request */ - {CAN1_NODE, CAN_ID_SOFTWARE_RESET, CAN_DLC, CAN_LITTLE_ENDIAN, &CAN_RxSwReset}, /*!< software reset */ - - {CAN1_NODE, - CAN_ID_STRING0_CURRENT, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor I in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_VOLTAGE1, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U1 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_VOLTAGE2, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U2 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_VOLTAGE3, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U3 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_TEMPERATURE, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor T in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_POWER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor Power in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_CURRENT_COUNTER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor C-C in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING0_ENERGY_COUNTER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor E-C in cyclic mode */ - -#if BS_NR_OF_STRINGS > 1u - {CAN1_NODE, - CAN_ID_STRING1_CURRENT, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor I in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_VOLTAGE1, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U1 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_VOLTAGE2, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U2 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_VOLTAGE3, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U3 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_TEMPERATURE, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor T in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_POWER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor Power in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_CURRENT_COUNTER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor C-C in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING1_ENERGY_COUNTER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor E-C in cyclic mode */ - -#if BS_NR_OF_STRINGS > 2u - {CAN1_NODE, - CAN_ID_STRING2_CURRENT, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor I in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_VOLTAGE1, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U1 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_VOLTAGE2, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U2 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_VOLTAGE3, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor U3 in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_TEMPERATURE, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor T in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_POWER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor Power in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_CURRENT_COUNTER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor C-C in cyclic mode */ - {CAN1_NODE, - CAN_ID_STRING2_ENERGY_COUNTER, - CAN_DLC, - CAN_BIG_ENDIAN, - &CAN_RxCurrentSensor}, /*!< current sensor E-C in cyclic mode */ - -#endif /* BS_NR_OF_STRINGS > 2 */ -#endif /* BS_NR_OF_STRINGS > 1 */ - - {CAN1_NODE, CAN_ID_DEBUG, CAN_DLC, CAN_LITTLE_ENDIAN, &CAN_RxDebug}, /*!< debug message */ - {CAN1_NODE, CAN_ID_SW_VERSION, CAN_DLC, CAN_LITTLE_ENDIAN, &CAN_RxSwVersion}, /*!< request SW version */ -}; - -/** length of CAN message arrays @{*/ -const uint8_t can_txLength = sizeof(can_txMessages) / sizeof(can_txMessages[0]); -const uint8_t can_rxLength = sizeof(can_rxMessages) / sizeof(can_rxMessages[0]); -/**@}*/ - /** local copies of database tables */ /**@{*/ static DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE}; diff --git a/src/app/driver/config/can_cfg.h b/src/app/driver/config/can_cfg.h index 9f1cedf5..e764bc23 100644 --- a/src/app/driver/config/can_cfg.h +++ b/src/app/driver/config/can_cfg.h @@ -43,8 +43,8 @@ * @file can_cfg.h * @author foxBMS Team * @date 2019-12-04 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CAN * @@ -68,10 +68,13 @@ /*========== Macros and Definitions =========================================*/ /** register on which the CAN interface is connected @{*/ -#define CAN1_NODE (canREG1) -#define CAN2_NODE (canREG2) +#define CAN_NODE_1 (canREG1) +#define CAN_NODE_2 (canREG2) /**@}*/ +#define CAN_NODE_IMD (CAN_NODE_1) +#define CAN_NODE_CURRENT_SENSOR (CAN_NODE_1) + /** * Configuration of CAN transceiver pins to the respective port expander pins. * @{ @@ -86,166 +89,11 @@ #define CAN_MAX_11BIT_ID (2048u) /** Maximum length of Data Length Code */ #define CAN_MAX_DLC (8u) - /** Default DLC */ -#define CAN_DLC (8u) - -/** TX messages - pack related */ - -/** CAN message ID for boot message */ -#define CAN_ID_BOOT_MESSAGE (0x199u) -/** CAN message ID for die id message */ -#define CAN_ID_DIE_ID (0x227u) -/** CAN message ID to send state */ -#define CAN_ID_TX_STATE (0x220u) -/** Periodicity of CAN state messages in ms */ -#define CAN_TX_STATE_PERIOD_MS (100u) -/** Phase of CAN state messages in ms */ -#define CAN_TX_STATE_PHASE_MS (0u) -/** CAN message ID to send detail state */ -#define CAN_ID_TX_DETAIL_STATE (0x226u) -/** Periodicity of CAN detail state messages in ms */ -#define CAN_TX_DETAIL_STATE_PERIOD_MS (1000u) -/** Phase of CAN detail state messages in ms */ -#define CAN_TX_DETAIL_STATE_PHASE_MS (100u) - -/** CAN message ID to send voltages */ -#define CAN_ID_TX_VOLTAGES (0x240u) -/** Periodicity of CAN voltage messages in ms */ -#define CAN_TX_VOLTAGES_PERIOD_MS (100u) -/** Phase of CAN voltage messages in ms */ -#define CAN_TX_VOLTAGES_PHASE_MS (10u) - -/** CAN message ID to send temperatures */ -#define CAN_ID_TX_TEMPERATURES (0x250u) -/** Periodicity of CAN temperature messages in ms */ -#define CAN_TX_TEMPERATURES_PERIOD_MS (200u) -/** Phase of CAN temperature messages in ms */ -#define CAN_TX_TEMPERATURES_PHASE_MS (20u) - -/** CAN message ID to send limit values */ -#define CAN_ID_TX_LIMIT_VALUES (0x224u) -/** Periodicity of CAN limit messages in ms */ -#define CAN_TX_LIMIT_VALUES_PERIOD_MS (100u) -/** Phase of CAN limit messages in ms */ -#define CAN_TX_LIMIT_VALUES_PHASE_MS (30u) - -/** CAN message ID to send minimum and maximum values */ -#define CAN_ID_TX_MINIMUM_MAXIMUM_VALUES (0x223u) -/** Periodicity of CAN minimum and maximum value messages in ms */ -#define CAN_TX_MINIMUM_MAXIMUM_VALUES_PERIOD_MS (100u) -/** Phase of CAN minimum and maximum value messages in ms */ -#define CAN_TX_MINIMUM_MAXIMUM_VALUES_PHASE_MS (40u) - -/** CAN message ID to send pack state estimation values */ -#define CAN_ID_TX_PACK_STATE_ESTIMATION (0x225u) -/** Periodicity of CAN pack state estimation messages in ms */ -#define CAN_TX_PACK_STATE_ESTIMATION_PERIOD_MS (1000u) -/** Phase of CAN pack state estimation messages in ms */ -#define CAN_TX_PACK_STATE_ESTIMATION_PHASE_MS (50u) - -/** CAN message ID to send pack values */ -#define CAN_ID_TX_PACK_VALUES (0x222u) -/** Periodicity of CAN pack values messages in ms */ -#define CAN_TX_PACK_VALUES_PERIOD_MS (100u) -/** Phase of CAN pack values messages in ms */ -#define CAN_TX_PACK_VALUES_PHASE_MS (60u) - -/** TX messages - string related */ - -/** CAN message ID to send string state */ -#define CAN_ID_TX_STRING_STATE (0x221u) -/** Periodicity of CAN string state messages in ms */ -#define CAN_TX_STRING_STATE_PERIOD_MS (100u) -/** Phase of CAN string state messages in ms */ -#define CAN_TX_STRING_STATE_PHASE_MS (70u) - -/** CAN message ID to send string values */ -#define CAN_ID_TX_STRING_VALUES (0x280u) -/** Periodicity of CAN string state messages in ms */ -#define CAN_TX_STRING_VALUES_PERIOD_MS (100u) -/** Phase of CAN string state messages in ms */ -#define CAN_TX_STRING_VALUES_PHASE_MS (80u) - -/** CAN message ID to send string minimum and maximum values */ -#define CAN_ID_TX_STRING_MINIMUM_MAXIMUM (0x281u) -/** Periodicity of CAN string state messages in ms */ -#define CAN_TX_STRING_MINIMUM_MAXIMUM_PERIOD_MS (100u) -/** Phase of CAN string state messages in ms */ -#define CAN_TX_STRING_MINIMUM_MAXIMUM_PHASE_MS (90u) - -/** CAN message ID to send string minimum and maximum values */ -#define CAN_ID_TX_STRING_STATE_ESTIMATION (0x282u) -/** Periodicity of CAN string state messages in ms */ -#define CAN_TX_STRING_STATE_ESTIMATION_PERIOD_MS (1000u) -/** Phase of CAN string state messages in ms */ -#define CAN_TX_STRING_STATE_ESTIMATION_PHASE_MS (0u) - -/** CAN message ID to send string values 2 */ -#define CAN_ID_TX_STRING_VALUES_2 (0x283u) -/** Periodicity of CAN string state messages in ms */ -#define CAN_TX_STRING_VALUES_2_PERIOD_MS (100u) -/** Phase of CAN string state messages in ms */ -#define CAN_TX_STRING_VALUES_2_PHASE_MS (10u) - -/** RX messages */ - -/** CAN message ID to perform a software reset */ -#define CAN_ID_SOFTWARE_RESET (0x95u) - -/** CAN message ID to perform a state request */ -#define CAN_ID_COMMAND (0x230u) - -/** CAN message ID for debug message */ -#define CAN_ID_DEBUG (0x200u) - -/** CAN message ID to get software version */ -#define CAN_ID_SW_VERSION (0x777u) - -/** - * -------------------------CAUTION------------------------- - * The 3 following defines are used by the insulation monitoring device (IMD). - * If they are changed, the IMD will not work anymore - * -------------------------CAUTION------------------------- - */ -/** CAN message ID for info message from iso165c */ -#define CAN_ID_IMD_INFO (0x37u) -/** CAN message ID for request message to iso165c */ -#define CAN_ID_IMD_REQUEST (0x22u) -/** CAN message ID for response message from iso165c */ -#define CAN_ID_IMD_RESPONSE (0x23u) - -/** IDs for the messages from the current sensors */ -/** String 0 @{*/ -#define CAN_ID_STRING0_CURRENT (0x521u) -#define CAN_ID_STRING0_VOLTAGE1 (0x522u) -#define CAN_ID_STRING0_VOLTAGE2 (0x523u) -#define CAN_ID_STRING0_VOLTAGE3 (0x524u) -#define CAN_ID_STRING0_TEMPERATURE (0x525u) -#define CAN_ID_STRING0_POWER (0x526u) -#define CAN_ID_STRING0_CURRENT_COUNTER (0x527u) -#define CAN_ID_STRING0_ENERGY_COUNTER (0x528u) -/**@} - * String 1 @{*/ -#define CAN_ID_STRING1_CURRENT (0x621u) -#define CAN_ID_STRING1_VOLTAGE1 (0x622u) -#define CAN_ID_STRING1_VOLTAGE2 (0x623u) -#define CAN_ID_STRING1_VOLTAGE3 (0x624u) -#define CAN_ID_STRING1_TEMPERATURE (0x625u) -#define CAN_ID_STRING1_POWER (0x626u) -#define CAN_ID_STRING1_CURRENT_COUNTER (0x627u) -#define CAN_ID_STRING1_ENERGY_COUNTER (0x628u) -/**@} - * String 2 @{*/ -#define CAN_ID_STRING2_CURRENT (0x721u) -#define CAN_ID_STRING2_VOLTAGE1 (0x722u) -#define CAN_ID_STRING2_VOLTAGE2 (0x723u) -#define CAN_ID_STRING2_VOLTAGE3 (0x724u) -#define CAN_ID_STRING2_TEMPERATURE (0x725u) -#define CAN_ID_STRING2_POWER (0x726u) -#define CAN_ID_STRING2_CURRENT_COUNTER (0x727u) -#define CAN_ID_STRING2_ENERGY_COUNTER (0x728u) -/**@}*/ +#define CAN_DEFAULT_DLC (8u) +/** Default DLC for messages that are defined by the foxBMS project, i.e., not + * defined by third party software and/or hardware. */ +#define CAN_FOXBMS_MESSAGES_DEFAULT_DLC (8u) /* ************************************************************************************** * CAN BUFFER OPTIONS @@ -305,7 +153,7 @@ typedef struct { canBASE_t *canNode; /*!< CAN node on which the message has been received */ uint32_t id; /*!< ID of the CAN message */ uint8_t data[CAN_MAX_DLC]; /*!< payload of the CAN message */ -} CAN_BUFFERELEMENT_s; +} CAN_BUFFER_ELEMENT_s; /** composite type for storing and passing on the local database table handles */ typedef struct { @@ -326,51 +174,61 @@ typedef struct { DATA_BLOCK_MOL_FLAG_s *pTableMol; /*!< database table with MOL flags */ } CAN_SHIM_s; +/** definition of a CAN message (without data) */ +typedef struct { + uint32_t id; /*!< message ID */ + uint8_t dlc; /*!< data length */ + CAN_ENDIANNESS_e endianness; /*!< Byte order (big or little endian) */ +} CAN_MESSAGE_PROPERTIES_s; + +/** timing information of a CAN TX message */ +typedef struct { + uint32_t period; /*!< CAN message cycle time */ + uint32_t phase; /*!< CAN message startup (first send) offset */ +} CAN_TX_MESSAGE_TIMING_s; + +/** timing information of a CAN RX message */ +typedef struct { + uint32_t period; /*!< expected CAN message cycle time */ +} CAN_RX_MESSAGE_TIMING_s; + /** type definition for tx callback functions used in CAN messages */ typedef uint32_t (*CAN_TxCallbackFunction_f)( - uint32_t ID, - uint8_t DLC, - CAN_ENDIANNESS_e endianness, - uint8_t *candata, + CAN_MESSAGE_PROPERTIES_s message, + uint8_t *canData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim); /** type definition for rx callback functions used in CAN messages */ typedef uint32_t (*CAN_RxCallbackFunction_f)( - uint32_t ID, - uint8_t DLC, - CAN_ENDIANNESS_e endianness, + CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim); /** type definition for structure of a TX CAN message */ typedef struct { canBASE_t *canNode; /*!< CAN node on which the message is transmitted */ - uint32_t id; /*!< CAN message id */ - uint8_t dlc; /*!< CAN message data length code */ - uint32_t repetitionTime; /*!< CAN message cycle time */ - uint32_t repetitionPhase; /*!< CAN message startup (first send) offset */ - CAN_ENDIANNESS_e endianness; /*!< Byte order (big or little endian) */ + CAN_MESSAGE_PROPERTIES_s message; /*!< CAN message */ + CAN_TX_MESSAGE_TIMING_s timing; /*!< time and phase */ CAN_TxCallbackFunction_f callbackFunction; /*!< CAN message callback after message is sent */ uint8_t *pMuxId; /*!< for multiplexed signals: callback can use this as pointer to a mux variable, NULL_PTR if unused*/ -} CAN_MSG_TX_TYPE_s; +} CAN_TX_MESSAGE_TYPE_s; /** type definition for structure of an RX CAN message */ typedef struct { canBASE_t *canNode; /*!< CAN node on which the message is received */ - uint32_t id; /*!< message ID */ - uint8_t dlc; /*!< data length */ - CAN_ENDIANNESS_e endianness; /*!< Byte order (big or little endian) */ + CAN_MESSAGE_PROPERTIES_s message; /*!< CAN message */ + CAN_RX_MESSAGE_TIMING_s timing; /*!< time and phase */ CAN_RxCallbackFunction_f callbackFunction; /*!< CAN message callback after message is received */ -} CAN_MSG_RX_TYPE_s; +} CAN_RX_MESSAGE_TYPE_s; /** variable for storing and passing on the local database table handles */ extern const CAN_SHIM_s can_kShim; /*========== Extern Constant and Variable Declarations ======================*/ -extern const CAN_MSG_TX_TYPE_s can_txMessages[]; -extern const CAN_MSG_RX_TYPE_s can_rxMessages[]; +extern const CAN_TX_MESSAGE_TYPE_s can_txMessages[]; +extern const CAN_RX_MESSAGE_TYPE_s can_rxMessages[]; /** array length for transmission CAN0 message definition @{*/ extern const uint8_t can_txLength; diff --git a/src/app/driver/config/can_cfg_rx-message-definitions.h b/src/app/driver/config/can_cfg_rx-message-definitions.h new file mode 100644 index 00000000..0d092cc1 --- /dev/null +++ b/src/app/driver/config/can_cfg_rx-message-definitions.h @@ -0,0 +1,275 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cfg_rx-message-definitions.h + * @author foxBMS Team + * @date 2022-07-01 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVERS + * @prefix CANRX + * + * @brief Header for the driver for the CAN module + * + */ + +#ifndef FOXBMS__CAN_CFG_RX_MESSAGE_DEFINITIONS_H_ +#define FOXBMS__CAN_CFG_RX_MESSAGE_DEFINITIONS_H_ + +/*========== Includes =======================================================*/ +#include "can_cfg.h" + +/*========== Macros and Definitions =========================================*/ +#define CANRX_NOT_PERIODIC (0u) + +/* Message IDs */ + +/** CAN message ID to perform a software reset */ +#define CANRX_SOFTWARE_RESET_ID (0x95u) +/** Periodicity of CAN software reset messages in ms */ +#define CANRX_SOFTWARE_RESET_PERIOD_ms (CANRX_NOT_PERIODIC) + +/** CAN message ID to perform a state request */ +#define CANRX_BMS_STATE_REQUEST_ID (0x230u) +/** Periodicity of CAN software reset messages in ms */ +#define CANRX_BMS_STATE_REQUEST_PERIOD_ms (CANRX_NOT_PERIODIC) + +/** CAN message ID for debug message */ +#define CANRX_DEBUG_ID (0x200u) +/** Periodicity of CAN software reset messages in ms */ +#define CANRX_DEBUG_PERIOD_ms (CANRX_NOT_PERIODIC) + +/** CAN message ID to get software version */ +#define CANRX_SOFTWARE_VERSION_ID (0x777u) +/** Periodicity of CAN ID to get the software version in ms */ +#define CANRX_SOFTWARE_VERSION_PERIOD_ms (CANRX_NOT_PERIODIC) + +/** + * -------------------------CAUTION------------------------- + * The 3 following defines are used by the insulation monitoring device (IMD). + * If they are changed, the IMD will not work anymore + * -------------------------CAUTION------------------------- + */ +/** CAN message ID for info message from iso165c */ +#define CANRX_IMD_INFO_ID (0x37u) +/** CAN message ID for request message to iso165c */ +#define CANRX_IMD_REQUEST_ID (0x22u) +/** CAN message ID for response message from iso165c */ +#define CANRX_IMD_RESPONSE_ID (0x23u) + +/** IDs for the messages from the current sensors */ +/** String 0 @{*/ +#define CANRX_STRING0_CURRENT_ID (0x521u) +#define CANRX_STRING0_CURRENT_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_VOLTAGE1_ID (0x522u) +#define CANRX_STRING0_VOLTAGE1_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_VOLTAGE2_ID (0x523u) +#define CANRX_STRING0_VOLTAGE2_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_VOLTAGE3_ID (0x524u) +#define CANRX_STRING0_VOLTAGE3_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_TEMPERATURE_ID (0x525u) +#define CANRX_STRING0_TEMPERATURE_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_POWER_ID (0x526u) +#define CANRX_STRING0_POWER_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_CURRENT_COUNTER_ID (0x527u) +#define CANRX_STRING0_CURRENT_COUNTER_PERIOD_ms (CANRX_NOT_PERIODIC) +#define CANRX_STRING0_ENERGY_COUNTER_ID (0x528u) +#define CANRX_STRING0_ENERGY_COUNTER_PERIOD_ms (CANRX_NOT_PERIODIC) +/**@} */ + +/** The Isabellenhuette current sensors use a data length code of 6 */ +#define CANRX_CURRENT_SENSOR_MESSAGES_DLC (6u) + +/* composed Rx messages */ + +/* AXIVION Disable Style Generic-NoUnsafeMacro: These macros MUST only be used + to populate the 'can_rxMessages' array. The type of this array expects data + exactly as it is provided here and therefore these macros are good (for this + and only for this purpose!).*/ +#define CANRX_DEBUG_MESSAGE \ + { \ + .id = CANRX_DEBUG_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = CANRX_DEBUG_PERIOD_ms \ + } + +#define CANRX_SOFTWARE_VERSION_MESSAGE \ + { \ + .id = CANRX_SOFTWARE_VERSION_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = CANRX_SOFTWARE_VERSION_PERIOD_ms \ + } + +#define CANRX_IMD_INFO_MESSAGE \ + { \ + .id = CANRX_IMD_INFO_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = CANRX_NOT_PERIODIC \ + } + +#define CANRX_IMD_RESPONSE_MESSAGE \ + { \ + .id = CANRX_IMD_RESPONSE_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = CANRX_NOT_PERIODIC \ + } + +#define CANRX_BMS_STATE_REQUEST_MESSAGE \ + { \ + .id = CANRX_BMS_STATE_REQUEST_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_BMS_STATE_REQUEST_PERIOD_ms \ + } + +#define CANRX_SOFTWARE_RESET_MESSAGE \ + { \ + .id = CANRX_SOFTWARE_RESET_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = CANRX_SOFTWARE_RESET_PERIOD_ms \ + } + +#define CANRX_STRING0_CURRENT_MESSAGE \ + { \ + .id = CANRX_STRING0_CURRENT_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_CURRENT_PERIOD_ms \ + } + +#define CANRX_STRING0_VOLTAGE1_MESSAGE \ + { \ + .id = CANRX_STRING0_VOLTAGE1_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_VOLTAGE1_PERIOD_ms \ + } + +#define CANRX_STRING0_VOLTAGE2_MESSAGE \ + { \ + .id = CANRX_STRING0_VOLTAGE2_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_VOLTAGE2_PERIOD_ms \ + } + +#define CANRX_STRING0_VOLTAGE3_MESSAGE \ + { \ + .id = CANRX_STRING0_VOLTAGE3_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_VOLTAGE3_PERIOD_ms \ + } + +#define CANRX_STRING0_TEMPERATURE_MESSAGE \ + { \ + .id = CANRX_STRING0_TEMPERATURE_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_TEMPERATURE_PERIOD_ms \ + } + +#define CANRX_STRING0_POWER_MESSAGE \ + { \ + .id = CANRX_STRING0_POWER_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_POWER_PERIOD_ms \ + } + +#define CANRX_STRING0_CURRENT_COUNTER_MESSAGE \ + { \ + .id = CANRX_STRING0_CURRENT_COUNTER_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_CURRENT_COUNTER_PERIOD_ms \ + } + +#define CANRX_STRING0_ENERGY_COUNTER_MESSAGE \ + { \ + .id = CANRX_STRING0_ENERGY_COUNTER_ID, \ + .dlc = CANRX_CURRENT_SENSOR_MESSAGES_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANRX_STRING0_ENERGY_COUNTER_PERIOD_ms \ + } +/* AXIVION Enable Style Generic-NoUnsafeMacro */ + +/*========== Extern Constant and Variable Declarations ======================*/ + +/*========== Extern Function Prototypes =====================================*/ + +/*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ + +#endif /* FOXBMS__CAN_CFG_RX_MESSAGE_DEFINITIONS_H_ */ diff --git a/src/app/driver/config/can_cfg_rx.c b/src/app/driver/config/can_cfg_rx.c new file mode 100644 index 00000000..61c67a57 --- /dev/null +++ b/src/app/driver/config/can_cfg_rx.c @@ -0,0 +1,103 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cfg_rx.c + * @author foxBMS Team + * @date 2019-12-04 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVERS_CONFIGURATION + * @prefix CANRX + * + * @brief Configuration for the CAN module + * + * @details The CAN bus settings and the received messages and their reception + * handling are to be specified here. + * + * + */ + +/*========== Includes =======================================================*/ +#include "can_cfg.h" + +#include "can_cbs_rx.h" +#include "can_cfg_rx-message-definitions.h" +#include "database.h" +#include "ftask.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/** registry of CAN RX messages */ +const CAN_RX_MESSAGE_TYPE_s can_rxMessages[] = { + {CAN_NODE_IMD, CANRX_IMD_INFO_MESSAGE, &CANRX_ImdInfo}, + {CAN_NODE_IMD, CANRX_IMD_RESPONSE_MESSAGE, &CANRX_ImdResponse}, + {CAN_NODE_1, CANRX_BMS_STATE_REQUEST_MESSAGE, &CANRX_BmsStateRequest}, + {CAN_NODE_1, CANRX_SOFTWARE_RESET_MESSAGE, &CANRX_SoftwareReset}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_CURRENT_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_VOLTAGE1_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_VOLTAGE2_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_VOLTAGE3_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_TEMPERATURE_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_POWER_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_CURRENT_COUNTER_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_CURRENT_SENSOR, CANRX_STRING0_ENERGY_COUNTER_MESSAGE, &CANRX_CurrentSensor}, + {CAN_NODE_1, CANRX_DEBUG_MESSAGE, &CANRX_Debug}, + {CAN_NODE_1, CANRX_SOFTWARE_VERSION_MESSAGE, &CANRX_SoftwareVersion}, +}; + +/** length of CAN message arrays */ +const uint8_t can_rxLength = sizeof(can_rxMessages) / sizeof(can_rxMessages[0]); + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ +#ifdef UNITY_UNIT_TEST + +#endif diff --git a/src/app/driver/config/can_cfg_tx-message-definitions.h b/src/app/driver/config/can_cfg_tx-message-definitions.h new file mode 100644 index 00000000..d3cbba6f --- /dev/null +++ b/src/app/driver/config/can_cfg_tx-message-definitions.h @@ -0,0 +1,316 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cfg_tx-message-definitions.h + * @author foxBMS Team + * @date 2022-07-01 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVERS + * @prefix CANTX + * + * @brief Header for the driver for the CAN module + * + */ + +#ifndef FOXBMS__CAN_CFG_TX_MESSAGE_DEFINITIONS_H_ +#define FOXBMS__CAN_CFG_TX_MESSAGE_DEFINITIONS_H_ + +/*========== Includes =======================================================*/ +#include "can_cfg.h" + +/*========== Macros and Definitions =========================================*/ +#define CANTX_NOT_PERIODIC (0u) + +/* Message IDs */ + +/** CAN message ID for boot message */ +#define CANTX_BOOT_ID (0x199u) /* check_ids silence: CANTX_BOOT_ID */ +/** Periodicity of boot messages in ms */ +#define CANTX_BOOT_PERIOD_ms (CANTX_NOT_PERIODIC) /* dummy */ +#define CANTX_BOOT_PHASE_ms (0u) /* dummy */ +#define CANTX_BOOT_MESSAGE (-1) /* dummy */ + +/** CAN message ID for die ID message */ +#define CANTX_DIE_ID_ID (0x227u) /* mark as dummy but it is not src/app/driver/config/can_cfg_tx_boot-message.c */ +/** Periodicity of die ID messages in ms */ +#define CANTX_DIE_ID_PERIOD_ms (CANTX_NOT_PERIODIC) /* dummy */ +#define CANTX_DIE_ID_PHASE_ms (0u) /* dummy */ +#define CANTX_DIE_ID_MESSAGE (-1) /* dummy */ + +/** CAN message ID to send state */ +#define CANTX_BMS_STATE_ID (0x220u) +/** Periodicity of CAN state messages in ms */ +#define CANTX_BMS_STATE_PERIOD_ms (100u) +/** Phase of CAN state messages in ms */ +#define CANTX_BMS_STATE_PHASE_ms (0u) + +/** CAN message ID to send detail state */ +#define CANTX_BMS_STATE_DETAILS_ID (0x226u) +/** Periodicity of CAN detail state messages in ms */ +#define CANTX_BMS_STATE_DETAILS_PERIOD_ms (1000u) +/** Phase of CAN detail state messages in ms */ +#define CANTX_BMS_STATE_DETAILS_PHASE_ms (100u) + +/** CAN message ID to send voltages */ +#define CANTX_CELL_VOLTAGES_ID (0x240u) +/** Periodicity of CAN voltage messages in ms */ +#define CANTX_CELL_VOLTAGES_PERIOD_ms (100u) +/** Phase of CAN voltage messages in ms */ +#define CANTX_CELL_VOLTAGES_PHASE_ms (10u) + +/** CAN message ID to send temperatures */ +#define CANTX_CELL_TEMPERATURES_ID (0x250u) +/** Periodicity of CAN temperature messages in ms */ +#define CANTX_CELL_TEMPERATURES_PERIOD_ms (200u) +/** Phase of CAN temperature messages in ms */ +#define CANTX_CELL_TEMPERATURES_PHASE_ms (20u) + +/** CAN message ID to send limit values */ +#define CANTX_LIMIT_VALUES_ID (0x224u) +/** Periodicity of CAN limit messages in ms */ +#define CANTX_LIMIT_VALUES_PERIOD_ms (100u) +/** Phase of CAN limit messages in ms */ +#define CANTX_LIMIT_VALUES_PHASE_ms (30u) + +/** CAN message ID to send minimum and maximum values */ +#define CANTX_MINIMUM_MAXIMUM_VALUES_ID (0x223u) +/** Periodicity of CAN minimum and maximum value messages in ms */ +#define CANTX_MINIMUM_MAXIMUM_VALUES_PERIOD_ms (100u) +/** Phase of CAN minimum and maximum value messages in ms */ +#define CANTX_MINIMUM_MAXIMUM_VALUES_PHASE_ms (40u) + +/** CAN message ID to send pack state estimation values */ +#define CANTX_PACK_STATE_ESTIMATION_ID (0x225u) +/** Periodicity of CAN pack state estimation messages in ms */ +#define CANTX_PACK_STATE_ESTIMATION_PERIOD_ms (1000u) +/** Phase of CAN pack state estimation messages in ms */ +#define CANTX_PACK_STATE_ESTIMATION_PHASE_ms (50u) + +/** CAN message ID to send pack values */ +#define CANTX_PACK_VALUES_ID (0x222u) +/** Periodicity of CAN pack values messages in ms */ +#define CANTX_PACK_VALUES_PERIOD_ms (100u) +/** Phase of CAN pack values messages in ms */ +#define CANTX_PACK_VALUES_PHASE_ms (60u) + +/** TX messages - string related */ + +/** CAN message ID to send string state */ +#define CANTX_STRING_STATE_ID (0x221u) +/** Periodicity of CAN string state messages in ms */ +#define CANTX_STRING_STATE_PERIOD_ms (100u) +/** Phase of CAN string state messages in ms */ +#define CANTX_STRING_STATE_PHASE_ms (70u) + +/** CAN message ID to send string values */ +#define CANTX_STRING_VALUES_P0_ID (0x280u) +/** Periodicity of CAN string state messages in ms */ +#define CANTX_STRING_VALUES_P0_PERIOD_ms (100u) +/** Phase of CAN string state messages in ms */ +#define CANTX_STRING_VALUES_P0_PHASE_ms (80u) + +/** CAN message ID to send string minimum and maximum values */ +#define CANTX_STRING_MIN_MAX_VALUES_ID (0x281u) +/** Periodicity of CAN string state messages in ms */ +#define CANTX_STRING_MIN_MAX_VALUES_PERIOD_ms (100u) +/** Phase of CAN string state messages in ms */ +#define CANTX_STRING_MIN_MAX_VALUES_PHASE_ms (90u) + +/** CAN message ID to send string minimum and maximum values */ +#define CANTX_STRING_STATE_ESTIMATION_ID (0x282u) +/** Periodicity of CAN string state messages in ms */ +#define CANTX_STRING_STATE_ESTIMATION_PERIOD_ms (1000u) +/** Phase of CAN string state messages in ms */ +#define CANTX_STRING_STATE_ESTIMATION_PHASE_ms (0u) + +/** CAN message ID to send string values 2 */ +#define CANTX_STRING_VALUES_P1_ID (0x283u) +/** Periodicity of CAN string state messages in ms */ +#define CANTX_STRING_VALUES_P1_PERIOD_ms (100u) +/** Phase of CAN string state messages in ms */ +#define CANTX_STRING_VALUES_P1_PHASE_ms (10u) + +/* composed Tx messages */ + +/* AXIVION Disable Style Generic-NoUnsafeMacro: These macros MUST only be used + to populate the 'can_txMessages' array. The type of this array expects data + exactly as it is provided here and therefore these macros are good (for this + and only for this purpose!).*/ +#define CANTX_BMS_STATE_MESSAGE \ + { \ + .dlc = CAN_DEFAULT_DLC, \ + .id = CANTX_BMS_STATE_ID, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_BMS_STATE_PERIOD_ms, .phase = CANTX_BMS_STATE_PHASE_ms \ + } + +#define CANTX_BMS_STATE_DETAILS_MESSAGE \ + { \ + .id = CANTX_BMS_STATE_DETAILS_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_BMS_STATE_DETAILS_PERIOD_ms, .phase = CANTX_BMS_STATE_DETAILS_PHASE_ms \ + } + +#define CANTX_CELL_VOLTAGES_MESSAGE \ + { \ + .id = CANTX_CELL_VOLTAGES_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_CELL_VOLTAGES_PERIOD_ms, .phase = CANTX_CELL_VOLTAGES_PHASE_ms \ + } + +#define CANTX_MINIMUM_MAXIMUM_VALUES_MESSAGE \ + { \ + .id = CANTX_MINIMUM_MAXIMUM_VALUES_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_MINIMUM_MAXIMUM_VALUES_PERIOD_ms, .phase = CANTX_MINIMUM_MAXIMUM_VALUES_PHASE_ms \ + } + +#define CANTX_LIMIT_VALUES_MESSAGE \ + { \ + .id = CANTX_LIMIT_VALUES_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_LIMIT_VALUES_PERIOD_ms, .phase = CANTX_LIMIT_VALUES_PHASE_ms \ + } + +#define CANTX_CELL_TEMPERATURES_MESSAGE \ + { \ + .id = CANTX_CELL_TEMPERATURES_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_CELL_TEMPERATURES_PERIOD_ms, .phase = CANTX_CELL_TEMPERATURES_PHASE_ms \ + } + +#define CANTX_PACK_STATE_ESTIMATION_MESSAGE \ + { \ + .id = CANTX_PACK_STATE_ESTIMATION_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_PACK_STATE_ESTIMATION_PERIOD_ms, .phase = CANTX_PACK_STATE_ESTIMATION_PHASE_ms \ + } + +#define CANTX_PACK_VALUES_MESSAGE \ + { \ + .id = CANTX_PACK_VALUES_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_PACK_VALUES_PERIOD_ms, .phase = CANTX_PACK_VALUES_PHASE_ms \ + } + +#define CANTX_STRING_STATE_MESSAGE \ + { \ + .id = CANTX_STRING_STATE_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_STRING_STATE_PERIOD_ms, .phase = CANTX_STRING_STATE_PHASE_ms \ + } + +#define CANTX_STRING_VALUES_P0_MESSAGE \ + { \ + .id = CANTX_STRING_VALUES_P0_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_STRING_VALUES_P0_PERIOD_ms, .phase = CANTX_STRING_VALUES_P0_PHASE_ms \ + } + +#define CANTX_STRING_VALUES_P1_MESSAGE \ + { \ + .id = CANTX_STRING_VALUES_P1_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_STRING_VALUES_P1_PERIOD_ms, .phase = CANTX_STRING_VALUES_P1_PHASE_ms \ + } + +#define CANTX_STRING_MIN_MAX_VALUES_MESSAGE \ + { \ + .id = CANTX_STRING_MIN_MAX_VALUES_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_STRING_MIN_MAX_VALUES_PERIOD_ms, .phase = CANTX_STRING_MIN_MAX_VALUES_PHASE_ms \ + } + +#define CANTX_STRING_STATE_ESTIMATION_MESSAGE \ + { \ + .id = CANTX_STRING_STATE_ESTIMATION_ID, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_BIG_ENDIAN, \ + }, \ + { \ + .period = CANTX_STRING_STATE_ESTIMATION_PERIOD_ms, .phase = CANTX_STRING_STATE_ESTIMATION_PHASE_ms \ + } +/* AXIVION Enable Style Generic-NoUnsafeMacro */ + +/*========== Extern Constant and Variable Declarations ======================*/ + +/*========== Extern Function Prototypes =====================================*/ + +/*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ + +#endif /* FOXBMS__CAN_CFG_TX_MESSAGE_DEFINITIONS_H_ */ diff --git a/src/app/driver/config/can_cfg_tx.c b/src/app/driver/config/can_cfg_tx.c new file mode 100644 index 00000000..67ba8693 --- /dev/null +++ b/src/app/driver/config/can_cfg_tx.c @@ -0,0 +1,111 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cfg_tx.c + * @author foxBMS Team + * @date 2019-12-04 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVERS_CONFIGURATION + * @prefix CANTX + * + * @brief Configuration for the CAN module + * + * @details The CAN bus settings and the transmitted messages and their + * reception handling are to be specified here. + * + * + */ + +/*========== Includes =======================================================*/ +#include "can_cfg.h" + +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" +#include "database.h" +#include "ftask.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/** Multiplexer values @{*/ +static uint8_t cantx_voltagesMux = 0u; +static uint8_t cantx_temperaturesMux = 0u; +static uint8_t cantx_stringStateMux = 0u; +static uint8_t cantx_stringValuesP0Mux = 0u; +static uint8_t cantx_stringMinMaxMux = 0u; +static uint8_t cantx_stringStateEstimationMux = 0u; +static uint8_t cantx_stringValuesP1Mux = 0u; +/**@}*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/** registry of CAN TX messages */ +const CAN_TX_MESSAGE_TYPE_s can_txMessages[] = { + {CAN_NODE_1, CANTX_BMS_STATE_MESSAGE, &CANTX_BmsState, NULL_PTR}, + {CAN_NODE_1, CANTX_BMS_STATE_DETAILS_MESSAGE, &CANTX_BmsStateDetails, NULL_PTR}, + {CAN_NODE_1, CANTX_CELL_VOLTAGES_MESSAGE, &CANTX_CellVoltages, &cantx_voltagesMux}, + {CAN_NODE_1, CANTX_CELL_TEMPERATURES_MESSAGE, &CANTX_CellTemperatures, &cantx_temperaturesMux}, + {CAN_NODE_1, CANTX_LIMIT_VALUES_MESSAGE, &CANTX_LimitValues, NULL_PTR}, + {CAN_NODE_1, CANTX_MINIMUM_MAXIMUM_VALUES_MESSAGE, &CANTX_MinimumMaximumValues, NULL_PTR}, + {CAN_NODE_1, CANTX_PACK_STATE_ESTIMATION_MESSAGE, &CANTX_PackStateEstimation, NULL_PTR}, + {CAN_NODE_1, CANTX_PACK_VALUES_MESSAGE, &CANTX_PackValues, NULL_PTR}, + {CAN_NODE_1, CANTX_STRING_STATE_MESSAGE, &CANTX_StringState, &cantx_stringStateMux}, + {CAN_NODE_1, CANTX_STRING_MIN_MAX_VALUES_MESSAGE, &CANTX_StringMinimumMaximumValues, &cantx_stringMinMaxMux}, + {CAN_NODE_1, CANTX_STRING_STATE_ESTIMATION_MESSAGE, &CANTX_StringStateEstimation, &cantx_stringStateEstimationMux}, + {CAN_NODE_1, CANTX_STRING_VALUES_P0_MESSAGE, &CANTX_StringValuesP0, &cantx_stringValuesP0Mux}, + {CAN_NODE_1, CANTX_STRING_VALUES_P1_MESSAGE, &CANTX_StringValuesP1, &cantx_stringValuesP1Mux}, +}; + +/** length of CAN message arrays */ +const uint8_t can_txLength = sizeof(can_txMessages) / sizeof(can_txMessages[0]); + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ +#ifdef UNITY_UNIT_TEST +#endif diff --git a/src/app/driver/config/can_cfg_tx_boot-message.c b/src/app/driver/config/can_cfg_tx_boot-message.c new file mode 100644 index 00000000..42d1107c --- /dev/null +++ b/src/app/driver/config/can_cfg_tx_boot-message.c @@ -0,0 +1,175 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cfg_tx_boot-message.c + * @author foxBMS Team + * @date 2019-12-04 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup DRIVERS + * @prefix CANTX + * + * @brief Driver for the CAN module + * + * @details Implementation of the CAN Interrupts, initialization, buffers, + * receive and transmit interfaces. + */ + +/*========== Includes =======================================================*/ +#include "can_cfg_tx_boot-message.h" + +#include "version_cfg.h" + +#include "HL_het.h" +#include "HL_reg_system.h" + +#include "can.h" +#include "can_cfg_tx-message-definitions.h" +#include "can_helper.h" +#include "database.h" +#include "foxmath.h" +#include "ftask.h" + +/*========== Macros and Definitions =========================================*/ +/** maximum distance from release that can be encoded in the boot message */ +#define CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE (31u) +#if CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE > UINT8_MAX +#error "This code assumes that the define is smaller or equal to UINT8_MAX") +#endif + +/** bit position of boot message byte 3 version control flag */ +#define CANTX_BOOT_MESSAGE_BYTE_3_BIT_VERSION_CONTROL (0u) + +/** bit position of boot message byte 3 dirty flag */ +#define CANTX_BOOT_MESSAGE_BYTE_3_BIT_DIRTY_FLAG (1u) + +/** bit position of boot message byte 3 release distance overflow flag */ +#define CANTX_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_OVERFLOW_FLAG (2u) + +/** bit position of boot message byte 3 release distance counter */ +#define CANTX_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_COUNTER (3u) + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +extern STD_RETURN_TYPE_e CANTX_TransmitBootMessage(void) { + uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))}; + + /* Set major number */ + data[CAN_BYTE_0_POSITION] = ver_foxbmsVersionInformation.major; + /* Set minor number */ + data[CAN_BYTE_1_POSITION] = ver_foxbmsVersionInformation.minor; + /* Set patch number */ + data[CAN_BYTE_2_POSITION] = ver_foxbmsVersionInformation.patch; + + /* intermediate variable for message byte 3 */ + uint8_t versionControlByte = 0u; + + /* Set version control flags */ + if (ver_foxbmsVersionInformation.underVersionControl == true) { + versionControlByte |= (0x01u << CANTX_BOOT_MESSAGE_BYTE_3_BIT_VERSION_CONTROL); + } + if (ver_foxbmsVersionInformation.isDirty == true) { + versionControlByte |= (0x01u << CANTX_BOOT_MESSAGE_BYTE_3_BIT_DIRTY_FLAG); + } + /* Set overflow flag (if release distance is larger than 31) */ + if (ver_foxbmsVersionInformation.distanceFromLastRelease > CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE) { + /* we need to set the overflow flag */ + versionControlByte |= (0x01u << CANTX_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_OVERFLOW_FLAG); + } + + /* Set release distance (capped to maximum value) */ + const uint8_t distanceCapped = (uint8_t)MATH_MinimumOfTwoUint16_t( + ver_foxbmsVersionInformation.distanceFromLastRelease, (uint16_t)CANTX_BOOT_MESSAGE_MAXIMUM_RELEASE_DISTANCE); + versionControlByte |= (distanceCapped << CANTX_BOOT_MESSAGE_BYTE_3_BIT_DISTANCE_COUNTER); + + /* assign assembled byte to data byte */ + data[CAN_BYTE_3_POSITION] = versionControlByte; + + /* Read out device register with unique ID */ + const uint32_t deviceRegister = systemREG1->DEVID; + + /* Set unique ID */ + data[CAN_BYTE_4_POSITION] = (uint8_t)((deviceRegister >> 24u) & 0xFFu); + data[CAN_BYTE_5_POSITION] = (uint8_t)((deviceRegister >> 16u) & 0xFFu); + data[CAN_BYTE_6_POSITION] = (uint8_t)((deviceRegister >> 8u) & 0xFFu); + data[CAN_BYTE_7_POSITION] = (uint8_t)(deviceRegister & 0xFFu); + + STD_RETURN_TYPE_e retval = CAN_DataSend(CAN_NODE_1, CANTX_BOOT_ID, &data[0]); + + return retval; +} + +extern STD_RETURN_TYPE_e CANTX_TransmitDieId(void) { + uint8_t data[] = {GEN_REPEAT_U(0u, GEN_STRIP(CAN_MAX_DLC))}; + + /* Read out device register with die ID low and high */ + const uint32_t dieIdLow = systemREG1->DIEIDL; + const uint32_t dieIdHigh = systemREG1->DIEIDH; + + /* set die ID */ + /* AXIVION Disable Style Generic-NoMagicNumbers: The magic numbers are used to divide down the registers into the CAN message */ + data[CAN_BYTE_0_POSITION] = (uint8_t)((dieIdHigh >> 24u) & 0xFFu); + data[CAN_BYTE_1_POSITION] = (uint8_t)((dieIdHigh >> 16u) & 0xFFu); + data[CAN_BYTE_2_POSITION] = (uint8_t)((dieIdHigh >> 8u) & 0xFFu); + data[CAN_BYTE_3_POSITION] = (uint8_t)(dieIdHigh & 0xFFu); + data[CAN_BYTE_4_POSITION] = (uint8_t)((dieIdLow >> 24u) & 0xFFu); + data[CAN_BYTE_5_POSITION] = (uint8_t)((dieIdLow >> 16u) & 0xFFu); + data[CAN_BYTE_6_POSITION] = (uint8_t)((dieIdLow >> 8u) & 0xFFu); + data[CAN_BYTE_7_POSITION] = (uint8_t)(dieIdLow & 0xFFu); + /* AXIVION Enable Style Generic-NoMagicNumbers: */ + + STD_RETURN_TYPE_e retval = CAN_DataSend(CAN_NODE_1, CANTX_DIE_ID_ID, &data[0]); + + return retval; +} + +/*========== Getter for static Variables (Unit Test) ========================*/ + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/src/app/driver/config/can_cfg_tx_boot-message.h b/src/app/driver/config/can_cfg_tx_boot-message.h new file mode 100644 index 00000000..ca915cb0 --- /dev/null +++ b/src/app/driver/config/can_cfg_tx_boot-message.h @@ -0,0 +1,80 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file can_cfg_tx_boot-message.h + * @author foxBMS Team + * @date 2022-07-01 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup SOME_GROUP + * @prefix CANTX + * + * @brief Header file of some software + * + */ + +#ifndef FOXBMS__CAN_CFG_TX_BOOT_MESSAGE_H_ +#define FOXBMS__CAN_CFG_TX_BOOT_MESSAGE_H_ + +/*========== Includes =======================================================*/ +#include "general.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Extern Constant and Variable Declarations ======================*/ + +/*========== Extern Function Prototypes =====================================*/ +/** + * @brief Transmit startup boot message + * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK + */ +extern STD_RETURN_TYPE_e CANTX_TransmitBootMessage(void); + +/** + * @brief Transmit chip id + * @return #STD_OK if transmission successful, otherwise #STD_NOT_OK + */ +extern STD_RETURN_TYPE_e CANTX_TransmitDieId(void); + +/*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ + +#endif /* FOXBMS__CAN_CFG_TX_BOOT_MESSAGE_H_ */ diff --git a/src/app/driver/config/contactor_cfg.c b/src/app/driver/config/contactor_cfg.c index a49ae5ce..ae7f3a00 100644 --- a/src/app/driver/config/contactor_cfg.c +++ b/src/app/driver/config/contactor_cfg.c @@ -43,8 +43,8 @@ * @file contactor_cfg.c * @author foxBMS Team * @date 2020-02-11 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONF * @prefix CONT * @@ -55,15 +55,37 @@ /*========== Includes =======================================================*/ #include "contactor_cfg.h" +#include "sps_cfg.h" + /*========== Macros and Definitions =========================================*/ /*========== Static Constant and Variable Definitions =======================*/ /*========== Extern Constant and Variable Definitions =======================*/ CONT_CONTACTOR_STATE_s cont_contactorStates[BS_NR_OF_CONTACTORS] = { - {CONT_SWITCH_OFF, CONT_SWITCH_OFF, CONT_FEEDBACK_THROUGH_CURRENT, 0u, CONT_STRING0_PLUS}, - {CONT_SWITCH_OFF, CONT_SWITCH_OFF, CONT_FEEDBACK_THROUGH_CURRENT, 1u, CONT_STRING0_MINUS}, - {CONT_SWITCH_OFF, CONT_SWITCH_OFF, CONT_FEEDBACK_THROUGH_CURRENT, 2u, CONT_PRECHARGE}, + /* String contactors configuration */ + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_FEEDBACK_NORMALLY_OPEN, + BS_STRING0, + CONT_PLUS, + SPS_CHANNEL_0, + CONT_CHARGING_DIRECTION}, + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_FEEDBACK_NORMALLY_OPEN, + BS_STRING0, + CONT_MINUS, + SPS_CHANNEL_1, + CONT_DISCHARGING_DIRECTION}, + /* Precharge contactor configuration */ + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_HAS_NO_FEEDBACK, + BS_STRING0, + CONT_PRECHARGE, + SPS_CHANNEL_2, + CONT_BIDIRECTIONAL}, }; /*========== Static Function Prototypes =====================================*/ diff --git a/src/app/driver/config/contactor_cfg.h b/src/app/driver/config/contactor_cfg.h index 9e5b259c..c6fa328d 100644 --- a/src/app/driver/config/contactor_cfg.h +++ b/src/app/driver/config/contactor_cfg.h @@ -43,8 +43,8 @@ * @file contactor_cfg.h * @author foxBMS Team * @date 2020-02-11 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix CONT * @@ -64,27 +64,14 @@ /*========== Macros and Definitions =========================================*/ -/*================== Main precharge configuration ====================*/ - /*========== Extern Constant and Variable Declarations ======================*/ /** Symbolic names for the possible states of the contactors */ typedef enum { - CONT_SWITCH_OFF, /*!< Contactor off --> Contactor is open */ - CONT_SWITCH_ON, /*!< Contactor on --> Contactor is closed */ - CONT_SWITCH_UNDEF, /*!< Contactor undefined --> Contactor state not known */ + CONT_SWITCH_OFF, /*!< Contactor off --> Contactor is open */ + CONT_SWITCH_ON, /*!< Contactor on --> Contactor is closed */ + CONT_SWITCH_UNDEFINED, /*!< Contactor undefined --> Contactor state not known */ } CONT_ELECTRICAL_STATE_TYPE_e; -/** Symbolic names for the contactors */ -typedef enum { - CONT_STRING0_PLUS, /*!< Contactor in string0 plus path */ - CONT_STRING0_MINUS, /*!< Contactor in string0 minus path */ - CONT_STRING1_PLUS, /*!< Contactor in string1 plus path */ - CONT_STRING1_MINUS, /*!< Contactor in string1 minus path */ - CONT_STRING2_PLUS, /*!< Contactor in string2 plus path */ - CONT_STRING2_MINUS, /*!< Contactor in string2 minus path */ - CONT_PRECHARGE, /*!< Precharge contactor */ -} CONT_NAMES_e; - /** Symbolic names defining the electric behavior of the contactor */ typedef enum { CONT_FEEDBACK_NORMALLY_OPEN, /*!< Feedback line of a contactor is normally open */ @@ -93,21 +80,45 @@ typedef enum { CONT_HAS_NO_FEEDBACK, /*!< Feedback line of the contactor is not used */ } CONT_FEEDBACK_TYPE_e; +/** Contactor type */ +typedef enum { + CONT_PLUS, /*!< Contactor is placed in HV plus path */ + CONT_MINUS, /*!< Contactor is placed in HV minus path */ + CONT_PRECHARGE, /*!< Contactor is used as precharge contactor, installed as a plus contactor */ + CONT_UNDEFINED, /*!< Undefined contactor */ +} CONT_TYPE_e; + +/** + * Some contactors are designed and optimized to open current that is flowing + * in one direction to provide maximum current breaking capability. This + * direction is then dependent on how the contactors are installed withing the + * battery system. If bidirectional contactors are used, the main power + * terminals can be connected in either direction and the current breaking + * capability is the same for both directions. + */ +typedef enum { + CONT_CHARGING_DIRECTION, /*!< Contactor is preferred opened in charge current direction */ + CONT_DISCHARGING_DIRECTION, /*!< Contactor is preferred opened in discharge current direction */ + CONT_BIDIRECTIONAL, /*!< Contactor has no preferred way of being opened depending on the current flow */ +} CONT_CURRENT_BREAKING_DIRECTION_e; + /** Status struct for a registry of all contactors */ typedef struct { CONT_ELECTRICAL_STATE_TYPE_e currentSet; /*!< current setpoint for the contactor */ CONT_ELECTRICAL_STATE_TYPE_e feedback; /*!< feedback from the contactor */ const CONT_FEEDBACK_TYPE_e feedbackPinType; /*!< type of feedback that the contactor uses */ + const BS_STRING_ID_e stringIndex; /*!< index in which string the contactor is placed */ + const CONT_TYPE_e type; /*!< type of contactor */ const SPS_CHANNEL_INDEX spsChannel; /*!< channel index of the SPS to which this contactor is connected */ - const CONT_NAMES_e name; /*!< name of the contactor */ + const CONT_CURRENT_BREAKING_DIRECTION_e breakingDirection; /*!< preferred contactor opening direction */ } CONT_CONTACTOR_STATE_s; -/** central state registry of all contactors of the system */ -extern CONT_CONTACTOR_STATE_s cont_contactorStates[BS_NR_OF_CONTACTORS]; - /** index number of the contactor array; not to be confused with #SPS_CHANNEL_INDEX */ typedef uint8_t CONT_CONTACTOR_INDEX; +/** central state registry of all contactors of the system */ +extern CONT_CONTACTOR_STATE_s cont_contactorStates[BS_NR_OF_CONTACTORS]; + /*========== Extern Function Prototypes =====================================*/ /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ diff --git a/src/app/driver/config/dma_cfg.c b/src/app/driver/config/dma_cfg.c index ee861a6e..42325795 100644 --- a/src/app/driver/config/dma_cfg.c +++ b/src/app/driver/config/dma_cfg.c @@ -43,8 +43,8 @@ * @file dma_cfg.c * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix DMA * diff --git a/src/app/driver/config/dma_cfg.h b/src/app/driver/config/dma_cfg.h index fb350efc..37ae35cb 100644 --- a/src/app/driver/config/dma_cfg.h +++ b/src/app/driver/config/dma_cfg.h @@ -43,8 +43,8 @@ * @file dma_cfg.h * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix DMA * diff --git a/src/app/driver/config/fram_cfg.c b/src/app/driver/config/fram_cfg.c index 06d6558f..98a95669 100644 --- a/src/app/driver/config/fram_cfg.c +++ b/src/app/driver/config/fram_cfg.c @@ -43,8 +43,8 @@ * @file fram_cfg.c * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix FRAM * diff --git a/src/app/driver/config/fram_cfg.h b/src/app/driver/config/fram_cfg.h index dbedb71d..b0476b22 100644 --- a/src/app/driver/config/fram_cfg.h +++ b/src/app/driver/config/fram_cfg.h @@ -43,8 +43,8 @@ * @file fram_cfg.h * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FRAM * diff --git a/src/app/driver/config/interlock_cfg.c b/src/app/driver/config/interlock_cfg.c index 3ccbe1ed..d6a8a250 100644 --- a/src/app/driver/config/interlock_cfg.c +++ b/src/app/driver/config/interlock_cfg.c @@ -43,8 +43,8 @@ * @file interlock_cfg.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix CONT * diff --git a/src/app/driver/config/interlock_cfg.h b/src/app/driver/config/interlock_cfg.h index 71d3f9e8..b5993823 100644 --- a/src/app/driver/config/interlock_cfg.h +++ b/src/app/driver/config/interlock_cfg.h @@ -43,8 +43,8 @@ * @file interlock_cfg.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix ILCK * diff --git a/src/app/driver/config/nxpfs85xx_cfg.c b/src/app/driver/config/nxpfs85xx_cfg.c index 07ff49f9..3dbbc0f8 100644 --- a/src/app/driver/config/nxpfs85xx_cfg.c +++ b/src/app/driver/config/nxpfs85xx_cfg.c @@ -43,8 +43,8 @@ * @file nxpfs85xx_cfg.c * @author foxBMS Team * @date 2020-03-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix SBC * diff --git a/src/app/driver/config/nxpfs85xx_cfg.h b/src/app/driver/config/nxpfs85xx_cfg.h index 1dec0080..de9272e7 100644 --- a/src/app/driver/config/nxpfs85xx_cfg.h +++ b/src/app/driver/config/nxpfs85xx_cfg.h @@ -43,8 +43,8 @@ * @file nxpfs85xx_cfg.h * @author foxBMS Team * @date 2020-03-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix SBC * diff --git a/src/app/driver/config/pex_cfg.c b/src/app/driver/config/pex_cfg.c index 16b9d431..a041ecc5 100644 --- a/src/app/driver/config/pex_cfg.c +++ b/src/app/driver/config/pex_cfg.c @@ -43,8 +43,8 @@ * @file pex_cfg.c * @author foxBMS Team * @date 2021-08-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix PEX * diff --git a/src/app/driver/config/pex_cfg.h b/src/app/driver/config/pex_cfg.h index a26dc3e6..4a000eed 100644 --- a/src/app/driver/config/pex_cfg.h +++ b/src/app/driver/config/pex_cfg.h @@ -43,8 +43,8 @@ * @file pex_cfg.h * @author foxBMS Team * @date 2021-08-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix PEX * diff --git a/src/app/driver/config/spi_cfg.c b/src/app/driver/config/spi_cfg.c index 53ee5c29..f075fb6d 100644 --- a/src/app/driver/config/spi_cfg.c +++ b/src/app/driver/config/spi_cfg.c @@ -43,8 +43,8 @@ * @file spi_cfg.c * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix SPI * diff --git a/src/app/driver/config/spi_cfg.h b/src/app/driver/config/spi_cfg.h index 3d063a57..a97ae029 100644 --- a/src/app/driver/config/spi_cfg.h +++ b/src/app/driver/config/spi_cfg.h @@ -43,8 +43,8 @@ * @file spi_cfg.h * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix SPI * diff --git a/src/app/driver/config/sps_cfg.c b/src/app/driver/config/sps_cfg.c index 91065939..831063e9 100644 --- a/src/app/driver/config/sps_cfg.c +++ b/src/app/driver/config/sps_cfg.c @@ -43,8 +43,8 @@ * @file sps_cfg.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONF * @prefix SPS * diff --git a/src/app/driver/config/sps_cfg.h b/src/app/driver/config/sps_cfg.h index ca3f22cc..55c37bb5 100644 --- a/src/app/driver/config/sps_cfg.h +++ b/src/app/driver/config/sps_cfg.h @@ -43,8 +43,8 @@ * @file sps_cfg.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONF * @prefix SPS * @@ -82,6 +82,17 @@ /** Number of SPS IC that are populated on the hardware (in daisy-chain) */ #define SPS_NR_OF_IC (2u) +/** Defines for the individual SPS channels @{ */ +#define SPS_CHANNEL_0 ((SPS_CHANNEL_INDEX)0) +#define SPS_CHANNEL_1 ((SPS_CHANNEL_INDEX)1) +#define SPS_CHANNEL_2 ((SPS_CHANNEL_INDEX)2) +#define SPS_CHANNEL_3 ((SPS_CHANNEL_INDEX)3) +#define SPS_CHANNEL_4 ((SPS_CHANNEL_INDEX)4) +#define SPS_CHANNEL_5 ((SPS_CHANNEL_INDEX)5) +#define SPS_CHANNEL_6 ((SPS_CHANNEL_INDEX)6) +#define SPS_CHANNEL_7 ((SPS_CHANNEL_INDEX)7) +/**@}*/ + /** One channel for each contactor is required in this application */ #define SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS (BS_NR_OF_CONTACTORS) @@ -110,12 +121,12 @@ #define SPS_C_CONTROL_REGISTER_ADDRESS (0x16u) /**@}*/ /** Addresses of used diagnostic registers @{ */ -#define SPS_OD_IOUT1_DIAG_REGISTER_ADDRESS (0x08u) -#define SPS_OD_IOUT2_DIAG_REGISTER_ADDRESS (0x09u) -#define SPS_OD_IOUT3_DIAG_REGISTER_ADDRESS (0x0Au) -#define SPS_OD_IOUT4_DIAG_REGISTER_ADDRESS (0x0Bu) -#define SPS_EN_IRQ_PIN_DIAG_REGISTER_ADDRESS (0x11u) -#define SPS_EN_WARN_PIN_DIAG_REGISTER_ADDRESS (0x13u) +#define SPS_ISR_IRQ_DIAG_REGISTER_ADDRESS (0x06u) +#define SPS_ISR_WARN_DIAG_REGISTER_ADDRESS (0x07u) +#define SPS_OD_IOUT1_DIAG_REGISTER_ADDRESS (0x08u) +#define SPS_OD_IOUT2_DIAG_REGISTER_ADDRESS (0x09u) +#define SPS_OD_IOUT3_DIAG_REGISTER_ADDRESS (0x0Au) +#define SPS_OD_IOUT4_DIAG_REGISTER_ADDRESS (0x0Bu) /**@}*/ /** diff --git a/src/app/driver/config/tsi_plausibility_cfg.h b/src/app/driver/config/tsi_plausibility_cfg.h index 8015ed70..b9c8220b 100644 --- a/src/app/driver/config/tsi_plausibility_cfg.h +++ b/src/app/driver/config/tsi_plausibility_cfg.h @@ -43,8 +43,8 @@ * @file tsi_plausibility_cfg.h * @author foxBMS Team * @date 2019-01-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup MODULES * @prefix TSI * diff --git a/src/app/driver/contactor/contactor.c b/src/app/driver/contactor/contactor.c index 88edfe7b..e4e76c8e 100644 --- a/src/app/driver/contactor/contactor.c +++ b/src/app/driver/contactor/contactor.c @@ -43,8 +43,8 @@ * @file contactor.c * @author foxBMS Team * @date 2020-02-11 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CONT * @@ -55,6 +55,7 @@ /*========== Includes =======================================================*/ #include "contactor.h" +#include "diag.h" #include "mcu.h" #include "sps.h" @@ -66,237 +67,181 @@ /*========== Static Function Prototypes =====================================*/ /** - * @brief Resolves the contactor index from a contactor name - * @details Searches in the contactor index by iteration from front to back for - * the contactor name and returns the first hit. - * @param[in] name Name of the contactor - * @returns index number of the entry in the contactor array + * @brief Reads the feedback of all contactors + * @details Gathers the feedback of all contactors from the configured feedback + * source (#CONT_FEEDBACK_TYPE_e). If #CONT_HAS_NO_FEEDBACK is + * configured,it is assumed that the contactor has reached the + * requested state. */ -static CONT_CONTACTOR_INDEX CONT_ResolveContactorName(const CONT_NAMES_e name); - -/** - * @brief Gets the contactor name from a contactor index - * @param[in] index index number of the contactor - * @returns Returns the name of the contactor - */ -static CONT_NAMES_e CONT_GetContactorName(const CONT_CONTACTOR_INDEX index); - -/** - * @brief Returns the sps channel index from a contactor index - * @details Currently this implementation maps simply in ascending order - */ -static SPS_CHANNEL_INDEX CONT_GetSpsChannelIndexFromContactor(const CONT_CONTACTOR_INDEX contactor); - -/** - * @brief Sets SPS channels according to contactors - * @details Currently this implementation assumes simple ascending order. - * @param[in] contactor index of the contactor that should be set - */ -static void CONT_SetSpsChannelFromContactor(const CONT_CONTACTOR_INDEX contactor); +static void CONT_GetFeedbackOfAllContactors(void); /** conducts an initialization test of the contactor registry and asserts at failure */ static void CONT_InitializationCheckOfContactorRegistry(void); /*========== Static Function Implementations ================================*/ -static CONT_CONTACTOR_INDEX CONT_ResolveContactorName(const CONT_NAMES_e name) { - CONT_CONTACTOR_INDEX contactor = 0u; - bool hit = false; - do { - if (name == cont_contactorStates[contactor].name) { - /* contactor found, therefore abort */ - hit = true; - } else { - /* continue and increase contactor counter */ - contactor++; - } - } while ((contactor < BS_NR_OF_CONTACTORS) && (true != hit)); - - /* an unknown contactor may not exist */ - FAS_ASSERT(hit == true); - - return contactor; -} - -static CONT_NAMES_e CONT_GetContactorName(const CONT_CONTACTOR_INDEX index) { - FAS_ASSERT(index < BS_NR_OF_CONTACTORS); - return cont_contactorStates[index].name; -} - -static SPS_CHANNEL_INDEX CONT_GetSpsChannelIndexFromContactor(const CONT_CONTACTOR_INDEX contactor) { - FAS_ASSERT(contactor < BS_NR_OF_CONTACTORS); - return cont_contactorStates[contactor].spsChannel; -} - -static void CONT_SetSpsChannelFromContactor(const CONT_CONTACTOR_INDEX contactor) { - FAS_ASSERT(contactor < BS_NR_OF_CONTACTORS); - switch (cont_contactorStates[contactor].currentSet) { - case CONT_SWITCH_UNDEF: - case CONT_SWITCH_OFF: - SPS_RequestContactorState(CONT_GetSpsChannelIndexFromContactor(contactor), SPS_CHANNEL_OFF); - break; - case CONT_SWITCH_ON: - SPS_RequestContactorState(CONT_GetSpsChannelIndexFromContactor(contactor), SPS_CHANNEL_ON); - break; - default: - FAS_ASSERT(FAS_TRAP); - break; - } -} - -static void CONT_InitializationCheckOfContactorRegistry(void) { - /* iterate over each contactor and compare found name with resolved name (if a name is used double this would - always return the first entry and we would have the second entry from iterating here) */ - for (CONT_CONTACTOR_INDEX contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { - const CONT_CONTACTOR_INDEX resolvedContactor = CONT_ResolveContactorName(cont_contactorStates[contactor].name); - FAS_ASSERT(contactor == resolvedContactor); - const CONT_NAMES_e contactorName = CONT_GetContactorName(contactor); - FAS_ASSERT(cont_contactorStates[contactor].name == contactorName); - - /* convention at the moment: sps channel index has to be the same as contactor index; this may change in - future implementations */ - FAS_ASSERT(contactor == cont_contactorStates[contactor].spsChannel); - - /* every contactor channel has to be affiliated with contactor */ - const SPS_CHANNEL_AFFILIATION_e channelAffiliation = - SPS_GetChannelAffiliation(cont_contactorStates[contactor].spsChannel); - FAS_ASSERT(SPS_AFF_CONTACTOR == channelAffiliation); - } -} - -/*========== Extern Function Implementations ================================*/ -extern CONT_ELECTRICAL_STATE_TYPE_e CONT_GetContactorSetValue(const CONT_NAMES_e name) { - CONT_CONTACTOR_INDEX contactorNumber = CONT_ResolveContactorName(name); - CONT_ELECTRICAL_STATE_TYPE_e contactorSetInformation = cont_contactorStates[contactorNumber].currentSet; - return contactorSetInformation; -} - -extern void CONT_GetContactorFeedback(void) { +static void CONT_GetFeedbackOfAllContactors(void) { + /* Iterate over all contactors */ for (CONT_CONTACTOR_INDEX contactor = 0; contactor < BS_NR_OF_CONTACTORS; contactor++) { - if (CONT_HAS_NO_FEEDBACK == cont_contactorStates[contactor].feedbackPinType) { + /* Use different feedback sources depending on the individual contactor configuration */ + if (cont_contactorStates[contactor].feedbackPinType == CONT_HAS_NO_FEEDBACK) { /* no feedback: assume set value is true */ cont_contactorStates[contactor].feedback = cont_contactorStates[contactor].currentSet; - } else if (CONT_FEEDBACK_THROUGH_CURRENT == cont_contactorStates[contactor].feedbackPinType) { + } else if (cont_contactorStates[contactor].feedbackPinType == CONT_FEEDBACK_THROUGH_CURRENT) { /* feedback from current: ask SPS driver for feedback */ cont_contactorStates[contactor].feedback = - SPS_GetChannelCurrentFeedback(CONT_GetSpsChannelIndexFromContactor(contactor)); + SPS_GetChannelCurrentFeedback(cont_contactorStates[contactor].spsChannel); } else if (CONT_FEEDBACK_NORMALLY_OPEN == cont_contactorStates[contactor].feedbackPinType) { cont_contactorStates[contactor].feedback = - SPS_GetChannelPexFeedback(CONT_GetSpsChannelIndexFromContactor(contactor), true); + SPS_GetChannelPexFeedback(cont_contactorStates[contactor].spsChannel, true); } else { /* CONT_FEEDBACK_NORMALLY_CLOSED */ cont_contactorStates[contactor].feedback = - SPS_GetChannelPexFeedback(CONT_GetSpsChannelIndexFromContactor(contactor), false); + SPS_GetChannelPexFeedback(cont_contactorStates[contactor].spsChannel, false); } } } -extern STD_RETURN_TYPE_e CONT_SetContactorState( - const CONT_NAMES_e name, - CONT_ELECTRICAL_STATE_TYPE_e requestedContactorState) { - CONT_CONTACTOR_INDEX contactor = CONT_ResolveContactorName(name); - FAS_ASSERT(contactor < BS_NR_OF_CONTACTORS); - FAS_ASSERT( - (requestedContactorState == CONT_SWITCH_OFF) || (requestedContactorState == CONT_SWITCH_ON) || - (requestedContactorState == CONT_SWITCH_UNDEF)); +static void CONT_InitializationCheckOfContactorRegistry(void) { + /* Iterate over each contactor and compare found name with resolved name (if a name is used double this would + always return the first entry and we would have the second entry from iterating here) */ + for (CONT_CONTACTOR_INDEX contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { + /* TODO: add check that only one contactor of each type is configured for each string */ - STD_RETURN_TYPE_e retVal = STD_OK; + /* Check that a configured SPS channel number is not higher than the number of available SPS channels */ + FAS_ASSERT(cont_contactorStates[contactor].spsChannel < SPS_NR_OF_AVAILABLE_SPS_CHANNELS); - if (requestedContactorState == CONT_SWITCH_ON) { - cont_contactorStates[contactor].currentSet = CONT_SWITCH_ON; - } else if (requestedContactorState == CONT_SWITCH_OFF) { - cont_contactorStates[contactor].currentSet = CONT_SWITCH_OFF; - } else { - retVal = STD_NOT_OK; + /* every contactor channel has to be affiliated with contactor */ + const SPS_CHANNEL_AFFILIATION_e channelAffiliation = + SPS_GetChannelAffiliation(cont_contactorStates[contactor].spsChannel); + FAS_ASSERT(SPS_AFF_CONTACTOR == channelAffiliation); } - - CONT_SetSpsChannelFromContactor(contactor); - - return retVal; } -/** - * @brief checks the feedback of the contactors - * - * @details makes a DIAG entry for each contactor when the feedback does not match the set value - */ +/*========== Extern Function Implementations ================================*/ extern void CONT_CheckFeedback(void) { - CONT_GetContactorFeedback(); - /* TODO implement when contactor feedback is available */ + /* Get the feedback from all contactors from the configured feedback sources */ + CONT_GetFeedbackOfAllContactors(); + /* Check the contactor feedback */ + for (CONT_CONTACTOR_INDEX contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { + /* TODO: add check that only one contactor of each type is configured for each string */ + DIAG_EVENT_e feedbackStatus = DIAG_EVENT_NOT_OK; + if (cont_contactorStates[contactor].currentSet == cont_contactorStates[contactor].feedback) { + /* Set feedback status to okay, if expected and actual contactor state match */ + feedbackStatus = DIAG_EVENT_OK; + } + switch (cont_contactorStates[contactor].type) { + case CONT_PLUS: + DIAG_Handler( + DIAG_ID_STRING_PLUS_CONTACTOR_FEEDBACK, + feedbackStatus, + DIAG_STRING, + (uint8_t)cont_contactorStates[contactor].stringIndex); + break; + case CONT_MINUS: + DIAG_Handler( + DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, + feedbackStatus, + DIAG_STRING, + (uint8_t)cont_contactorStates[contactor].stringIndex); + break; + case CONT_PRECHARGE: + DIAG_Handler( + DIAG_ID_PRECHARGE_CONTACTOR_FEEDBACK, + feedbackStatus, + DIAG_STRING, + (uint8_t)cont_contactorStates[contactor].stringIndex); + break; + default: + /* Type: CONT_UNDEFINED -> trap */ + FAS_ASSERT(FAS_TRAP); + } + } } -extern STD_RETURN_TYPE_e CONT_CloseString(uint8_t stringNumber) { +extern STD_RETURN_TYPE_e CONT_OpenContactor(uint8_t stringNumber, CONT_TYPE_e contactor) { FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); - /* String contactors in the list start at index 0 - * so string number corresponds to contactor index - */ - return CONT_SetContactorState(CONT_GetContactorName(stringNumber), CONT_SWITCH_ON); + FAS_ASSERT(contactor != CONT_UNDEFINED); + STD_RETURN_TYPE_e retval = STD_NOT_OK; + /* Iterate over contactor array, find the correct one and request state change via SPS module */ + for (uint8_t contactorIndex = 0u; contactorIndex < BS_NR_OF_CONTACTORS; contactorIndex++) { + if (((BS_STRING_ID_e)stringNumber == cont_contactorStates[contactorIndex].stringIndex) && + (contactor == cont_contactorStates[contactorIndex].type)) { + /* Set set state in cont_contactorStates array */ + cont_contactorStates[contactorIndex].currentSet = CONT_SWITCH_OFF; + /* Request contactor state via SPS module */ + SPS_RequestContactorState(cont_contactorStates[contactorIndex].spsChannel, SPS_CHANNEL_OFF); + retval = STD_OK; + break; + } + } + return retval; } -extern STD_RETURN_TYPE_e CONT_OpenString(uint8_t stringNumber) { +extern STD_RETURN_TYPE_e CONT_CloseContactor(uint8_t stringNumber, CONT_TYPE_e contactor) { FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); - /* String contactors in the list start at index 0 - * so string number corresponds to contactor index - */ - /* TODO: implement current check and similar when opening */ - return CONT_SetContactorState(CONT_GetContactorName(stringNumber), CONT_SWITCH_OFF); + FAS_ASSERT(contactor != CONT_UNDEFINED); + STD_RETURN_TYPE_e retval = STD_NOT_OK; + /* Iterate over contactor array, find the correct one and request state change via SPS module */ + for (uint8_t contactorIndex = 0u; contactorIndex < BS_NR_OF_CONTACTORS; contactorIndex++) { + if (((BS_STRING_ID_e)stringNumber == cont_contactorStates[contactorIndex].stringIndex) && + (contactor == cont_contactorStates[contactorIndex].type)) { + /* Set set state in cont_contactorStates array */ + cont_contactorStates[contactorIndex].currentSet = CONT_SWITCH_ON; + /* Request contactor state via SPS module */ + SPS_RequestContactorState(cont_contactorStates[contactorIndex].spsChannel, SPS_CHANNEL_ON); + retval = STD_OK; + break; + } + } + return retval; } extern STD_RETURN_TYPE_e CONT_ClosePrecharge(uint8_t stringNumber) { FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); - STD_RETURN_TYPE_e retVal = STD_NOT_OK; - uint8_t prechargeContactorNumber = 0u; - FAS_STATIC_ASSERT((BS_NR_OF_STRINGS <= (uint8_t)UINT8_MAX), "This code assumes BS_NR_OF_STRINGS fits into uint8_t"); - - /* Precharge contactors in the list stay after string contactors - * so it has index (number of contactors)-1 - */ + STD_RETURN_TYPE_e retVal = STD_NOT_OK; + /* Check if passed string has configured a precharge contactor */ if (bs_stringsWithPrecharge[stringNumber] == BS_STRING_WITH_PRECHARGE) { - /* Find contactor number corresponding to precharge of the requested string */ - for (uint8_t stringPrechargeNumber = 0u; stringPrechargeNumber < BS_NR_OF_STRINGS; stringPrechargeNumber++) { - if (bs_stringsWithPrecharge[stringPrechargeNumber] == BS_STRING_WITH_PRECHARGE) { - if (stringPrechargeNumber == stringNumber) { - break; - } - prechargeContactorNumber++; - } - } - if ((BS_NR_OF_STRINGS + prechargeContactorNumber) < BS_NR_OF_CONTACTORS) { - retVal = CONT_SetContactorState( - CONT_GetContactorName(BS_NR_OF_STRINGS + prechargeContactorNumber), CONT_SWITCH_ON); - } + retVal = CONT_CloseContactor(stringNumber, CONT_PRECHARGE); } return retVal; } extern STD_RETURN_TYPE_e CONT_OpenPrecharge(uint8_t stringNumber) { FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); - STD_RETURN_TYPE_e retVal = STD_NOT_OK; - uint8_t prechargeContactorNumber = 0u; - - /* Precharge contactors in the list stay after string contactors - * so it has index (number of contactors)-1 - */ + STD_RETURN_TYPE_e retVal = STD_NOT_OK; + /* Check if passed string has configured a precharge contactor */ if (bs_stringsWithPrecharge[stringNumber] == BS_STRING_WITH_PRECHARGE) { - /* Find contactor number corresponding to precharge of the requested string */ - for (uint8_t stringPrechargeNumber = 0u; stringPrechargeNumber < BS_NR_OF_STRINGS; stringPrechargeNumber++) { - if (bs_stringsWithPrecharge[stringPrechargeNumber] == BS_STRING_WITH_PRECHARGE) { - if (stringPrechargeNumber == stringNumber) { - break; - } - prechargeContactorNumber++; - } - } - if ((BS_NR_OF_STRINGS + prechargeContactorNumber) < BS_NR_OF_CONTACTORS) { - retVal = CONT_SetContactorState( - CONT_GetContactorName(BS_NR_OF_STRINGS + prechargeContactorNumber), CONT_SWITCH_OFF); - } + retVal = CONT_OpenContactor(stringNumber, CONT_PRECHARGE); } return retVal; } -extern CONT_ELECTRICAL_STATE_TYPE_e CONT_GetState(uint8_t contactorNumber) { - FAS_ASSERT(contactorNumber < BS_NR_OF_CONTACTORS); - return (cont_contactorStates[contactorNumber].feedback); +extern void CONT_OpenAllPrechargeContactors(void) { + /* Iterate over all contactors and open all precharge contactors */ + for (uint8_t contactorIndex = 0u; contactorIndex < BS_NR_OF_CONTACTORS; contactorIndex++) { + /* Set off a request to open all precharge contactors regardless of + * their current state as we want to reach a safe state */ + if (cont_contactorStates[contactorIndex].type == CONT_PRECHARGE) { + /* Request opening via SPS module */ + SPS_RequestContactorState(cont_contactorStates[contactorIndex].spsChannel, SPS_CHANNEL_OFF); + cont_contactorStates[contactorIndex].currentSet = CONT_SWITCH_OFF; + } + } +} + +extern CONT_ELECTRICAL_STATE_TYPE_e CONT_GetContactorState(uint8_t stringNumber, CONT_TYPE_e contactorType) { + FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); + FAS_ASSERT(contactorType != CONT_UNDEFINED); + CONT_ELECTRICAL_STATE_TYPE_e feedback = CONT_SWITCH_UNDEFINED; + /* Iterate over all contactors and return the requested feedback */ + for (uint8_t contactorIndex = 0u; contactorIndex < BS_NR_OF_CONTACTORS; contactorIndex++) { + if ((cont_contactorStates[contactorIndex].stringIndex == (BS_STRING_ID_e)stringNumber) && + (contactorType == cont_contactorStates[contactorIndex].type)) { + feedback = cont_contactorStates[contactorIndex].feedback; + break; + } + } + return feedback; } extern void CONT_Initialize(void) { @@ -308,7 +253,4 @@ extern void CONT_Initialize(void) { extern void TEST_CONT_InitializationCheckOfContactorRegistry() { CONT_InitializationCheckOfContactorRegistry(); } -extern CONT_CONTACTOR_INDEX TEST_CONT_ResolveContactorName(const CONT_NAMES_e name) { - return CONT_ResolveContactorName(name); -} #endif /* UNITY_UNIT_TEST */ diff --git a/src/app/driver/contactor/contactor.h b/src/app/driver/contactor/contactor.h index 14e59cec..8063d842 100644 --- a/src/app/driver/contactor/contactor.h +++ b/src/app/driver/contactor/contactor.h @@ -43,8 +43,8 @@ * @file contactor.h * @author foxBMS Team * @date 2020-02-11 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CONT * @@ -63,82 +63,37 @@ /*========== Extern Constant and Variable Declarations ======================*/ /*========== Extern Function Prototypes =====================================*/ - -/** - * @brief Gets the latest value the contactors were set to. - * @param[in] name name of the contactor - * @return returns CONT_SWITCH_OFF or CONT_SWITCH_ON - */ -extern CONT_ELECTRICAL_STATE_TYPE_e CONT_GetContactorSetValue(const CONT_NAMES_e name); - -/** - * @brief Reads the feedback pin of every contactor and returns its current - * value (#CONT_SWITCH_OFF/#CONT_SWITCH_ON). - * @details If the contactor has a feedback pin the measured feedback is - * returned. If the contactor has no feedback pin, it is assumed that - * after a certain time the contactor has reached the requested state. - */ -void CONT_GetContactorFeedback(void); - /** - * @brief Sets the contactor state to its requested state, if the contactor - * is at that time not in the requested state. - * @details If the new state was already requested, but not reached (meaning - * the measured feedback does not return the requested state), there - * are two states: it can be still ok (#STD_OK), because the contactor - * has some time left to get physically in the requested state (passed - * time since the request is lower than the limit) or it can be not ok - * (#STD_NOT_OK), because there is timing violation, i.e. the - * contactor has surpassed the maximum time for getting in the - * requested state. It returns #STD_OK if the requested state was - * successfully set or if the contactor was at the requested state - * before. - * @param name - * @param requestedContactorState - * @return retVal (type: STD_RETURN_TYPE_e) - */ -extern STD_RETURN_TYPE_e CONT_SetContactorState( - const CONT_NAMES_e name, - CONT_ELECTRICAL_STATE_TYPE_e requestedContactorState); - -/** @brief Substates of the CONT state machine */ -typedef enum { - CONT_ENTRY, - CONT_SET_EDGE_LOW_INIT, - CONT_SET_EDGE_HIGH, - CONT_SET_EDGE_LOW, - CONT_CHECK_REQUESTS, -} CONT_STATEMACH_SUB_e; - -/** - * @brief Gets the current state. + * @brief Returns the current contactor state. * @details This function is used in the functioning of the CONT state machine. - * @param contactorNumber contactor to be addressed + * @param stringNumber string in which the contactor is placed + * @param contactorType contactor type for which the feedback is requested * @return current state, taken from #CONT_ELECTRICAL_STATE_TYPE_e */ -extern CONT_ELECTRICAL_STATE_TYPE_e CONT_GetState(uint8_t contactorNumber); +extern CONT_ELECTRICAL_STATE_TYPE_e CONT_GetContactorState(uint8_t stringNumber, CONT_TYPE_e contactorType); /** - * @brief Closes the contactor of a string. - * @details This function makes a close state request to the contactor of a - * specific string. + * @brief Opens the contactor + * @details This function makes an open state request to the specific contactor * @param stringNumber String addressed + * @param contactor contactor adressed */ -extern STD_RETURN_TYPE_e CONT_CloseString(uint8_t stringNumber); +extern STD_RETURN_TYPE_e CONT_OpenContactor(uint8_t stringNumber, CONT_TYPE_e contactor); /** - * @brief Opens the contactor of a string. - * @details This function makes an open state request to the contactor of a - * specific string. + * @brief Closes the contactor + * @details This function makes an close state request to the specific contactor * @param stringNumber String addressed + * @param contactor contactor adressed */ -extern STD_RETURN_TYPE_e CONT_OpenString(uint8_t stringNumber); +extern STD_RETURN_TYPE_e CONT_CloseContactor(uint8_t stringNumber, CONT_TYPE_e contactor); /** * @brief Closes precharge. * @details This function makes a close state request to the precharge * contactor. * @param stringNumber String addressed + * @return #STD_OK if requested contactor exists and close requested, otherwise #STD_NOT_OK */ extern STD_RETURN_TYPE_e CONT_ClosePrecharge(uint8_t stringNumber); @@ -151,7 +106,15 @@ extern STD_RETURN_TYPE_e CONT_ClosePrecharge(uint8_t stringNumber); extern STD_RETURN_TYPE_e CONT_OpenPrecharge(uint8_t stringNumber); /** - * @brief checks the feedback of the contactors + * @brief Open all currently closed precharge contactors + * @details This function iterates over all contactors and opens all currently + * closed precharge contactors + * @return none (void) + */ +extern void CONT_OpenAllPrechargeContactors(void); + +/** + * @brief checks the feedback of all contactors * @details makes a DIAG entry for each contactor when the feedback does not * match the set value */ @@ -165,7 +128,6 @@ extern void CONT_Initialize(void); /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ #ifdef UNITY_UNIT_TEST extern void TEST_CONT_InitializationCheckOfContactorRegistry(void); -extern CONT_CONTACTOR_INDEX TEST_CONT_ResolveContactorName(const CONT_NAMES_e name); #endif /* UNITY_UNIT_TEST */ #endif /* FOXBMS__CONTACTOR_H_ */ diff --git a/src/app/driver/crc/crc.c b/src/app/driver/crc/crc.c index 5c64ea11..0c1d5ed2 100644 --- a/src/app/driver/crc/crc.c +++ b/src/app/driver/crc/crc.c @@ -43,8 +43,8 @@ * @file crc.c * @author foxBMS Team * @date 2022-02-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CRC * diff --git a/src/app/driver/crc/crc.h b/src/app/driver/crc/crc.h index cf586a46..9d0faf42 100644 --- a/src/app/driver/crc/crc.h +++ b/src/app/driver/crc/crc.h @@ -43,8 +43,8 @@ * @file crc.h * @author foxBMS Team * @date 2022-02-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix CRC * diff --git a/src/app/driver/dma/dma.c b/src/app/driver/dma/dma.c index ac0e4fcc..c000f7d7 100644 --- a/src/app/driver/dma/dma.c +++ b/src/app/driver/dma/dma.c @@ -43,8 +43,8 @@ * @file dma.c * @author foxBMS Team * @date 2019-12-12 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix DMA * diff --git a/src/app/driver/dma/dma.h b/src/app/driver/dma/dma.h index f7390e32..349f18cd 100644 --- a/src/app/driver/dma/dma.h +++ b/src/app/driver/dma/dma.h @@ -43,8 +43,8 @@ * @file dma.h * @author foxBMS Team * @date 2019-12-12 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix DMA * diff --git a/src/app/driver/foxmath/foxmath.c b/src/app/driver/foxmath/foxmath.c index aad83043..a3a96ea1 100644 --- a/src/app/driver/foxmath/foxmath.c +++ b/src/app/driver/foxmath/foxmath.c @@ -43,8 +43,8 @@ * @file foxmath.c * @author foxBMS Team * @date 2018-01-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MATH * diff --git a/src/app/driver/foxmath/foxmath.h b/src/app/driver/foxmath/foxmath.h index 26665425..64ea2d44 100644 --- a/src/app/driver/foxmath/foxmath.h +++ b/src/app/driver/foxmath/foxmath.h @@ -43,8 +43,8 @@ * @file foxmath.h * @author foxBMS Team * @date 2018-01-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MATH * diff --git a/src/app/driver/fram/fram.c b/src/app/driver/fram/fram.c index 08be0488..82334afd 100644 --- a/src/app/driver/fram/fram.c +++ b/src/app/driver/fram/fram.c @@ -43,8 +43,8 @@ * @file fram.c * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FRAM * diff --git a/src/app/driver/fram/fram.h b/src/app/driver/fram/fram.h index 09beb2cd..e3d2f157 100644 --- a/src/app/driver/fram/fram.h +++ b/src/app/driver/fram/fram.h @@ -43,8 +43,8 @@ * @file fram.h * @author foxBMS Team * @date 2020-03-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FRAM * diff --git a/src/app/driver/htsensor/htsensor.c b/src/app/driver/htsensor/htsensor.c index 4a9a0e24..b5abe9d3 100644 --- a/src/app/driver/htsensor/htsensor.c +++ b/src/app/driver/htsensor/htsensor.c @@ -43,8 +43,8 @@ * @file htsensor.c * @author foxBMS Team * @date 2021-08-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix HTSEN * diff --git a/src/app/driver/htsensor/htsensor.h b/src/app/driver/htsensor/htsensor.h index 58123964..0cb1a662 100644 --- a/src/app/driver/htsensor/htsensor.h +++ b/src/app/driver/htsensor/htsensor.h @@ -43,8 +43,8 @@ * @file htsensor.h * @author foxBMS Team * @date 2021-08-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix HTSEN * diff --git a/src/app/driver/i2c/i2c.c b/src/app/driver/i2c/i2c.c index 9ac541eb..d718d8e7 100644 --- a/src/app/driver/i2c/i2c.c +++ b/src/app/driver/i2c/i2c.c @@ -43,8 +43,8 @@ * @file i2c.c * @author foxBMS Team * @date 2021-07-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix I2C * diff --git a/src/app/driver/i2c/i2c.h b/src/app/driver/i2c/i2c.h index 98ba6534..5c869b89 100644 --- a/src/app/driver/i2c/i2c.h +++ b/src/app/driver/i2c/i2c.h @@ -43,8 +43,8 @@ * @file i2c.h * @author foxBMS Team * @date 2021-07-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix I2C * diff --git a/src/app/driver/imd/bender/ir155/bender_ir155.c b/src/app/driver/imd/bender/ir155/bender_ir155.c index abebfc14..c588cf0a 100644 --- a/src/app/driver/imd/bender/ir155/bender_ir155.c +++ b/src/app/driver/imd/bender/ir155/bender_ir155.c @@ -43,8 +43,8 @@ * @file bender_ir155.c * @author foxBMS Team * @date 2014-02-11 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IR155 * diff --git a/src/app/driver/imd/bender/ir155/bender_ir155.h b/src/app/driver/imd/bender/ir155/bender_ir155.h index ca4ba07b..92b41087 100644 --- a/src/app/driver/imd/bender/ir155/bender_ir155.h +++ b/src/app/driver/imd/bender/ir155/bender_ir155.h @@ -43,8 +43,8 @@ * @file bender_ir155.h * @author foxBMS Team * @date 2021-09-06 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IR155 * diff --git a/src/app/driver/imd/bender/ir155/bender_ir155_helper.c b/src/app/driver/imd/bender/ir155/bender_ir155_helper.c index f5578c59..f9f331e6 100644 --- a/src/app/driver/imd/bender/ir155/bender_ir155_helper.c +++ b/src/app/driver/imd/bender/ir155/bender_ir155_helper.c @@ -43,8 +43,8 @@ * @file bender_ir155_helper.c * @author foxBMS Team * @date 2021-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IR155 * diff --git a/src/app/driver/imd/bender/ir155/bender_ir155_helper.h b/src/app/driver/imd/bender/ir155/bender_ir155_helper.h index 717d58d5..354385cb 100644 --- a/src/app/driver/imd/bender/ir155/bender_ir155_helper.h +++ b/src/app/driver/imd/bender/ir155/bender_ir155_helper.h @@ -43,8 +43,8 @@ * @file bender_ir155_helper.h * @author foxBMS Team * @date 2021-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IR155 * diff --git a/src/app/driver/imd/bender/ir155/config/bender_ir155_cfg.h b/src/app/driver/imd/bender/ir155/config/bender_ir155_cfg.h index 773c9e7c..8afb4f0f 100644 --- a/src/app/driver/imd/bender/ir155/config/bender_ir155_cfg.h +++ b/src/app/driver/imd/bender/ir155/config/bender_ir155_cfg.h @@ -43,8 +43,8 @@ * @file bender_ir155_cfg.h * @author foxBMS Team * @date 2021-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix IR155 * diff --git a/src/app/driver/imd/bender/ir155/wscript b/src/app/driver/imd/bender/ir155/wscript index ffdd81f6..78733d84 100644 --- a/src/app/driver/imd/bender/ir155/wscript +++ b/src/app/driver/imd/bender/ir155/wscript @@ -77,6 +77,6 @@ def build(bld): source=source, use="imd-device", includes=includes, - target=f"{bld.env.APPNAME}-imd", + target=f"{bld.env.APPNAME.lower()}-imd", cflags=cflags, ) diff --git a/src/app/driver/imd/bender/iso165c/bender_iso165c.c b/src/app/driver/imd/bender/iso165c/bender_iso165c.c index b642e5b7..7557fe2a 100644 --- a/src/app/driver/imd/bender/iso165c/bender_iso165c.c +++ b/src/app/driver/imd/bender/iso165c/bender_iso165c.c @@ -43,8 +43,8 @@ * @file bender_iso165c.c * @author foxBMS Team * @date 2019-04-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix I165C * @@ -60,6 +60,7 @@ #include "database_cfg.h" #include "can.h" +#include "can_cfg_rx-message-definitions.h" #include "can_helper.h" #include "database.h" #include "ftask.h" @@ -213,8 +214,8 @@ static I165C_DISABLE_STATE_s i165c_disableState = { .receptionTriesMessage = 0u, }; -static CAN_BUFFERELEMENT_s i165c_canTxMessage = {0u}; -static CAN_BUFFERELEMENT_s i165c_canRxMessage = {0u}; +static CAN_BUFFER_ELEMENT_s i165c_canTxMessage = {0u}; +static CAN_BUFFER_ELEMENT_s i165c_canRxMessage = {0u}; /*========== Extern Constant and Variable Definitions =======================*/ @@ -290,7 +291,7 @@ static IMD_FSM_STATES_e I165C_Running(DATA_BLOCK_INSULATION_MONITORING_s *pTable * @details Used before starting a new transmission. * @param[in,out] pCanMessage pointer to CAN data to be reset */ -static void I165C_ResetCanData(CAN_BUFFERELEMENT_s *pCanMessage); +static void I165C_ResetCanData(CAN_BUFFER_ELEMENT_s *pCanMessage); /** * @brief Write data in data word for CAN transmission. @@ -299,7 +300,7 @@ static void I165C_ResetCanData(CAN_BUFFERELEMENT_s *pCanMessage); * @param data data to be written in data word * @param[in] pCanMessage CAN structure to be used for transmission */ -static void I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFERELEMENT_s *pCanMessage); +static void I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFER_ELEMENT_s *pCanMessage); /** * @brief Get data in data word from CAN transmission. @@ -308,7 +309,7 @@ static void I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFERELEME * @param[out] pData pointer where to put read data from data word * @param canMessage CAN structure used for transmission */ -static void I165C_ReadDataWord(uint8_t dataWord, uint16_t *pData, CAN_BUFFERELEMENT_s canMessage); +static void I165C_ReadDataWord(uint8_t dataWord, uint16_t *pData, CAN_BUFFER_ELEMENT_s canMessage); /** * @brief Get data in data word from CAN transmission, for the specific @@ -318,7 +319,7 @@ static void I165C_ReadDataWord(uint8_t dataWord, uint16_t *pData, CAN_BUFFERELEM * @param[out] pData pointer where to put read data from data word * @param canMessage CAN structure used for transmission */ -static void I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *pData, CAN_BUFFERELEMENT_s canMessage); +static void I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *pData, CAN_BUFFER_ELEMENT_s canMessage); /** * @brief Get data in data byte from CAN transmission. @@ -327,7 +328,7 @@ static void I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *pData, CAN_BUF * @param[out] pData pointer where to put read data from data byte * @param canMessage CAN structure used for transmission */ -static void I165C_ReadDataByte(uint8_t dataByte, uint8_t *pData, CAN_BUFFERELEMENT_s canMessage); +static void I165C_ReadDataByte(uint8_t dataByte, uint8_t *pData, CAN_BUFFER_ELEMENT_s canMessage); /** * @brief Compose CAN message for CAN transmission. @@ -337,7 +338,7 @@ static void I165C_ReadDataByte(uint8_t dataByte, uint8_t *pData, CAN_BUFFERELEME * further) * @param[out] pCanMessage pointer to CAN structure to be used for transmission */ -static void I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFERELEMENT_s *pCanMessage); +static void I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFER_ELEMENT_s *pCanMessage); /** * @brief Check if iso165c acknowledged reception of sent message @@ -348,7 +349,7 @@ static void I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFERELEMENT_s *pCa * @param[in] pCanMessage pointer to CAN data sent by the iso165c * @return true if transmission acknowledged, false otherwise */ -static bool I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *pCanMessage); +static bool I165C_CheckResponse(uint8_t command, CAN_BUFFER_ELEMENT_s *pCanMessage); /** * @brief Get IMD Info from iso165c @@ -356,7 +357,7 @@ static bool I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *pCanMessag * @param[in] pCanMessage pointer to CAN data sent by the iso165c * @return true if IMD_Info message was received, false otherwise */ -static bool I165C_GetImdInfo(CAN_BUFFERELEMENT_s *pCanMessage); +static bool I165C_GetImdInfo(CAN_BUFFER_ELEMENT_s *pCanMessage); /** * @brief Check if iso165c was initialized and is running @@ -367,7 +368,7 @@ static bool I165C_GetImdInfo(CAN_BUFFERELEMENT_s *pCanMessage); * @param[in] canMessage IMD_Info to be checked, sent by the iso165c * @return true if IMD_Info was received, false otherwise */ -static bool I165C_IsSelfTestFinished(CAN_BUFFERELEMENT_s canMessage); +static bool I165C_IsSelfTestFinished(CAN_BUFFER_ELEMENT_s canMessage); /** * @brief Check if iso165c has already been performed previously @@ -376,7 +377,7 @@ static bool I165C_IsSelfTestFinished(CAN_BUFFERELEMENT_s canMessage); * @param[in] canMessage IMD_Info to be checked, sent by the iso165c * @return true if self-test has already been executed, false otherwise */ -static bool I165C_HasSelfTestBeenExecuted(CAN_BUFFERELEMENT_s canMessage); +static bool I165C_HasSelfTestBeenExecuted(CAN_BUFFER_ELEMENT_s canMessage); /** * @brief Set state of HV relay @@ -398,7 +399,7 @@ static void I165C_RequestRelayState(uint8_t relay); * @param[in] relayState relay opened or closed * @return true if state matches, otherwise false */ -static bool I165C_CheckRelayState(CAN_BUFFERELEMENT_s canMessage, uint8_t relay, uint8_t relayState); +static bool I165C_CheckRelayState(CAN_BUFFER_ELEMENT_s canMessage, uint8_t relay, uint8_t relayState); /** * @brief Set measurement mode @@ -412,7 +413,7 @@ static void I165C_SetMeasurementMode(uint8_t mode); * @param[in] mode IMD measurement mode (activated or deactivated) * @return true, if measurement mode matches, otherwise false */ -static bool I165C_CheckMeasurementMode(CAN_BUFFERELEMENT_s canMessage, uint8_t mode); +static bool I165C_CheckMeasurementMode(CAN_BUFFER_ELEMENT_s canMessage, uint8_t mode); /** * @brief Set average factor of the insulation resistance averaging algorithm @@ -427,7 +428,7 @@ static void I165C_SetAveragingFactor(uint8_t averagingFactor); * @param[in] pCanMessage pointer to CAN data sent by the iso165c * @return true if Acknowledge has been received, otherwise false */ -static bool I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *pTries, CAN_BUFFERELEMENT_s *pCanMessage); +static bool I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *pTries, CAN_BUFFER_ELEMENT_s *pCanMessage); /*========== Static Function Implementations ================================*/ static void I165C_SetInitializationState( @@ -498,14 +499,14 @@ static void I165C_SetDisableState( } } -static void I165C_ResetCanData(CAN_BUFFERELEMENT_s *pCanMessage) { +static void I165C_ResetCanData(CAN_BUFFER_ELEMENT_s *pCanMessage) { FAS_ASSERT(pCanMessage != NULL_PTR); - for (uint8_t i = 0u; i < CAN_DLC; i++) { + for (uint8_t i = 0u; i < CAN_DEFAULT_DLC; i++) { pCanMessage->data[i] = 0u; } } -static void I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFERELEMENT_s *pCanMessage) { +static void I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFER_ELEMENT_s *pCanMessage) { FAS_ASSERT(pCanMessage != NULL_PTR); /* See data sheet section 6.1 page 15 */ if (dataWord == I165C_DW1) { @@ -518,7 +519,7 @@ static void I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFERELEME } } -static void I165C_ReadDataWord(uint8_t dataWord, uint16_t *pData, CAN_BUFFERELEMENT_s canMessage) { +static void I165C_ReadDataWord(uint8_t dataWord, uint16_t *pData, CAN_BUFFER_ELEMENT_s canMessage) { FAS_ASSERT(pData != NULL_PTR); /* See data sheet section 6.1 page 15 */ if (dataWord == I165C_DW1) { @@ -535,7 +536,7 @@ static void I165C_ReadDataWord(uint8_t dataWord, uint16_t *pData, CAN_BUFFERELEM } } -static void I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *pData, CAN_BUFFERELEMENT_s canMessage) { +static void I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *pData, CAN_BUFFER_ELEMENT_s canMessage) { FAS_ASSERT(pData != NULL_PTR); /* See data sheet section 6.1 page 15 */ if (dataWord == I165C_DW1) { @@ -552,7 +553,7 @@ static void I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *pData, CAN_BUF } } -static void I165C_ReadDataByte(uint8_t dataByte, uint8_t *pData, CAN_BUFFERELEMENT_s canMessage) { +static void I165C_ReadDataByte(uint8_t dataByte, uint8_t *pData, CAN_BUFFER_ELEMENT_s canMessage) { FAS_ASSERT(pData != NULL_PTR); /* See data sheet section 6.1 page 15 */ switch (dataByte) { @@ -574,7 +575,7 @@ static void I165C_ReadDataByte(uint8_t dataByte, uint8_t *pData, CAN_BUFFERELEME } } -static void I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFERELEMENT_s *pCanMessage) { +static void I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFER_ELEMENT_s *pCanMessage) { FAS_ASSERT(pCanMessage != NULL_PTR); /* CAN message is a request, set ID accordingly */ pCanMessage->id = id; @@ -582,7 +583,7 @@ static void I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFERELEMENT_s *pCa pCanMessage->data[CAN_BYTE_0_POSITION] = command; } -static bool I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *pCanMessage) { +static bool I165C_CheckResponse(uint8_t command, CAN_BUFFER_ELEMENT_s *pCanMessage) { FAS_ASSERT(pCanMessage != NULL_PTR); bool messageReceived = false; uint8_t numberItems = 0u; @@ -594,7 +595,7 @@ static bool I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *pCanMessag if (numberItems > 0u) { if (OS_ReceiveFromQueue(ftsk_imdCanDataQueue, (void *)pCanMessage, 0u) == OS_SUCCESS) { /* data queue was no empty */ - if ((command == pCanMessage->data[CAN_BYTE_0_POSITION]) && (pCanMessage->id == CAN_ID_IMD_RESPONSE)) { + if ((command == pCanMessage->data[CAN_BYTE_0_POSITION]) && (pCanMessage->id == CANRX_IMD_RESPONSE_ID)) { messageReceived = true; break; } @@ -606,7 +607,7 @@ static bool I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *pCanMessag return messageReceived; } -static bool I165C_GetImdInfo(CAN_BUFFERELEMENT_s *pCanMessage) { +static bool I165C_GetImdInfo(CAN_BUFFER_ELEMENT_s *pCanMessage) { FAS_ASSERT(pCanMessage != NULL_PTR); bool imdInfoReceived = false; uint8_t numberItems = 0u; @@ -630,7 +631,7 @@ static bool I165C_GetImdInfo(CAN_BUFFERELEMENT_s *pCanMessage) { return imdInfoReceived; } -static bool I165C_IsSelfTestFinished(CAN_BUFFERELEMENT_s canMessage) { +static bool I165C_IsSelfTestFinished(CAN_BUFFER_ELEMENT_s canMessage) { bool initialized = true; uint16_t data = 0u; @@ -669,7 +670,7 @@ static bool I165C_IsSelfTestFinished(CAN_BUFFERELEMENT_s canMessage) { return initialized; } -static bool I165C_HasSelfTestBeenExecuted(CAN_BUFFERELEMENT_s canMessage) { +static bool I165C_HasSelfTestBeenExecuted(CAN_BUFFER_ELEMENT_s canMessage) { bool anySelfTestExecuted = false; uint16_t data = 0u; @@ -715,7 +716,7 @@ static void I165C_RequestRelayState(uint8_t relay) { CAN_DataSend(I165C_CAN_NODE, i165c_canTxMessage.id, i165c_canTxMessage.data); } -static bool I165C_CheckRelayState(CAN_BUFFERELEMENT_s canMessage, uint8_t relay, uint8_t relayState) { +static bool I165C_CheckRelayState(CAN_BUFFER_ELEMENT_s canMessage, uint8_t relay, uint8_t relayState) { FAS_ASSERT((relay == I165C_D_VIFC_HV_RELAIS_NEGATIVE) || (relay == I165C_D_VIFC_HV_RELAIS_POSITIVE)); FAS_ASSERT((relayState == I165C_RELAY_STATE_OPEN) || (relayState == I165C_RELAY_STATE_CLOSED)); bool checkSuccess = true; @@ -748,7 +749,7 @@ static void I165C_SetMeasurementMode(uint8_t mode) { CAN_DataSend(I165C_CAN_NODE, i165c_canTxMessage.id, i165c_canTxMessage.data); } -static bool I165C_CheckMeasurementMode(CAN_BUFFERELEMENT_s canMessage, uint8_t mode) { +static bool I165C_CheckMeasurementMode(CAN_BUFFER_ELEMENT_s canMessage, uint8_t mode) { FAS_ASSERT((mode == I165C_ENABLE_MEASUREMENT) || (mode == I165C_DISABLE_MEASUREMENT)); bool measurementModeMatches = false; uint16_t dVIFCStatus = 0u; @@ -780,7 +781,7 @@ static void I165C_SetAveragingFactor(uint8_t averagingFactor) { CAN_DataSend(I165C_CAN_NODE, i165c_canTxMessage.id, i165c_canTxMessage.data); } -static bool I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *pTries, CAN_BUFFERELEMENT_s *pCanMessage) { +static bool I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *pTries, CAN_BUFFER_ELEMENT_s *pCanMessage) { FAS_ASSERT(pTries != NULL_PTR); FAS_ASSERT(pCanMessage != NULL_PTR); /* AXIVION Routine Generic-MissingParameterAssert: command: parameter accepts whole range */ @@ -1486,34 +1487,34 @@ extern IMD_FSM_STATES_e IMD_ProcessShutdownState(void) { /*========== Externalized Static Function Implementations (Unit Test) =======*/ #ifdef UNITY_UNIT_TEST -extern void TEST_I165C_ResetCanData(CAN_BUFFERELEMENT_s *canMessage) { +extern void TEST_I165C_ResetCanData(CAN_BUFFER_ELEMENT_s *canMessage) { I165C_ResetCanData(canMessage); } -extern void TEST_I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFERELEMENT_s *canMessage) { +extern void TEST_I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFER_ELEMENT_s *canMessage) { I165C_WriteDataWord(dataWord, data, canMessage); } -extern void TEST_I165C_ReadDataWord(uint8_t dataWord, uint16_t *data, CAN_BUFFERELEMENT_s canMessage) { +extern void TEST_I165C_ReadDataWord(uint8_t dataWord, uint16_t *data, CAN_BUFFER_ELEMENT_s canMessage) { I165C_ReadDataWord(dataWord, data, canMessage); } -extern void TEST_I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *data, CAN_BUFFERELEMENT_s canMessage) { +extern void TEST_I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *data, CAN_BUFFER_ELEMENT_s canMessage) { I165C_ReadDataWordImdInfo(dataWord, data, canMessage); } -extern void TEST_I165C_ReadDataByte(uint8_t dataByte, uint8_t *data, CAN_BUFFERELEMENT_s canMessage) { +extern void TEST_I165C_ReadDataByte(uint8_t dataByte, uint8_t *data, CAN_BUFFER_ELEMENT_s canMessage) { I165C_ReadDataByte(dataByte, data, canMessage); } -extern void TEST_I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFERELEMENT_s *canMessage) { +extern void TEST_I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFER_ELEMENT_s *canMessage) { I165C_WriteCmd(id, command, canMessage); } -extern bool TEST_I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *canMessage) { +extern bool TEST_I165C_CheckResponse(uint8_t command, CAN_BUFFER_ELEMENT_s *canMessage) { return I165C_CheckResponse(command, canMessage); } -extern bool TEST_I165C_GetImdInfo(CAN_BUFFERELEMENT_s *canMessage) { +extern bool TEST_I165C_GetImdInfo(CAN_BUFFER_ELEMENT_s *canMessage) { return I165C_GetImdInfo(canMessage); } -extern bool TEST_I165C_IsSelfTestFinished(CAN_BUFFERELEMENT_s canMessage) { +extern bool TEST_I165C_IsSelfTestFinished(CAN_BUFFER_ELEMENT_s canMessage) { return I165C_IsSelfTestFinished(canMessage); } -extern bool TEST_I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *tries, CAN_BUFFERELEMENT_s *canMessage) { +extern bool TEST_I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *tries, CAN_BUFFER_ELEMENT_s *canMessage) { return I165C_CheckAcknowledgeArrived(command, tries, canMessage); } diff --git a/src/app/driver/imd/bender/iso165c/bender_iso165c.h b/src/app/driver/imd/bender/iso165c/bender_iso165c.h index aada1ae1..4b972805 100644 --- a/src/app/driver/imd/bender/iso165c/bender_iso165c.h +++ b/src/app/driver/imd/bender/iso165c/bender_iso165c.h @@ -43,8 +43,8 @@ * @file bender_iso165c.h * @author foxBMS Team * @date 2019-04-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix I165C * @@ -73,16 +73,16 @@ /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ #ifdef UNITY_UNIT_TEST -extern void TEST_I165C_ResetCanData(CAN_BUFFERELEMENT_s *canMessage); -extern void TEST_I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFERELEMENT_s *canMessage); -extern void TEST_I165C_ReadDataWord(uint8_t dataWord, uint16_t *data, CAN_BUFFERELEMENT_s canMessage); -extern void TEST_I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *data, CAN_BUFFERELEMENT_s canMessage); -extern void TEST_I165C_ReadDataByte(uint8_t dataByte, uint8_t *data, CAN_BUFFERELEMENT_s canMessage); -extern void TEST_I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFERELEMENT_s *canMessage); -extern bool TEST_I165C_CheckResponse(uint8_t command, CAN_BUFFERELEMENT_s *canMessage); -extern bool TEST_I165C_GetImdInfo(CAN_BUFFERELEMENT_s *canMessage); -extern bool TEST_I165C_IsSelfTestFinished(CAN_BUFFERELEMENT_s canMessage); -extern bool TEST_I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *tries, CAN_BUFFERELEMENT_s *canMessage); +extern void TEST_I165C_ResetCanData(CAN_BUFFER_ELEMENT_s *canMessage); +extern void TEST_I165C_WriteDataWord(uint8_t dataWord, uint16_t data, CAN_BUFFER_ELEMENT_s *canMessage); +extern void TEST_I165C_ReadDataWord(uint8_t dataWord, uint16_t *data, CAN_BUFFER_ELEMENT_s canMessage); +extern void TEST_I165C_ReadDataWordImdInfo(uint8_t dataWord, uint16_t *data, CAN_BUFFER_ELEMENT_s canMessage); +extern void TEST_I165C_ReadDataByte(uint8_t dataByte, uint8_t *data, CAN_BUFFER_ELEMENT_s canMessage); +extern void TEST_I165C_WriteCmd(uint8_t id, uint8_t command, CAN_BUFFER_ELEMENT_s *canMessage); +extern bool TEST_I165C_CheckResponse(uint8_t command, CAN_BUFFER_ELEMENT_s *canMessage); +extern bool TEST_I165C_GetImdInfo(CAN_BUFFER_ELEMENT_s *canMessage); +extern bool TEST_I165C_IsSelfTestFinished(CAN_BUFFER_ELEMENT_s canMessage); +extern bool TEST_I165C_CheckAcknowledgeArrived(uint8_t command, uint8_t *tries, CAN_BUFFER_ELEMENT_s *canMessage); #endif #endif /* FOXBMS__BENDER_ISO165C_H_ */ diff --git a/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.c b/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.c index 54e1bdb4..abaae62c 100644 --- a/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.c +++ b/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.c @@ -43,8 +43,8 @@ * @file bender_iso165c_cfg.c * @author foxBMS Team * @date 2021-03-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix I165C * diff --git a/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.h b/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.h index 389aae8a..c47bd712 100644 --- a/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.h +++ b/src/app/driver/imd/bender/iso165c/config/bender_iso165c_cfg.h @@ -43,8 +43,8 @@ * @file bender_iso165c_cfg.h * @author foxBMS Team * @date 2021-03-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix I165C * @@ -71,7 +71,7 @@ /*========== Macros and Definitions =========================================*/ /** CAN Node the IMD device is connected to */ -#define I165C_CAN_NODE (CAN1_NODE) +#define I165C_CAN_NODE (CAN_NODE_1) /** Switch if bender iso165C or iso165C-1 is used * true: iso165C @@ -141,11 +141,11 @@ /** type of messages to communicate with I165C */ /** cyclic message, transmitted every second */ -#define I165C_MESSAGETYPE_IMD_INFO (CAN_ID_IMD_INFO) +#define I165C_MESSAGETYPE_IMD_INFO (CANRX_IMD_INFO_ID) /** message for requests (self test, reset, set values...) */ -#define I165C_MESSAGETYPE_IMD_REQUEST (CAN_ID_IMD_REQUEST) +#define I165C_MESSAGETYPE_IMD_REQUEST (CANRX_IMD_REQUEST_ID) /** answer message, always send by I165C when it received a request*/ -#define I165C_MESSAGETYPE_IMD_RESPONSE (CAN_ID_IMD_RESPONSE) +#define I165C_MESSAGETYPE_IMD_RESPONSE (CANRX_IMD_RESPONSE_ID) /** control commands (CTL) */ diff --git a/src/app/driver/imd/bender/iso165c/wscript b/src/app/driver/imd/bender/iso165c/wscript index 62f1136a..04e22da6 100644 --- a/src/app/driver/imd/bender/iso165c/wscript +++ b/src/app/driver/imd/bender/iso165c/wscript @@ -74,6 +74,6 @@ def build(bld): source=source, use="imd-device", includes=includes, - target=f"{bld.env.APPNAME}-imd", + target=f"{bld.env.APPNAME.lower()}-imd", cflags=cflags, ) diff --git a/src/app/driver/imd/imd.c b/src/app/driver/imd/imd.c index 673f4bc9..06dadd72 100644 --- a/src/app/driver/imd/imd.c +++ b/src/app/driver/imd/imd.c @@ -43,8 +43,8 @@ * @file imd.c * @author foxBMS Team * @date 2021-11-04 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IMD * diff --git a/src/app/driver/imd/imd.h b/src/app/driver/imd/imd.h index 8b19627c..9c9c974c 100644 --- a/src/app/driver/imd/imd.h +++ b/src/app/driver/imd/imd.h @@ -43,8 +43,8 @@ * @file imd.h * @author foxBMS Team * @date 2020-11-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IMD * diff --git a/src/app/driver/imd/none/no-imd.c b/src/app/driver/imd/none/no-imd.c index 53c69cad..dc01579f 100644 --- a/src/app/driver/imd/none/no-imd.c +++ b/src/app/driver/imd/none/no-imd.c @@ -43,8 +43,8 @@ * @file no-imd.c * @author foxBMS Team * @date 2020-11-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix NOIMD * diff --git a/src/app/driver/imd/none/no-imd.h b/src/app/driver/imd/none/no-imd.h index 67a2a155..af109923 100644 --- a/src/app/driver/imd/none/no-imd.h +++ b/src/app/driver/imd/none/no-imd.h @@ -43,8 +43,8 @@ * @file no-imd.h * @author foxBMS Team * @date 2020-11-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix NONE * diff --git a/src/app/driver/imd/none/wscript b/src/app/driver/imd/none/wscript index e4eb898d..55a54dba 100644 --- a/src/app/driver/imd/none/wscript +++ b/src/app/driver/imd/none/wscript @@ -68,6 +68,6 @@ def build(bld): source="no-imd.c", use="imd-device", includes=includes, - target=f"{bld.env.APPNAME}-imd", + target=f"{bld.env.APPNAME.lower()}-imd", cflags=cflags, ) diff --git a/src/app/driver/interlock/interlock.c b/src/app/driver/interlock/interlock.c index ca435c10..2aa5253d 100644 --- a/src/app/driver/interlock/interlock.c +++ b/src/app/driver/interlock/interlock.c @@ -43,8 +43,8 @@ * @file interlock.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix ILCK * diff --git a/src/app/driver/interlock/interlock.h b/src/app/driver/interlock/interlock.h index 17974250..0644e87f 100644 --- a/src/app/driver/interlock/interlock.h +++ b/src/app/driver/interlock/interlock.h @@ -43,8 +43,8 @@ * @file interlock.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix ILCK * diff --git a/src/app/driver/io/io.c b/src/app/driver/io/io.c index 58c57bb1..7582242f 100644 --- a/src/app/driver/io/io.c +++ b/src/app/driver/io/io.c @@ -43,8 +43,8 @@ * @file io.c * @author foxBMS Team * @date 2020-06-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IO * diff --git a/src/app/driver/io/io.h b/src/app/driver/io/io.h index ce39cb61..6ecc9a14 100644 --- a/src/app/driver/io/io.h +++ b/src/app/driver/io/io.h @@ -43,8 +43,8 @@ * @file io.h * @author foxBMS Team * @date 2020-03-19 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix IO * diff --git a/src/app/driver/led/led.c b/src/app/driver/led/led.c index f02657bf..812f7e37 100644 --- a/src/app/driver/led/led.c +++ b/src/app/driver/led/led.c @@ -43,8 +43,8 @@ * @file led.c * @author foxBMS Team * @date 2021-09-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix LED * diff --git a/src/app/driver/led/led.h b/src/app/driver/led/led.h index 2302ec0b..2ea6cfd2 100644 --- a/src/app/driver/led/led.h +++ b/src/app/driver/led/led.h @@ -43,8 +43,8 @@ * @file led.h * @author foxBMS Team * @date 2021-09-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix LED * diff --git a/src/app/driver/mcu/mcu.c b/src/app/driver/mcu/mcu.c index c1ddb4a7..220c2d54 100644 --- a/src/app/driver/mcu/mcu.c +++ b/src/app/driver/mcu/mcu.c @@ -43,8 +43,8 @@ * @file mcu.c * @author foxBMS Team * @date 2019-02-19 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MCU * diff --git a/src/app/driver/mcu/mcu.h b/src/app/driver/mcu/mcu.h index 9bc34adf..406cd7ee 100644 --- a/src/app/driver/mcu/mcu.h +++ b/src/app/driver/mcu/mcu.h @@ -43,8 +43,8 @@ * @file mcu.h * @author foxBMS Team * @date 2019-02-19 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MCU * diff --git a/src/app/driver/meas/meas.c b/src/app/driver/meas/meas.c index 48a241b3..66747649 100644 --- a/src/app/driver/meas/meas.c +++ b/src/app/driver/meas/meas.c @@ -43,8 +43,8 @@ * @file meas.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MEAS * diff --git a/src/app/driver/meas/meas.h b/src/app/driver/meas/meas.h index 13bdf962..9a06265e 100644 --- a/src/app/driver/meas/meas.h +++ b/src/app/driver/meas/meas.h @@ -43,8 +43,8 @@ * @file meas.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix MEAS * diff --git a/src/app/driver/pex/pex.c b/src/app/driver/pex/pex.c index 1206063a..88dfd736 100644 --- a/src/app/driver/pex/pex.c +++ b/src/app/driver/pex/pex.c @@ -43,8 +43,8 @@ * @file pex.c * @author foxBMS Team * @date 2021-08-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix PEX * diff --git a/src/app/driver/pex/pex.h b/src/app/driver/pex/pex.h index 98b18b6f..1fd1672c 100644 --- a/src/app/driver/pex/pex.h +++ b/src/app/driver/pex/pex.h @@ -43,8 +43,8 @@ * @file pex.h * @author foxBMS Team * @date 2021-08-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix PEX * diff --git a/src/app/driver/pwm/pwm.c b/src/app/driver/pwm/pwm.c index 472eff60..bf52d66c 100644 --- a/src/app/driver/pwm/pwm.c +++ b/src/app/driver/pwm/pwm.c @@ -43,8 +43,8 @@ * @file pwm.c * @author foxBMS Team * @date 2021-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix PWM * diff --git a/src/app/driver/pwm/pwm.h b/src/app/driver/pwm/pwm.h index 9c393ab6..c30c674b 100644 --- a/src/app/driver/pwm/pwm.h +++ b/src/app/driver/pwm/pwm.h @@ -43,8 +43,8 @@ * @file pwm.h * @author foxBMS Team * @date 2021-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix PWM * diff --git a/src/app/driver/rtc/rtc.c b/src/app/driver/rtc/rtc.c index 30807be9..4ec13cf5 100644 --- a/src/app/driver/rtc/rtc.c +++ b/src/app/driver/rtc/rtc.c @@ -43,8 +43,8 @@ * @file rtc.c * @author foxBMS Team * @date 2021-02-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix RTC * diff --git a/src/app/driver/rtc/rtc.h b/src/app/driver/rtc/rtc.h index 6251ff57..ca94ed9f 100644 --- a/src/app/driver/rtc/rtc.h +++ b/src/app/driver/rtc/rtc.h @@ -43,8 +43,8 @@ * @file rtc.h * @author foxBMS Team * @date 2021-02-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix RTC * diff --git a/src/app/driver/sbc/nxpfs85xx.c b/src/app/driver/sbc/nxpfs85xx.c index 6e0d2576..a64d682b 100644 --- a/src/app/driver/sbc/nxpfs85xx.c +++ b/src/app/driver/sbc/nxpfs85xx.c @@ -43,8 +43,8 @@ * @file nxpfs85xx.c * @author foxBMS Team * @date 2020-03-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SBC * diff --git a/src/app/driver/sbc/nxpfs85xx.h b/src/app/driver/sbc/nxpfs85xx.h index 07fb50ce..dfa6d385 100644 --- a/src/app/driver/sbc/nxpfs85xx.h +++ b/src/app/driver/sbc/nxpfs85xx.h @@ -43,8 +43,8 @@ * @file nxpfs85xx.h * @author foxBMS Team * @date 2020-03-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix FS85 * diff --git a/src/app/driver/sbc/sbc.c b/src/app/driver/sbc/sbc.c index 7c03c592..3df7bde7 100644 --- a/src/app/driver/sbc/sbc.c +++ b/src/app/driver/sbc/sbc.c @@ -43,8 +43,8 @@ * @file sbc.c * @author foxBMS Team * @date 2020-07-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SBC * diff --git a/src/app/driver/sbc/sbc.h b/src/app/driver/sbc/sbc.h index a569cbc2..133896bb 100644 --- a/src/app/driver/sbc/sbc.h +++ b/src/app/driver/sbc/sbc.h @@ -43,8 +43,8 @@ * @file sbc.h * @author foxBMS Team * @date 2020-07-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SBC * diff --git a/src/app/driver/spi/spi.c b/src/app/driver/spi/spi.c index e0ba0e6d..698f438a 100644 --- a/src/app/driver/spi/spi.c +++ b/src/app/driver/spi/spi.c @@ -43,8 +43,8 @@ * @file spi.c * @author foxBMS Team * @date 2019-12-12 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SPI * diff --git a/src/app/driver/spi/spi.h b/src/app/driver/spi/spi.h index bda77c05..50389af1 100644 --- a/src/app/driver/spi/spi.h +++ b/src/app/driver/spi/spi.h @@ -43,8 +43,8 @@ * @file spi.h * @author foxBMS Team * @date 2019-12-12 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SPI * diff --git a/src/app/driver/spi/spi_cfg-helper.h b/src/app/driver/spi/spi_cfg-helper.h index 3ef1447c..6418f79a 100644 --- a/src/app/driver/spi/spi_cfg-helper.h +++ b/src/app/driver/spi/spi_cfg-helper.h @@ -43,8 +43,8 @@ * @file spi_cfg-helper.h * @author foxBMS Team * @date 2021-12-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS_CONFIGURATION * @prefix SPI * diff --git a/src/app/driver/sps/sps.c b/src/app/driver/sps/sps.c index bc2d294a..0ae866c8 100644 --- a/src/app/driver/sps/sps.c +++ b/src/app/driver/sps/sps.c @@ -43,8 +43,8 @@ * @file sps.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SPS * @@ -365,7 +365,7 @@ static void SPS_SetCommandTxBuffer(const SPS_ACTION_e action) { case SPS_ACTION_READ_EN_IRQ_PIN: SPS_GlobalRegisterRead( - SPS_EN_IRQ_PIN_DIAG_REGISTER_ADDRESS, SPS_READ_DIAGNOSTIC_REGISTER, sps_spiTxRegisterBuffer); + SPS_ISR_IRQ_DIAG_REGISTER_ADDRESS, SPS_READ_DIAGNOSTIC_REGISTER, sps_spiTxRegisterBuffer); break; default: @@ -595,12 +595,18 @@ extern void SPS_Initialize(void) { } extern void SPS_RequestContactorState(SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction) { + FAS_ASSERT(channelIndex < SPS_NR_OF_AVAILABLE_SPS_CHANNELS); + /* AXIVION Routine Generic-MissingParameterAssert: channelFunction: parameter accepts all defined enums */ + /* Allow only contactor related SPS outputs to be operated with this function */ const SPS_CHANNEL_AFFILIATION_e channelAffiliation = SPS_GetChannelAffiliation(channelIndex); FAS_ASSERT(SPS_AFF_CONTACTOR == channelAffiliation); SPS_RequestChannelState(channelIndex, channelFunction); } extern void SPS_RequestGeneralIoState(SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction) { + FAS_ASSERT(channelIndex < SPS_NR_OF_AVAILABLE_SPS_CHANNELS); + /* AXIVION Routine Generic-MissingParameterAssert: channelFunction: parameter accepts all defined enums */ + /* Allow only general IO related SPS outputs to be operated with this function */ const SPS_CHANNEL_AFFILIATION_e channelAffiliation = SPS_GetChannelAffiliation(channelIndex); FAS_ASSERT(SPS_AFF_GENERAL_IO == channelAffiliation); SPS_RequestChannelState(channelIndex, channelFunction); diff --git a/src/app/driver/sps/sps.h b/src/app/driver/sps/sps.h index cae83cb8..cf94dad7 100644 --- a/src/app/driver/sps/sps.h +++ b/src/app/driver/sps/sps.h @@ -43,8 +43,8 @@ * @file sps.h * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SPS * diff --git a/src/app/driver/sps/sps_types.h b/src/app/driver/sps/sps_types.h index cf0e64e3..980cfb10 100644 --- a/src/app/driver/sps/sps_types.h +++ b/src/app/driver/sps/sps_types.h @@ -43,8 +43,8 @@ * @file sps_types.h * @author foxBMS Team * @date 2020-12-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVERS * @prefix SPS * diff --git a/src/app/driver/ts/api/tsi.h b/src/app/driver/ts/api/tsi.h index 27d66987..34e2ef61 100644 --- a/src/app/driver/ts/api/tsi.h +++ b/src/app/driver/ts/api/tsi.h @@ -43,8 +43,8 @@ * @file tsi.h * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix TSI * diff --git a/src/app/driver/ts/api/tsi_limits.c b/src/app/driver/ts/api/tsi_limits.c index bdc05608..93e35d8a 100644 --- a/src/app/driver/ts/api/tsi_limits.c +++ b/src/app/driver/ts/api/tsi_limits.c @@ -43,8 +43,8 @@ * @file tsi_limits.c * @author foxBMS Team * @date 2021-01-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DRIVER * @prefix TSI * diff --git a/src/app/driver/ts/beta.c b/src/app/driver/ts/beta.c index d611203c..26b67a09 100644 --- a/src/app/driver/ts/beta.c +++ b/src/app/driver/ts/beta.c @@ -43,8 +43,8 @@ * @file beta.c * @author foxBMS Team * @date 2020-01-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix BETA * diff --git a/src/app/driver/ts/beta.h b/src/app/driver/ts/beta.h index bb4be915..1fc8e2ac 100644 --- a/src/app/driver/ts/beta.h +++ b/src/app/driver/ts/beta.h @@ -43,8 +43,8 @@ * @file beta.h * @author foxBMS Team * @date 2020-01-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix BETA * diff --git a/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.c b/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.c index 1e6776c4..eb17c796 100644 --- a/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.c +++ b/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.c @@ -43,8 +43,8 @@ * @file epcos_b57251v5103j060.c * @author foxBMS Team * @date 2018-10-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.h b/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.h index 323d80db..f1cef0ee 100644 --- a/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.h +++ b/src/app/driver/ts/epcos/b57251v5103j060/epcos_b57251v5103j060.h @@ -43,8 +43,8 @@ * @file epcos_b57251v5103j060.h * @author foxBMS Team * @date 2018-10-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57251v5103j060/lookup-table/epcos_b57251v5103j060_lookup-table.c b/src/app/driver/ts/epcos/b57251v5103j060/lookup-table/epcos_b57251v5103j060_lookup-table.c index 6d3d2602..3d53a900 100644 --- a/src/app/driver/ts/epcos/b57251v5103j060/lookup-table/epcos_b57251v5103j060_lookup-table.c +++ b/src/app/driver/ts/epcos/b57251v5103j060/lookup-table/epcos_b57251v5103j060_lookup-table.c @@ -43,8 +43,8 @@ * @file epcos_b57251v5103j060_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57251v5103j060/polynomial/epcos_b57251v5103j060_polynomial.c b/src/app/driver/ts/epcos/b57251v5103j060/polynomial/epcos_b57251v5103j060_polynomial.c index a44e826e..45f5a593 100644 --- a/src/app/driver/ts/epcos/b57251v5103j060/polynomial/epcos_b57251v5103j060_polynomial.c +++ b/src/app/driver/ts/epcos/b57251v5103j060/polynomial/epcos_b57251v5103j060_polynomial.c @@ -43,8 +43,8 @@ * @file epcos_b57251v5103j060_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.c b/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.c index 38938317..c6478f19 100644 --- a/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.c +++ b/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.c @@ -43,8 +43,8 @@ * @file epcos_b57861s0103f045.c * @author foxBMS Team * @date 2018-10-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.h b/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.h index 0a94cfc1..542c8f33 100644 --- a/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.h +++ b/src/app/driver/ts/epcos/b57861s0103f045/epcos_b57861s0103f045.h @@ -43,8 +43,8 @@ * @file epcos_b57861s0103f045.h * @author foxBMS Team * @date 2018-10-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57861s0103f045/lookup-table/epcos_b57861s0103f045_lookup-table.c b/src/app/driver/ts/epcos/b57861s0103f045/lookup-table/epcos_b57861s0103f045_lookup-table.c index cf3e75fc..c118fd3f 100644 --- a/src/app/driver/ts/epcos/b57861s0103f045/lookup-table/epcos_b57861s0103f045_lookup-table.c +++ b/src/app/driver/ts/epcos/b57861s0103f045/lookup-table/epcos_b57861s0103f045_lookup-table.c @@ -43,8 +43,8 @@ * @file epcos_b57861s0103f045_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/epcos/b57861s0103f045/polynomial/epcos_b57861s0103f045_polynomial.c b/src/app/driver/ts/epcos/b57861s0103f045/polynomial/epcos_b57861s0103f045_polynomial.c index d76de455..45c3dde9 100644 --- a/src/app/driver/ts/epcos/b57861s0103f045/polynomial/epcos_b57861s0103f045_polynomial.c +++ b/src/app/driver/ts/epcos/b57861s0103f045/polynomial/epcos_b57861s0103f045_polynomial.c @@ -43,8 +43,8 @@ * @file epcos_b57861s0103f045_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/fake/none/fake_none.c b/src/app/driver/ts/fake/none/fake_none.c index c3422f6b..c91739c9 100644 --- a/src/app/driver/ts/fake/none/fake_none.c +++ b/src/app/driver/ts/fake/none/fake_none.c @@ -43,8 +43,8 @@ * @file fake_none.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/fake/none/fake_none.h b/src/app/driver/ts/fake/none/fake_none.h index c7804731..8962ebdf 100644 --- a/src/app/driver/ts/fake/none/fake_none.h +++ b/src/app/driver/ts/fake/none/fake_none.h @@ -43,8 +43,8 @@ * @file fake_none.h * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/fake/none/lookup-table/fake_none_lookup-table.c b/src/app/driver/ts/fake/none/lookup-table/fake_none_lookup-table.c index cc5f5e1d..dcecfb33 100644 --- a/src/app/driver/ts/fake/none/lookup-table/fake_none_lookup-table.c +++ b/src/app/driver/ts/fake/none/lookup-table/fake_none_lookup-table.c @@ -43,8 +43,8 @@ * @file fake_none_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/fake/none/polynomial/fake_none_polynomial.c b/src/app/driver/ts/fake/none/polynomial/fake_none_polynomial.c index 20f785fe..478927fc 100644 --- a/src/app/driver/ts/fake/none/polynomial/fake_none_polynomial.c +++ b/src/app/driver/ts/fake/none/polynomial/fake_none_polynomial.c @@ -43,8 +43,8 @@ * @file fake_none_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/murata/ncu15xh103f6sxx/lookup-table/murata_ncu15xh103f6sxx_lookup-table.c b/src/app/driver/ts/murata/ncu15xh103f6sxx/lookup-table/murata_ncu15xh103f6sxx_lookup-table.c new file mode 100644 index 00000000..17ecac68 --- /dev/null +++ b/src/app/driver/ts/murata/ncu15xh103f6sxx/lookup-table/murata_ncu15xh103f6sxx_lookup-table.c @@ -0,0 +1,75 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file murata_ncu15xh103f6sxx_lookup-table.c + * @author foxBMS Team + * @date 2022-10-12 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup TEMPERATURE_SENSORS + * @prefix TS + * + * @brief Resistive divider used for measuring temperature + * + */ + +/*========== Includes =======================================================*/ +#include "murata_ncu15xh103f6sxx.h" +#include "tsi.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +extern int16_t TSI_GetTemperature(uint16_t adcVoltage_mV) { + return TS_Mur00GetTemperatureFromLut(adcVoltage_mV); +} + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/src/app/driver/ts/murata/ncu15xh103f6sxx/murata_ncu15xh103f6sxx.c b/src/app/driver/ts/murata/ncu15xh103f6sxx/murata_ncu15xh103f6sxx.c new file mode 100644 index 00000000..1f8f218b --- /dev/null +++ b/src/app/driver/ts/murata/ncu15xh103f6sxx/murata_ncu15xh103f6sxx.c @@ -0,0 +1,167 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file murata_ncu15xh103f6sxx.c + * @author foxBMS Team + * @date 2022-10-12 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup TEMPERATURE_SENSORS + * @prefix TS + * + * @brief Resistive divider used for measuring temperature + * + */ + +/*========== Includes =======================================================*/ +#include "murata_ncu15xh103f6sxx.h" + +#include "foxmath.h" +#include "temperature_sensor_defs.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/** LUT filled from higher resistance to lower resistance - datasheet: RO3E - Aug. 3, 2018 */ +static const TS_TEMPERATURE_SENSOR_LUT_s ts_ncu15xh103f6sxxLut[] = { + {-400, 195652.0f}, {-350, 148171.0f}, {-300, 113347.0f}, {-250, 87559.0f}, {-200, 68237.0f}, {-150, 53650.0f}, + {-100, 42506.0f}, {-50, 33892.0f}, {0, 27219.0f}, {50, 22021.0f}, {100, 17926.0f}, {150, 14674.0f}, + {200, 12081.0f}, {250, 10000.0f}, {300, 8315.0f}, {350, 6948.0f}, {400, 5834.0f}, {450, 4917.0f}, + {500, 4161.0f}, {550, 3535.0f}, {600, 3014.0f}, {650, 2586.0f}, {700, 2228.0f}, {750, 1925.0f}, + {800, 1669.0f}, {850, 1452.0f}, {900, 1268.0f}, {950, 1110.0f}, {1000, 974.0f}, {1050, 858.0f}, + {1100, 758.0f}, {1150, 672.0f}, {1200, 596.0f}, {1250, 531.0f}, {1300, 474.0f}, {1350, 424.0f}, + {1400, 381.0f}, {1450, 342.0f}, {1500, 309.0f}, +}; + +/** size of the #ts_ntcle317e4103sbaLut LUT */ +static const uint16_t ts_ncu15xh103f6sxxLutSize = sizeof(ts_ncu15xh103f6sxxLut) / sizeof(TS_TEMPERATURE_SENSOR_LUT_s); + +/*========== Extern Constant and Variable Definitions =======================*/ +/** + * Defines for calculating the ADC voltage on the ends of the operating range. + * The ADC voltage is calculated with the following formula: + * + * V_adc = ( ( V_supply * R_ntc ) / ( R + R_ntc ) ) + * + * Depending on the position of the NTC in the voltage resistor (R_1/R_2), + * different R_ntc values are used for the calculation. + * @{ + */ +#if TS_MURATA_NCU15XH103F6SXX_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 == true +#define TS_MURATA_NCU15XH103F6SXX_ADC_VOLTAGE_V_MAX_V \ + ((float)((TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * ts_ncu15xh103f6sxxLut[ts_ncu15xh103f6sxxLutSize-1u].resistance_Ohm) / (ts_ncu15xh103f6sxxLut[ts_ncu15xh103f6sxxLutSize-1u].resistance_Ohm+TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))) +#define TS_MURATA_NCU15XH103F6SXX_ADC_VOLTAGE_V_MIN_V \ + ((float)((TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * ts_ncu15xh103f6sxxLut[0u].resistance_Ohm) / (ts_ncu15xh103f6sxxLut[0u].resistance_Ohm+TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))) +#else /* TS_MURATA_NCU15XH103F6SXX_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 is false */ +#define TS_MURATA_NCU15XH103F6SXX_ADC_VOLTAGE_V_MIN_V \ + ((float)((TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * ts_ncu15xh103f6sxxLut[ts_ncu15xh103f6sxxLutSize-1u].resistance_Ohm) / (ts_ncu15xh103f6sxxLut[ts_ncu15xh103f6sxxLutSize-1u].resistance_Ohm+TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))) +#define TS_MURATA_NCU15XH103F6SXX_ADC_VOLTAGE_V_MAX_V \ + ((float)((TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V * ts_ncu15xh103f6sxxLut[0u].resistance_Ohm) / (ts_ncu15xh103f6sxxLut[0u].resistance_Ohm+TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm))) +#endif +/**@}*/ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +extern int16_t TS_Mur00GetTemperatureFromLut(uint16_t adcVoltage_mV) { + int16_t temperature_ddegC = INT16_MIN; + float adcVoltage_V = (float)adcVoltage_mV / TS_SCALING_FACTOR_1V_IN_MV_FLOAT; /* Convert mV to V */ + + /* Check for valid ADC measurements to prevent undefined behavior */ + if (adcVoltage_V > TS_MURATA_NCU15XH103F6SXX_ADC_VOLTAGE_V_MAX_V) { + /* Invalid measured ADC voltage -> sensor out of operating range or disconnected/shorted */ + temperature_ddegC = INT16_MIN; + } else if (adcVoltage_V < TS_MURATA_NCU15XH103F6SXX_ADC_VOLTAGE_V_MIN_V) { + /* Invalid measured ADC voltage -> sensor out of operating range or shorted/disconnected */ + temperature_ddegC = INT16_MAX; + } else { + /* Calculate NTC resistance based on measured ADC voltage */ +#if TS_MURATA_NCU15XH103F6SXX_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 == true + /* R_1 = R_2 * ( ( V_supply / V_adc ) - 1 ) */ + const float resistance_Ohm = TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm * + ((TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V / adcVoltage_V) - 1); +#else /* TS_MURATA_NCU15XH103F6SXX_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 is false */ + /* formula: R_2 = R_1 * ( V_2 / ( V_supply - V_adc ) ) */ + const float resistance_Ohm = + TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm * + (adcVoltage_V / (TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V - adcVoltage_V)); +#endif /* TS_MURATA_NCU15XH103F6SXX_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 */ + + /* Variables for interpolating LUT value */ + uint16_t between_high = 0; + uint16_t between_low = 0; + for (uint16_t i = 0u; i < ts_ncu15xh103f6sxxLutSize; i++) { + if (resistance_Ohm < ts_ncu15xh103f6sxxLut[i].resistance_Ohm) { + between_low = i + 1u; + between_high = i; + } + } + + /* Interpolate between LUT values, but do not extrapolate LUT! */ + if (!(((between_high == 0u) && (between_low == 0u)) || /* measured resistance > maximum LUT resistance */ + (between_low >= ts_ncu15xh103f6sxxLutSize))) { /* measured resistance < minimum LUT resistance */ + temperature_ddegC = (int16_t)MATH_LinearInterpolation( + ts_ncu15xh103f6sxxLut[between_low].resistance_Ohm, + (float)ts_ncu15xh103f6sxxLut[between_low].temperature_ddegC, + ts_ncu15xh103f6sxxLut[between_high].resistance_Ohm, + (float)ts_ncu15xh103f6sxxLut[between_high].temperature_ddegC, + resistance_Ohm); + } + } + + /* Return temperature based on measured NTC resistance */ + return temperature_ddegC; +} + +extern int16_t TS_Mur00GetTemperatureFromPolynomial(uint16_t adcVoltage_mV) { + (void)adcVoltage_mV; + FAS_ASSERT(FAS_TRAP); + int16_t temperature_ddegC = 0; + /* TODO this is not implemented */ + return temperature_ddegC; +} + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/src/app/driver/ts/murata/ncu15xh103f6sxx/murata_ncu15xh103f6sxx.h b/src/app/driver/ts/murata/ncu15xh103f6sxx/murata_ncu15xh103f6sxx.h new file mode 100644 index 00000000..98b69d1d --- /dev/null +++ b/src/app/driver/ts/murata/ncu15xh103f6sxx/murata_ncu15xh103f6sxx.h @@ -0,0 +1,121 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file murata_ncu15xh103f6sxx.h + * @author foxBMS Team + * @date 2022-10-12 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup TEMPERATURE_SENSORS + * @prefix TS + * + * @brief Resistive divider used for measuring temperature + * + * V_supply + * --.-- + * | + * +-.-+ + * | | + * | | R_1 + * | | + * +-.-+ + * | + * .--- V_adc + * | + * +-.-+ + * | | + * | | R_2 + * | | + * +-.-+ + * | + * --.-- + * GND + */ + +#ifndef FOXBMS__MURATA_NCU15XH103F6SXX_H_ +#define FOXBMS__MURATA_NCU15XH103F6SXX_H_ + +/*========== Includes =======================================================*/ +#include "general.h" + +/*========== Macros and Definitions =========================================*/ +/** + * Position of the NTC in the voltage resistor + * true: NTC is positioned above the voltage tap for the ADC voltage. + * This equals resistor R_1 in the above circuit diagram + * + * false: NTC is positioned below the voltage tap for the ADC voltage. + * This equals resistor R_2 in the above circuit diagram + */ +#define TS_MURATA_NCU15XH103F6SXX_POSITION_IN_RESISTOR_DIVIDER_IS_R_1 (false) + +/** Resistor divider supply voltage in volt */ +#define TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_SUPPLY_VOLTAGE_V (3.3f) + +/** + * Resistance value of the other resistor (not the NTC) in the resistor + * divider in Ohm. + */ +#define TS_MURATA_NCU15XH103F6SXX_RESISTOR_DIVIDER_RESISTANCE_R_1_R_2_Ohm (10000.0f) + +/*========== Extern Constant and Variable Declarations ======================*/ +/** + * @brief returns temperature based on measured ADC voltage. + * @param adcVoltage_mV voltage in mV + * @return corresponding temperature in deci °C or INT16_MAX/INT16_MIN if + * NTC is shorted or got disconnected. The caller of this functions + * needs to check for these return values to prevent invalid data. + */ +extern int16_t TS_Mur00GetTemperatureFromLut(uint16_t adcVoltage_mV); + +/** + * @brief returns temperature based on measured ADC voltage + * @param adcVoltage_mV voltage in mV + * @return corresponding temperature in deci °C + */ +extern int16_t TS_Mur00GetTemperatureFromPolynomial(uint16_t adcVoltage_mV); + +/*========== Extern Function Prototypes =====================================*/ + +/*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ + +#endif /* FOXBMS__MURATA_NCU15XH103F6SXX_H_ */ diff --git a/src/app/driver/ts/murata/ncu15xh103f6sxx/polynomial/murata_ncu15xh103f6sxx_polynomial.c b/src/app/driver/ts/murata/ncu15xh103f6sxx/polynomial/murata_ncu15xh103f6sxx_polynomial.c new file mode 100644 index 00000000..7d562b30 --- /dev/null +++ b/src/app/driver/ts/murata/ncu15xh103f6sxx/polynomial/murata_ncu15xh103f6sxx_polynomial.c @@ -0,0 +1,75 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file murata_ncu15xh103f6sxx_polynomial.c + * @author foxBMS Team + * @date 2022-12-10 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup TEMPERATURE_SENSORS + * @prefix TS + * + * @brief Resistive divider used for measuring temperature + * + */ + +/*========== Includes =======================================================*/ +#include "murata_ncu15xh103f6sxx.h" +#include "tsi.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ + +extern int16_t TSI_GetTemperature(uint16_t adcVoltage_mV) { + return TS_Mur00GetTemperatureFromPolynomial(adcVoltage_mV); +} + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/src/app/driver/ts/temperature_sensor_defs.h b/src/app/driver/ts/temperature_sensor_defs.h index 96faf65b..bb1a23c2 100644 --- a/src/app/driver/ts/temperature_sensor_defs.h +++ b/src/app/driver/ts/temperature_sensor_defs.h @@ -43,8 +43,8 @@ * @file temperature_sensor_defs.h * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcalug01a103g/lookup-table/vishay_ntcalug01a103g_lookup-table.c b/src/app/driver/ts/vishay/ntcalug01a103g/lookup-table/vishay_ntcalug01a103g_lookup-table.c index eb33063e..28793eb4 100644 --- a/src/app/driver/ts/vishay/ntcalug01a103g/lookup-table/vishay_ntcalug01a103g_lookup-table.c +++ b/src/app/driver/ts/vishay/ntcalug01a103g/lookup-table/vishay_ntcalug01a103g_lookup-table.c @@ -43,8 +43,8 @@ * @file vishay_ntcalug01a103g_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcalug01a103g/polynomial/vishay_ntcalug01a103g_polynomial.c b/src/app/driver/ts/vishay/ntcalug01a103g/polynomial/vishay_ntcalug01a103g_polynomial.c index 5611f18b..8c103aab 100644 --- a/src/app/driver/ts/vishay/ntcalug01a103g/polynomial/vishay_ntcalug01a103g_polynomial.c +++ b/src/app/driver/ts/vishay/ntcalug01a103g/polynomial/vishay_ntcalug01a103g_polynomial.c @@ -43,8 +43,8 @@ * @file vishay_ntcalug01a103g_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.c b/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.c index af6014b9..344173ef 100644 --- a/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.c +++ b/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.c @@ -43,8 +43,8 @@ * @file vishay_ntcalug01a103g.c * @author foxBMS Team * @date 2018-10-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.h b/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.h index 87dd92aa..fcfa9c62 100644 --- a/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.h +++ b/src/app/driver/ts/vishay/ntcalug01a103g/vishay_ntcalug01a103g.h @@ -43,8 +43,8 @@ * @file vishay_ntcalug01a103g.h * @author foxBMS Team * @date 2018-10-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/vishay_ntcle317e4103sba_lookup-table.c b/src/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/vishay_ntcle317e4103sba_lookup-table.c index 076e4339..d9d65cf0 100644 --- a/src/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/vishay_ntcle317e4103sba_lookup-table.c +++ b/src/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/vishay_ntcle317e4103sba_lookup-table.c @@ -43,8 +43,8 @@ * @file vishay_ntcle317e4103sba_lookup-table.c * @author foxBMS Team * @date 2021-11-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.c b/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.c index d5344c33..b3cd9281 100644 --- a/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.c +++ b/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.c @@ -43,8 +43,8 @@ * @file vishay_ntcle317e4103sba.c * @author foxBMS Team * @date 2021-11-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.h b/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.h index 6baaab56..a55dfe76 100644 --- a/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.h +++ b/src/app/driver/ts/vishay/ntcle317e4103sba/vishay_ntcle317e4103sba.h @@ -43,8 +43,8 @@ * @file vishay_ntcle317e4103sba.h * @author foxBMS Team * @date 2021-10-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TEMPERATURE_SENSORS * @prefix TS * diff --git a/src/app/driver/wscript b/src/app/driver/wscript index 8e507ddf..a6e5320e 100644 --- a/src/app/driver/wscript +++ b/src/app/driver/wscript @@ -55,20 +55,24 @@ def build(bld): os.path.join("adc", "adc.c"), os.path.join("can", "can.c"), os.path.join("can", "cbs", "can_helper.c"), - os.path.join("can", "cbs", "can_cbs_rx_command.c"), - os.path.join("can", "cbs", "can_cbs_rx_current_sensor.c"), - os.path.join("can", "cbs", "can_cbs_rx_imd.c"), - os.path.join("can", "cbs", "can_cbs_rx_misc.c"), - os.path.join("can", "cbs", "can_cbs_tx_limits.c"), - os.path.join("can", "cbs", "can_cbs_tx_state.c"), - os.path.join("can", "cbs", "can_cbs_tx_state_estimation.c"), - os.path.join("can", "cbs", "can_cbs_tx_system_values.c"), - os.path.join("can", "cbs", "can_cbs_tx_voltage.c"), - os.path.join("can", "cbs", "can_cbs_tx_temperature.c"), - os.path.join("can", "cbs", "can_cbs_tx_minmax.c"), + os.path.join("can", "cbs", "rx", "can_cbs_rx_current-sensor.c"), + os.path.join("can", "cbs", "rx", "can_cbs_rx_imd.c"), + os.path.join("can", "cbs", "rx", "can_cbs_rx_misc.c"), + os.path.join("can", "cbs", "rx", "can_cbs_rx_state-request.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_cell-temperatures.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_cell-voltages.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_limit-values.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_minimum-maximum-values.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_pack-state-estimation.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_state.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_string-state-estimation.c"), + os.path.join("can", "cbs", "tx", "can_cbs_tx_system-values.c"), os.path.join("checksum", "checksum.c"), os.path.join("crc", "crc.c"), os.path.join("config", "contactor_cfg.c"), + os.path.join("config", "can_cfg_tx.c"), + os.path.join("config", "can_cfg_tx_boot-message.c"), + os.path.join("config", "can_cfg_rx.c"), os.path.join("config", "can_cfg.c"), os.path.join("config", "dma_cfg.c"), os.path.join("config", "fram_cfg.c"), @@ -102,6 +106,7 @@ def build(bld): os.path.join("ts", "epcos", "b57251v5103j060", "epcos_b57251v5103j060.c"), os.path.join("ts", "epcos", "b57861s0103f045", "epcos_b57861s0103f045.c"), os.path.join("ts", "fake", "none", "fake_none.c"), + os.path.join("ts", "murata", "ncu15xh103f6sxx", "murata_ncu15xh103f6sxx.c"), os.path.join("ts", "vishay", "ntcalug01a103g", "vishay_ntcalug01a103g.c"), os.path.join("ts", "vishay", "ntcle317e4103sba", "vishay_ntcle317e4103sba.c"), os.path.join("ts", "beta.c"), @@ -131,6 +136,8 @@ def build(bld): "sps", "ts", os.path.join("can", "cbs"), + os.path.join("can", "cbs", "rx"), + os.path.join("can", "cbs", "tx"), os.path.join("imd"), os.path.join("imd", "bender", "iso165c"), os.path.join("imd", "bender", "iso165c", "config"), @@ -138,6 +145,7 @@ def build(bld): os.path.join("ts", "epcos", "b57251v5103j060"), os.path.join("ts", "epcos", "b57861s0103f045"), os.path.join("ts", "fake", "none"), + os.path.join("ts", "murata", "ncu15xh103f6sxx"), os.path.join("ts", "vishay", "ntcalug01a103g"), os.path.join("ts", "vishay", "ntcle317e4103sba"), os.path.join("..", "application", "bal"), @@ -159,7 +167,7 @@ def build(bld): includes.extend(bld.env.INCLUDES_RTOS + bld.env.INCLUDES_AFE + bld.env.INCLUDES_IMD) cflags = bld.env.CFLAGS_FOXBMS target = f"{bld.env.APPNAME.lower()}-driver" - use = [f"{bld.env.APPNAME.lower()}-afe-driver", f"{bld.env.APPNAME}-imd"] + use = [f"{bld.env.APPNAME.lower()}-afe-driver", f"{bld.env.APPNAME.lower()}-imd"] bld.stlib( source=source, includes=includes, diff --git a/src/app/engine/config/database_cfg.c b/src/app/engine/config/database_cfg.c index 49d6a0ce..45f8793d 100644 --- a/src/app/engine/config/database_cfg.c +++ b/src/app/engine/config/database_cfg.c @@ -43,8 +43,8 @@ * @file database_cfg.c * @author foxBMS Team * @date 2015-08-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix DATA * diff --git a/src/app/engine/config/database_cfg.h b/src/app/engine/config/database_cfg.h index 93c48b22..259fb940 100644 --- a/src/app/engine/config/database_cfg.h +++ b/src/app/engine/config/database_cfg.h @@ -43,8 +43,8 @@ * @file database_cfg.h * @author foxBMS Team * @date 2015-08-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix DATA * @@ -328,7 +328,8 @@ typedef struct { * respective database entry representation in enum DATA_BLOCK_ID_e. */ DATA_BLOCK_HEADER_s header; /*!< Data block header */ uint8_t currentSensor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */ - uint8_t stringContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */ + uint8_t stringMinusContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */ + uint8_t stringPlusContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */ uint8_t prechargeContactor[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error, not responding */ uint8_t interlock; /*!< 0 -> no error, 1 -> error */ uint8_t crcError[BS_NR_OF_STRINGS]; /*!< 0 -> no error, 1 -> error */ @@ -379,6 +380,7 @@ typedef struct { bool timingViolation10ms; /*!< timing violation in 10ms task */ bool timingViolation100ms; /*!< timing violation in 100ms task */ bool timingViolation100msAlgo; /*!< timing violation in 100ms algorithm task */ + bool alertFlag; /*!< true: ALERT situation detected, false: everything okay */ } DATA_BLOCK_ERRORSTATE_s; /** data block struct of contactor feedback */ @@ -419,18 +421,6 @@ typedef struct { [BS_NR_OF_STRINGS]; /*!< recommended continuous operating discharge current */ float recommendedPeakChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating charge current */ float recommendedPeakDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< recommended peak operating discharge current */ - float continuousMolChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum operating level */ - float continuousMolDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum operating level */ - float peakMolChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum operating level */ - float peakMolDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum operating level */ - float continuousRslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current recommended safety level */ - float continuousRslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current recommended safety level */ - float peakRslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current recommended safety level */ - float peakRslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current recommended safety level */ - float continuousMslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum safety level */ - float continuousMslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum safety level */ - float peakMslChargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< charge current maximum safety level */ - float peakMslDischargeCurrent_mA[BS_NR_OF_STRINGS]; /*!< discharge current maximum safety level */ } DATA_BLOCK_SOF_s; /** data block struct of system state */ diff --git a/src/app/engine/config/diag_cfg.c b/src/app/engine/config/diag_cfg.c index 09916df7..0a9017ee 100644 --- a/src/app/engine/config/diag_cfg.c +++ b/src/app/engine/config/diag_cfg.c @@ -43,8 +43,8 @@ * @file diag_cfg.c * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix DIAG * @@ -91,7 +91,7 @@ /*========== Macros and Definitions =========================================*/ /** value of #DIAG_ID_MAX (as a define for the pre-processor) */ -#define DIAG_ID_MAX_FOR_INIT (75u) +#define DIAG_ID_MAX_FOR_INIT (77u) FAS_STATIC_ASSERT(DIAG_ID_MAX_FOR_INIT == (uint16_t)DIAG_ID_MAX, "Both values need to be identical."); @@ -187,7 +187,8 @@ DIAG_ID_CFG_s diag_diagnosisIdConfiguration[] = { {DIAG_ID_SBC_FIN_STATE, DIAG_ERROR_SENSITIVITY_FIRST_EVENT, DIAG_FATAL_ERROR, DIAG_DELAY_SBC_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_Sbc}, {DIAG_ID_SBC_RSTB_STATE, DIAG_ERROR_SENSITIVITY_FIRST_EVENT, DIAG_FATAL_ERROR, DIAG_DELAY_SBC_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_Sbc}, {DIAG_ID_PLAUSIBILITY_PACK_VOLTAGE, DIAG_ERROR_SENSITIVITY_TENTH_EVENT, DIAG_FATAL_ERROR, DIAG_DELAY_PL_PACK_VOLTAGE_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_ErrorPlausibility}, - {DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY, DIAG_FATAL_ERROR, DIAG_DELAY_CONTACTOR_FEEDBACK_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_StringContactorFeedback}, + {DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY, DIAG_FATAL_ERROR, DIAG_DELAY_CONTACTOR_FEEDBACK_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_StringContactorFeedback}, + {DIAG_ID_STRING_PLUS_CONTACTOR_FEEDBACK, DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY, DIAG_FATAL_ERROR, DIAG_DELAY_CONTACTOR_FEEDBACK_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_StringContactorFeedback}, {DIAG_ID_PRECHARGE_CONTACTOR_FEEDBACK, DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY, DIAG_FATAL_ERROR, DIAG_DELAY_CONTACTOR_FEEDBACK_ms, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_PrechargeContactorFeedback}, {DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE, DIAG_ERROR_SENSITIVITY_FIRST_EVENT, DIAG_WARNING, DIAG_DELAY_DISCARDED, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_PlausibilityCheck}, {DIAG_ID_PLAUSIBILITY_CELL_VOLTAGE_SPREAD, DIAG_ERROR_SENSITIVITY_FIRST_EVENT, DIAG_WARNING, DIAG_DELAY_DISCARDED, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_PlausibilityCheck}, @@ -218,6 +219,8 @@ DIAG_ID_CFG_s diag_diagnosisIdConfiguration[] = { {DIAG_ID_I2C_PEX_ERROR, DIAG_ERROR_SENSITIVITY_HIGH, DIAG_INFO, DIAG_NO_DELAY, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_I2cPex}, {DIAG_ID_FRAM_READ_CRC_ERROR, DIAG_ERROR_SENSITIVITY_HIGH, DIAG_INFO, DIAG_NO_DELAY, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_FramError}, + + {DIAG_ID_ALERT_MODE, DIAG_ERROR_SENSITIVITY_HIGH, DIAG_FATAL_ERROR, DIAG_NO_DELAY, DIAG_RECORDING_ENABLED, DIAG_EVALUATION_ENABLED, DIAG_AlertFlag}, /* clang-format on */ }; diff --git a/src/app/engine/config/diag_cfg.h b/src/app/engine/config/diag_cfg.h index e947d6bd..8b25cd64 100644 --- a/src/app/engine/config/diag_cfg.h +++ b/src/app/engine/config/diag_cfg.h @@ -43,8 +43,8 @@ * @file diag_cfg.h * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix DIAG * @@ -101,10 +101,27 @@ #define DIAG_ERROR_CAN_TIMING_CC_SENSITIVITY (100) /*!< logging level of CAN timing errors on the current sensor */ #define DIAG_ERROR_CAN_SENSOR_SENSITIVITY (100) /*!< logging level of CAN errors on the current sensor */ -/** logging level of errors connected with the contactor feedback */ +/** + * Logging after 20th event for errors connected related to the contactor + * feedback. This value is chosen to be so large because of the time delay + * between the request for a state and the actual physical response. It is + * caused by the SPI transaction to the SPS module, the rise time of the + * control signal and the actual opening/closing of the contactor. Only then + * can the feedback be read correctly, which also take some additional delay + * depending on the feedback source. */ #define DIAG_ERROR_CONTACTOR_FEEDBACK_SENSITIVITY (20) -/** define if delay in #DIAG_ID_CFG_s is discarded because of severity level */ +/** ---------------- DEFINES FOR ERROR STATE TRANSITION DELAY---------------- + * These defines configure the delay before the transition to the error state + * occurs if a fault is detected. During this time the BMS can alert a + * superordinate control unit that the contactors will be opened soon. The + * superior control unit can take action and e.g., reduce the current until + * the transition to error state takes place. + * + * The delay is not taken into account if severity level #DIAG_FATAL_ERROR of + * type #DIAG_SEVERITY_LEVEL_e is configured in config array #diag_diagnosisIdConfiguration. + * For any other severity, #DIAG_DELAY_DISCARDED can be used as a dummy value. + */ #define DIAG_DELAY_DISCARDED (UINT32_MAX) /** no delay after error is detected, open contactors instantaneous */ #define DIAG_NO_DELAY (0u) @@ -210,7 +227,8 @@ typedef enum { DIAG_ID_AFE_OPEN_WIRE, /*!< an open (broken) sense wire has been detected on the battery cell measurement */ DIAG_ID_PLAUSIBILITY_PACK_VOLTAGE, /*!< the plausibility module has decided that the pack voltage is implausible */ DIAG_ID_INTERLOCK_FEEDBACK, /*!< the interlock feedback indicates it to be open (but it is expected to be closed) */ - DIAG_ID_STRING_CONTACTOR_FEEDBACK, /*!< the feedback on a string contactor does not match the expected value */ + DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, /*!< the feedback on a string minus contactor does not match the expected value */ + DIAG_ID_STRING_PLUS_CONTACTOR_FEEDBACK, /*!< the feedback on a string plus contactor does not match the expected value */ DIAG_ID_PRECHARGE_CONTACTOR_FEEDBACK, /*!< the feedback on a precharge contactor does not match the expected value */ DIAG_ID_SBC_FIN_STATE, /*!< the state of the FIN signal in the SBC is not ok */ DIAG_ID_SBC_RSTB_STATE, /*!< an activation of the RSTB pin of the SBC has been detected */ @@ -230,7 +248,8 @@ typedef enum { DIAG_ID_INSULATION_GROUND_ERROR, /*!< insulation monitoring has detected a ground error */ DIAG_ID_I2C_PEX_ERROR, /*!< general error with the port expanders */ DIAG_ID_FRAM_READ_CRC_ERROR, /*!< CRC does not match when reading from the FRAM */ - DIAG_ID_MAX, /*!< MAX indicator - do not change */ + DIAG_ID_ALERT_MODE, /*!< Critical error while opening the contactors. Fuse has not triggered */ + DIAG_ID_MAX, /*!< MAX indicator - do not change */ } DIAG_ID_e; /** diagnosis check result (event) */ diff --git a/src/app/engine/config/sys_cfg.c b/src/app/engine/config/sys_cfg.c index da19ec74..fa42698b 100644 --- a/src/app/engine/config/sys_cfg.c +++ b/src/app/engine/config/sys_cfg.c @@ -43,8 +43,8 @@ * @file sys_cfg.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix SYS * @@ -54,7 +54,7 @@ /*========== Includes =======================================================*/ #include "sys_cfg.h" -#include "can.h" +#include "can_cfg_tx_boot-message.h" /*========== Macros and Definitions =========================================*/ @@ -70,8 +70,8 @@ void SYS_SendBootMessage(void) { /* the system can do not much with the result of the function at this stage therefore discard it */ - (void)CAN_TransmitBootMessage(); - (void)CAN_TransmitDieId(); + (void)CANTX_TransmitBootMessage(); + (void)CANTX_TransmitDieId(); } /*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/src/app/engine/config/sys_cfg.h b/src/app/engine/config/sys_cfg.h index afdb9deb..c4d4ec97 100644 --- a/src/app/engine/config/sys_cfg.h +++ b/src/app/engine/config/sys_cfg.h @@ -43,8 +43,8 @@ * @file sys_cfg.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix SYS * diff --git a/src/app/engine/config/sys_mon_cfg.c b/src/app/engine/config/sys_mon_cfg.c index 728da0f4..4133f72a 100644 --- a/src/app/engine/config/sys_mon_cfg.c +++ b/src/app/engine/config/sys_mon_cfg.c @@ -43,8 +43,8 @@ * @file sys_mon_cfg.c * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix SYSM * diff --git a/src/app/engine/config/sys_mon_cfg.h b/src/app/engine/config/sys_mon_cfg.h index e0933495..2d0f86b8 100644 --- a/src/app/engine/config/sys_mon_cfg.h +++ b/src/app/engine/config/sys_mon_cfg.h @@ -43,8 +43,8 @@ * @file sys_mon_cfg.h * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE_CONFIGURATION * @prefix SYSM * diff --git a/src/app/engine/database/database.c b/src/app/engine/database/database.c index 6bd94757..cb0a809a 100644 --- a/src/app/engine/database/database.c +++ b/src/app/engine/database/database.c @@ -43,8 +43,8 @@ * @file database.c * @author foxBMS Team * @date 2015-08-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DATA * diff --git a/src/app/engine/database/database.h b/src/app/engine/database/database.h index 72eb626f..0bacc431 100644 --- a/src/app/engine/database/database.h +++ b/src/app/engine/database/database.h @@ -43,8 +43,8 @@ * @file database.h * @author foxBMS Team * @date 2015-08-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DATA * diff --git a/src/app/engine/database/database_helper.c b/src/app/engine/database/database_helper.c index 2bf699fa..63ff18b0 100644 --- a/src/app/engine/database/database_helper.c +++ b/src/app/engine/database/database_helper.c @@ -43,8 +43,8 @@ * @file database_helper.c * @author foxBMS Team * @date 2021-05-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DATA * diff --git a/src/app/engine/database/database_helper.h b/src/app/engine/database/database_helper.h index 71b95c4a..deee76a8 100644 --- a/src/app/engine/database/database_helper.h +++ b/src/app/engine/database/database_helper.h @@ -43,8 +43,8 @@ * @file database_helper.h * @author foxBMS Team * @date 2021-05-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DATA * diff --git a/src/app/engine/diag/cbs/diag_cbs.h b/src/app/engine/diag/cbs/diag_cbs.h index 6284b280..141389d8 100644 --- a/src/app/engine/diag/cbs/diag_cbs.h +++ b/src/app/engine/diag/cbs/diag_cbs.h @@ -43,8 +43,8 @@ * @file diag_cbs.h * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * @@ -443,6 +443,19 @@ extern void DIAG_FramError( const DIAG_DATABASE_SHIM_s *const kpkDiagShim, uint32_t data); +/** + * @brief diagnosis callback function for ALERT flag + * @param[in] diagId ID of diag entry + * @param[in] event OK, NOK or RESET + * @param[in] kpkDiagShim shim to the database entries + * @param[in] data not relevant + */ +extern void DIAG_AlertFlag( + DIAG_ID_e diagId, + DIAG_EVENT_e event, + const DIAG_DATABASE_SHIM_s *const kpkDiagShim, + uint32_t data); + /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/ #endif /* FOXBMS__DIAG_CBS_H_ */ diff --git a/src/app/engine/diag/cbs/diag_cbs_afe.c b/src/app/engine/diag/cbs/diag_cbs_afe.c index 39685928..650bb860 100644 --- a/src/app/engine/diag/cbs/diag_cbs_afe.c +++ b/src/app/engine/diag/cbs/diag_cbs_afe.c @@ -43,8 +43,8 @@ * @file diag_cbs_afe.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_bms.c b/src/app/engine/diag/cbs/diag_cbs_bms.c new file mode 100644 index 00000000..b9a59e61 --- /dev/null +++ b/src/app/engine/diag/cbs/diag_cbs_bms.c @@ -0,0 +1,88 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file diag_cbs_bms.c + * @author foxBMS Team + * @date 2022-07-26 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup APPLICATION + * @prefix DIAG + * + * @brief Diagnosis driver implementation + * @details TODO + */ + +/*========== Includes =======================================================*/ +#include "diag_cbs.h" + +/*========== Macros and Definitions =========================================*/ + +/*========== Static Constant and Variable Definitions =======================*/ + +/*========== Extern Constant and Variable Definitions =======================*/ + +/*========== Static Function Prototypes =====================================*/ + +/*========== Static Function Implementations ================================*/ + +/*========== Extern Function Implementations ================================*/ +extern void DIAG_AlertFlag( + DIAG_ID_e diagId, + DIAG_EVENT_e event, + const DIAG_DATABASE_SHIM_s *const kpkDiagShim, + uint32_t data) { + FAS_ASSERT(diagId == DIAG_ID_ALERT_MODE); + FAS_ASSERT((event == DIAG_EVENT_OK) || (event == DIAG_EVENT_NOT_OK) || (event == DIAG_EVENT_RESET)); + FAS_ASSERT(kpkDiagShim != NULL_PTR); + /* AXIVION Routine Generic-MissingParameterAssert: data: parameter not used -> accept everything */ + (void)data; /* data is unused */ + + if (event == DIAG_EVENT_RESET) { + kpkDiagShim->pTableError->alertFlag = false; + } + if (event == DIAG_EVENT_NOT_OK) { + kpkDiagShim->pTableError->alertFlag = true; + } +} + +/*========== Externalized Static Function Implementations (Unit Test) =======*/ diff --git a/src/app/engine/diag/cbs/diag_cbs_can.c b/src/app/engine/diag/cbs/diag_cbs_can.c index 4779087a..69ecbacd 100644 --- a/src/app/engine/diag/cbs/diag_cbs_can.c +++ b/src/app/engine/diag/cbs/diag_cbs_can.c @@ -43,8 +43,8 @@ * @file diag_cbs_can.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_contactor.c b/src/app/engine/diag/cbs/diag_cbs_contactor.c index 4944cfa1..8965af4b 100644 --- a/src/app/engine/diag/cbs/diag_cbs_contactor.c +++ b/src/app/engine/diag/cbs/diag_cbs_contactor.c @@ -43,13 +43,14 @@ * @file diag_cbs_contactor.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * * @brief Diagnosis driver implementation - * @details TODO + * @details This file implements the diagnosis callback functions for all + * contactor related events. */ /*========== Includes =======================================================*/ @@ -76,13 +77,23 @@ extern void DIAG_StringContactorFeedback( FAS_ASSERT(kpkDiagShim != NULL_PTR); FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS); - if (diagId == DIAG_ID_STRING_CONTACTOR_FEEDBACK) { + if (diagId == DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK) { if (event == DIAG_EVENT_RESET) { - kpkDiagShim->pTableError->stringContactor[stringNumber] = 0u; + kpkDiagShim->pTableError->stringMinusContactor[stringNumber] = 0u; } if (event == DIAG_EVENT_NOT_OK) { - kpkDiagShim->pTableError->stringContactor[stringNumber] = 1u; + kpkDiagShim->pTableError->stringMinusContactor[stringNumber] = 1u; } + } else if (diagId == DIAG_ID_STRING_PLUS_CONTACTOR_FEEDBACK) { + if (event == DIAG_EVENT_RESET) { + kpkDiagShim->pTableError->stringPlusContactor[stringNumber] = 0u; + } + if (event == DIAG_EVENT_NOT_OK) { + kpkDiagShim->pTableError->stringPlusContactor[stringNumber] = 1u; + } + } else { + /* This function should not be called with other diagnosis IDs */ + FAS_ASSERT(FAS_TRAP); } } @@ -103,6 +114,9 @@ extern void DIAG_PrechargeContactorFeedback( if (event == DIAG_EVENT_NOT_OK) { kpkDiagShim->pTableError->prechargeContactor[stringNumber] = 1u; } + } else { + /* This function should not be called with other diagnosis IDs */ + FAS_ASSERT(FAS_TRAP); } } diff --git a/src/app/engine/diag/cbs/diag_cbs_current-sensor.c b/src/app/engine/diag/cbs/diag_cbs_current-sensor.c index 9de622fb..03b44e6a 100644 --- a/src/app/engine/diag/cbs/diag_cbs_current-sensor.c +++ b/src/app/engine/diag/cbs/diag_cbs_current-sensor.c @@ -43,8 +43,8 @@ * @file diag_cbs_current-sensor.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_current.c b/src/app/engine/diag/cbs/diag_cbs_current.c index 0900c9fe..3ab569fd 100644 --- a/src/app/engine/diag/cbs/diag_cbs_current.c +++ b/src/app/engine/diag/cbs/diag_cbs_current.c @@ -43,8 +43,8 @@ * @file diag_cbs_current.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_deep-discharge.c b/src/app/engine/diag/cbs/diag_cbs_deep-discharge.c index e5693c7e..fa590960 100644 --- a/src/app/engine/diag/cbs/diag_cbs_deep-discharge.c +++ b/src/app/engine/diag/cbs/diag_cbs_deep-discharge.c @@ -43,8 +43,8 @@ * @file diag_cbs_deep-discharge.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_dummy.c b/src/app/engine/diag/cbs/diag_cbs_dummy.c index 96cc3d26..2662a52e 100644 --- a/src/app/engine/diag/cbs/diag_cbs_dummy.c +++ b/src/app/engine/diag/cbs/diag_cbs_dummy.c @@ -43,8 +43,8 @@ * @file diag_cbs_dummy.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_fram.c b/src/app/engine/diag/cbs/diag_cbs_fram.c index 74dc3eda..7281e6be 100644 --- a/src/app/engine/diag/cbs/diag_cbs_fram.c +++ b/src/app/engine/diag/cbs/diag_cbs_fram.c @@ -43,8 +43,8 @@ * @file diag_cbs_fram.c * @author foxBMS Team * @date 2022-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_i2c.c b/src/app/engine/diag/cbs/diag_cbs_i2c.c index de22239f..10a700ec 100644 --- a/src/app/engine/diag/cbs/diag_cbs_i2c.c +++ b/src/app/engine/diag/cbs/diag_cbs_i2c.c @@ -43,8 +43,8 @@ * @file diag_cbs_i2c.c * @author foxBMS Team * @date 2021-09-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_insulation.c b/src/app/engine/diag/cbs/diag_cbs_insulation.c index c7af3cb4..2554c7c2 100644 --- a/src/app/engine/diag/cbs/diag_cbs_insulation.c +++ b/src/app/engine/diag/cbs/diag_cbs_insulation.c @@ -43,8 +43,8 @@ * @file diag_cbs_insulation.c * @author foxBMS Team * @date 2021-02-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_interlock.c b/src/app/engine/diag/cbs/diag_cbs_interlock.c index 431dfc7b..9f094a27 100644 --- a/src/app/engine/diag/cbs/diag_cbs_interlock.c +++ b/src/app/engine/diag/cbs/diag_cbs_interlock.c @@ -43,8 +43,8 @@ * @file diag_cbs_interlock.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_plausibility.c b/src/app/engine/diag/cbs/diag_cbs_plausibility.c index da05ef8f..5955c233 100644 --- a/src/app/engine/diag/cbs/diag_cbs_plausibility.c +++ b/src/app/engine/diag/cbs/diag_cbs_plausibility.c @@ -43,8 +43,8 @@ * @file diag_cbs_plausibility.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_power-measurement.c b/src/app/engine/diag/cbs/diag_cbs_power-measurement.c index 225209ab..998555f9 100644 --- a/src/app/engine/diag/cbs/diag_cbs_power-measurement.c +++ b/src/app/engine/diag/cbs/diag_cbs_power-measurement.c @@ -43,8 +43,8 @@ * @file diag_cbs_power-measurement.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_sbc.c b/src/app/engine/diag/cbs/diag_cbs_sbc.c index 32989b2f..c65f43d2 100644 --- a/src/app/engine/diag/cbs/diag_cbs_sbc.c +++ b/src/app/engine/diag/cbs/diag_cbs_sbc.c @@ -43,8 +43,8 @@ * @file diag_cbs_sbc.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_sys-mon.c b/src/app/engine/diag/cbs/diag_cbs_sys-mon.c index 7e580961..23e014ce 100644 --- a/src/app/engine/diag/cbs/diag_cbs_sys-mon.c +++ b/src/app/engine/diag/cbs/diag_cbs_sys-mon.c @@ -43,8 +43,8 @@ * @file diag_cbs_sys-mon.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_temperature.c b/src/app/engine/diag/cbs/diag_cbs_temperature.c index f70dba3e..afe9b1ca 100644 --- a/src/app/engine/diag/cbs/diag_cbs_temperature.c +++ b/src/app/engine/diag/cbs/diag_cbs_temperature.c @@ -43,8 +43,8 @@ * @file diag_cbs_temperature.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/cbs/diag_cbs_voltage.c b/src/app/engine/diag/cbs/diag_cbs_voltage.c index 7aa8000d..c116dff9 100644 --- a/src/app/engine/diag/cbs/diag_cbs_voltage.c +++ b/src/app/engine/diag/cbs/diag_cbs_voltage.c @@ -43,8 +43,8 @@ * @file diag_cbs_voltage.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/diag/diag.c b/src/app/engine/diag/diag.c index 6b58a8b8..ed17b719 100644 --- a/src/app/engine/diag/diag.c +++ b/src/app/engine/diag/diag.c @@ -43,8 +43,8 @@ * @file diag.c * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * @@ -170,6 +170,18 @@ STD_RETURN_TYPE_e DIAG_Initialize(DIAG_DEV_s *diag_dev_pointer) { } } + /** Iterate over #diag_diagnosisIdConfiguration and check that a meaningful + * state transition time is configured if a severity of #DIAG_FATAL_ERROR + * is configured. */ + for (uint16_t diagnosisEntry = 0u; diagnosisEntry < diag_dev_pointer->nrOfConfiguredDiagnosisEntries; + diagnosisEntry++) { + bool fatalErrorDetected = (bool)(diag_diagnosisIdConfiguration[diagnosisEntry].severity == DIAG_FATAL_ERROR); + bool discardDelay = (bool)(diag_diagnosisIdConfiguration[diagnosisEntry].delay_ms == DIAG_DELAY_DISCARDED); + if (fatalErrorDetected && discardDelay) { + /* Configuration error. Fatal error configured but delay is discared.*/ + FAS_ASSERT(FAS_TRAP); + } + } diag.state = DIAG_STATE_INITIALIZED; return retval; } diff --git a/src/app/engine/diag/diag.h b/src/app/engine/diag/diag.h index 1feb048a..edfd35b0 100644 --- a/src/app/engine/diag/diag.h +++ b/src/app/engine/diag/diag.h @@ -43,8 +43,8 @@ * @file diag.h * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix DIAG * diff --git a/src/app/engine/hwinfo/masterinfo.c b/src/app/engine/hwinfo/masterinfo.c index 6107a154..600f8fe7 100644 --- a/src/app/engine/hwinfo/masterinfo.c +++ b/src/app/engine/hwinfo/masterinfo.c @@ -43,8 +43,8 @@ * @file masterinfo.c * @author foxBMS Team * @date 2020-07-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix MINFO * diff --git a/src/app/engine/hwinfo/masterinfo.h b/src/app/engine/hwinfo/masterinfo.h index 37007ef4..5b0d903a 100644 --- a/src/app/engine/hwinfo/masterinfo.h +++ b/src/app/engine/hwinfo/masterinfo.h @@ -43,8 +43,8 @@ * @file masterinfo.h * @author foxBMS Team * @date 2020-07-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix MINFO * diff --git a/src/app/engine/sys/sys.c b/src/app/engine/sys/sys.c index 5d2d2657..21917a61 100644 --- a/src/app/engine/sys/sys.c +++ b/src/app/engine/sys/sys.c @@ -43,8 +43,8 @@ * @file sys.c * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix SYS * diff --git a/src/app/engine/sys/sys.h b/src/app/engine/sys/sys.h index 85f97f18..5761f483 100644 --- a/src/app/engine/sys/sys.h +++ b/src/app/engine/sys/sys.h @@ -43,8 +43,8 @@ * @file sys.h * @author foxBMS Team * @date 2020-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix SYS * diff --git a/src/app/engine/sys_mon/sys_mon.c b/src/app/engine/sys_mon/sys_mon.c index 68a7efd2..c2a54e8e 100644 --- a/src/app/engine/sys_mon/sys_mon.c +++ b/src/app/engine/sys_mon/sys_mon.c @@ -43,8 +43,8 @@ * @file sys_mon.c * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix SYSM * diff --git a/src/app/engine/sys_mon/sys_mon.h b/src/app/engine/sys_mon/sys_mon.h index ac159e78..aac7a0d8 100644 --- a/src/app/engine/sys_mon/sys_mon.h +++ b/src/app/engine/sys_mon/sys_mon.h @@ -43,8 +43,8 @@ * @file sys_mon.h * @author foxBMS Team * @date 2019-11-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ENGINE * @prefix SYSM * diff --git a/src/app/engine/wscript b/src/app/engine/wscript index 68c3a217..bccfb2f4 100644 --- a/src/app/engine/wscript +++ b/src/app/engine/wscript @@ -55,6 +55,7 @@ def build(bld): os.path.join("config", "sys_mon_cfg.c"), os.path.join("database", "database.c"), os.path.join("database", "database_helper.c"), + os.path.join("diag", "cbs", "diag_cbs_bms.c"), os.path.join("diag", "cbs", "diag_cbs_can.c"), os.path.join("diag", "cbs", "diag_cbs_contactor.c"), os.path.join("diag", "cbs", "diag_cbs_current.c"), diff --git a/src/app/main/fassert.c b/src/app/main/fassert.c index 6decf71f..bf244f74 100644 --- a/src/app/main/fassert.c +++ b/src/app/main/fassert.c @@ -43,8 +43,8 @@ * @file fassert.c * @author foxBMS Team * @date 2020-05-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ASSERT * @prefix FAS * diff --git a/src/app/main/fstartup.c b/src/app/main/fstartup.c index c67975d9..dea89800 100644 --- a/src/app/main/fstartup.c +++ b/src/app/main/fstartup.c @@ -43,8 +43,8 @@ * @file fstartup.c * @author foxBMS Team * @date 2020-07-09 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix STU * diff --git a/src/app/main/include/config/version_cfg.h b/src/app/main/include/config/version_cfg.h index 103d096c..42b9cb7a 100644 --- a/src/app/main/include/config/version_cfg.h +++ b/src/app/main/include/config/version_cfg.h @@ -43,8 +43,8 @@ * @file version_cfg.h * @author foxBMS Team * @date 2021-07-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix VER * diff --git a/src/app/main/include/fassert.h b/src/app/main/include/fassert.h index 8d00c440..c4de22d1 100644 --- a/src/app/main/include/fassert.h +++ b/src/app/main/include/fassert.h @@ -43,8 +43,8 @@ * @file fassert.h * @author foxBMS Team * @date 2020-03-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup ASSERT * @prefix FAS * diff --git a/src/app/main/include/fstartup.h b/src/app/main/include/fstartup.h index 3e364e20..8127af1b 100644 --- a/src/app/main/include/fstartup.h +++ b/src/app/main/include/fstartup.h @@ -43,8 +43,8 @@ * @file fstartup.h * @author foxBMS Team * @date 2022-05-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix STU * diff --git a/src/app/main/include/fstd_types.h b/src/app/main/include/fstd_types.h index 62f4d5b3..e049f3a7 100644 --- a/src/app/main/include/fstd_types.h +++ b/src/app/main/include/fstd_types.h @@ -43,8 +43,8 @@ * @file fstd_types.h * @author foxBMS Team * @date 2015-12-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL_CONF * @prefix STD * diff --git a/src/app/main/include/fsystem.h b/src/app/main/include/fsystem.h index dc5d804d..d320729c 100644 --- a/src/app/main/include/fsystem.h +++ b/src/app/main/include/fsystem.h @@ -43,8 +43,8 @@ * @file fsystem.h * @author foxBMS Team * @date 2020-07-21 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup SYSTEM * @prefix FSYS * diff --git a/src/app/main/include/general.h b/src/app/main/include/general.h index 8744dfe4..b97c0634 100644 --- a/src/app/main/include/general.h +++ b/src/app/main/include/general.h @@ -43,8 +43,8 @@ * @file general.h * @author foxBMS Team * @date 2019-09-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL_CONF * @prefix GEN * diff --git a/src/app/main/include/main.h b/src/app/main/include/main.h index 8f622d66..978df2a5 100644 --- a/src/app/main/include/main.h +++ b/src/app/main/include/main.h @@ -43,8 +43,8 @@ * @file main.h * @author foxBMS Team * @date 2018-10-23 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix TODO * diff --git a/src/app/main/main.c b/src/app/main/main.c index f4591eba..02b1d427 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -43,8 +43,8 @@ * @file main.c * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix TODO * diff --git a/src/app/task/config/ftask_cfg.c b/src/app/task/config/ftask_cfg.c index 60dbe6f0..87b529c5 100644 --- a/src/app/task/config/ftask_cfg.c +++ b/src/app/task/config/ftask_cfg.c @@ -43,8 +43,8 @@ * @file ftask_cfg.c * @author foxBMS Team * @date 2019-08-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TASK_CONFIGURATION * @prefix FTSK * @@ -232,7 +232,6 @@ extern void FTSK_RunUserCodeCyclic10ms(void) { /* user code */ SYSM_UpdateFramData(); SYS_Trigger(&sys_state); - BMS_Trigger(); ILCK_Trigger(); ADC_Control(); SPS_Ctrl(); @@ -247,6 +246,11 @@ extern void FTSK_RunUserCodeCyclic10ms(void) { MRC_ValidatePackMeasurement(); ftsk_cyclic10msCounter = 0; } + /* Call BMS_Trigger function at the end of the 10ms task to allow previously + * called modules in this task to update respectively evaluate their new. + * This minimizes the delay between data evaluation and the reaction from + * the BMS module */ + BMS_Trigger(); ftsk_cyclic10msCounter++; } diff --git a/src/app/task/config/ftask_cfg.h b/src/app/task/config/ftask_cfg.h index 05523fb6..eef21295 100644 --- a/src/app/task/config/ftask_cfg.h +++ b/src/app/task/config/ftask_cfg.h @@ -43,8 +43,8 @@ * @file ftask_cfg.h * @author foxBMS Team * @date 2019-08-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TASK_CONFIGURATION * @prefix FTSK * diff --git a/src/app/task/ftask/freertos/ftask_freertos.c b/src/app/task/ftask/freertos/ftask_freertos.c index 26d7ec7b..20588132 100644 --- a/src/app/task/ftask/freertos/ftask_freertos.c +++ b/src/app/task/ftask/freertos/ftask_freertos.c @@ -43,8 +43,8 @@ * @file ftask_freertos.c * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TASK * @prefix FTSK * diff --git a/src/app/task/ftask/ftask.c b/src/app/task/ftask/ftask.c index 8915ddfa..6b0acf68 100644 --- a/src/app/task/ftask/ftask.c +++ b/src/app/task/ftask/ftask.c @@ -43,8 +43,8 @@ * @file ftask.c * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TASK * @prefix FTSK * diff --git a/src/app/task/ftask/ftask.h b/src/app/task/ftask/ftask.h index 6717ab70..b0036cc0 100644 --- a/src/app/task/ftask/ftask.h +++ b/src/app/task/ftask/ftask.h @@ -43,8 +43,8 @@ * @file ftask.h * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TASK * @prefix FTSK * @@ -71,12 +71,12 @@ /** Length of queue that is used in the insulation measurement device (IMD) */ #define FTSK_IMD_QUEUE_LENGTH (5u) /** Size of queue item that is used in the IMD driver */ -#define FTSK_IMD_QUEUE_ITEM_SIZE_IN_BYTES (sizeof(CAN_BUFFERELEMENT_s)) +#define FTSK_IMD_QUEUE_ITEM_SIZE_IN_BYTES (sizeof(CAN_BUFFER_ELEMENT_s)) /** Length of queue that is used in the can module for receiving messages */ #define FTSK_CAN_RX_QUEUE_LENGTH (50u) /** Size of queue item that is used in the can driver */ -#define FTSK_CAN_RX_QUEUE_ITEM_SIZE_IN_BYTES (sizeof(CAN_BUFFERELEMENT_s)) +#define FTSK_CAN_RX_QUEUE_ITEM_SIZE_IN_BYTES (sizeof(CAN_BUFFER_ELEMENT_s)) /*========== Extern Constant and Variable Declarations ======================*/ /** handle of the database queue */ diff --git a/src/app/task/os/freertos/os_freertos.c b/src/app/task/os/freertos/os_freertos.c index 1745c1f0..45ae5d8c 100644 --- a/src/app/task/os/freertos/os_freertos.c +++ b/src/app/task/os/freertos/os_freertos.c @@ -43,8 +43,8 @@ * @file os_freertos.c * @author foxBMS Team * @date 2021-11-18 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup OS * @prefix OS * diff --git a/src/app/task/os/freertos/os_freertos_config-validation.h b/src/app/task/os/freertos/os_freertos_config-validation.h index aa0e3196..33380c01 100644 --- a/src/app/task/os/freertos/os_freertos_config-validation.h +++ b/src/app/task/os/freertos/os_freertos_config-validation.h @@ -43,8 +43,8 @@ * @file os_freertos_config-validation.h * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup OS * @prefix OS * diff --git a/src/app/task/os/os.c b/src/app/task/os/os.c index 13b1f08e..76701b09 100644 --- a/src/app/task/os/os.c +++ b/src/app/task/os/os.c @@ -43,8 +43,8 @@ * @file os.c * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup OS * @prefix OS * diff --git a/src/app/task/os/os.h b/src/app/task/os/os.h index 16f87b5d..3454436f 100644 --- a/src/app/task/os/os.h +++ b/src/app/task/os/os.h @@ -43,8 +43,8 @@ * @file os.h * @author foxBMS Team * @date 2019-08-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup OS * @prefix OS * diff --git a/src/doxygen_src.h b/src/doxygen_src.h index a325d00a..af46b569 100644 --- a/src/doxygen_src.h +++ b/src/doxygen_src.h @@ -43,8 +43,8 @@ * @file doxygen_src.h * @author foxBMS Team * @date 2019-06-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup DOXYGEN * @prefix DX * diff --git a/src/opt/cells/config/lg_inr18650mj1.c b/src/opt/cells/config/lg_inr18650mj1.c index dc25eae6..75c1288b 100644 --- a/src/opt/cells/config/lg_inr18650mj1.c +++ b/src/opt/cells/config/lg_inr18650mj1.c @@ -43,8 +43,8 @@ * @file lg_inr18650mj1.c * @author foxBMS Team * @date 2017-11-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_CELL_CONF * @prefix BC * diff --git a/src/opt/cells/config/lg_inr18650mj1.h b/src/opt/cells/config/lg_inr18650mj1.h index d1bc6d58..b7ea1306 100644 --- a/src/opt/cells/config/lg_inr18650mj1.h +++ b/src/opt/cells/config/lg_inr18650mj1.h @@ -43,8 +43,8 @@ * @file lg_inr18650mj1.h * @author foxBMS Team * @date 2017-11-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_CELL_CONF * @prefix BC * diff --git a/src/opt/cells/config/pana_ncr18650bd.h b/src/opt/cells/config/pana_ncr18650bd.h index 911d9019..469c83f3 100644 --- a/src/opt/cells/config/pana_ncr18650bd.h +++ b/src/opt/cells/config/pana_ncr18650bd.h @@ -43,8 +43,8 @@ * @file pana_ncr18650bd.h * @author foxBMS Team * @date 2018-10-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup BATTERY_CELL_CONF * @prefix BC * diff --git a/tests/axivion/README.md b/tests/axivion/README.md index 5d4e3635..78312b90 100644 --- a/tests/axivion/README.md +++ b/tests/axivion/README.md @@ -1,5 +1,8 @@ # Axivion Bauhaus Suite Configuration for foxBMS 2 +> **NOTE:** For running local Axivion builds see + [scripts/README.md](scripts/README.md) + ## Directory Description - This directory contains the Axivion setup for the TI ARM CGT compiler for TI @@ -46,6 +49,7 @@ └───scripts ci_check_freshness_of_architecture_svg.py dep_analysis.py + get_local_host.py gravis_export_architecture_svg.py start_analysis.bat start_local_analysis.bat diff --git a/tests/axivion/addon-test/run_axivion_addon_tests.bat b/tests/axivion/addon-test/run_axivion_addon_tests.bat index 1ba762b5..fb65d615 100644 --- a/tests/axivion/addon-test/run_axivion_addon_tests.bat +++ b/tests/axivion/addon-test/run_axivion_addon_tests.bat @@ -38,7 +38,7 @@ @setlocal enableextensions enabledelayedexpansion @pushd %~dp0 -@CALL :NORMALIZEPATH "%~dp0\..\ +@CALL :NORMALIZE_PATH "%~dp0\..\" @SET BAUHAUS_CONFIG=%NORMALIZED_PATH% @ECHO Setting 'BAUHAUS_CONFIG' to '%BAUHAUS_CONFIG%' @@ -46,9 +46,15 @@ @echo %%s | findstr /i "bauhaus">nul && (@SET BAUHAUS_DIR=%%s) ) -@REM preferr the perform_tests.exe that is found on PATH +@REM ensure output directory +@SET AXIVION_BUILD_DIR=%~dp0..\..\..\build\axivion +@IF NOT EXIST %AXIVION_BUILD_DIR% ( + @mkdir %AXIVION_BUILD_DIR% +) + +@REM prefer the perform_tests.exe that is found on PATH @SET TEST_EXE=perform_tests.exe -@ECHO Seraching program '%TEST_EXE%' +@ECHO Searching program '%TEST_EXE%' @WHERE %TEST_EXE% 1>NUL 2>NUL @IF %ERRORLEVEL% neq 0 ( @ECHO '%TEST_EXE%' is not in %%PATH%% @@ -73,6 +79,6 @@ @popd @EXIT /B %ERRORLEVEL% -:NORMALIZEPATH +:NORMALIZE_PATH @SET NORMALIZED_PATH=%~dpfn1 @EXIT /B diff --git a/tests/axivion/architecture_config.json b/tests/axivion/architecture_config.json index 8a4dbf24..7cfa3793 100644 --- a/tests/axivion/architecture_config.json +++ b/tests/axivion/architecture_config.json @@ -24,11 +24,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/ci_config.json b/tests/axivion/ci_config.json index 9103614e..a0da16c1 100644 --- a/tests/axivion/ci_config.json +++ b/tests/axivion/ci_config.json @@ -65,11 +65,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/compiler-errata/.clang-format b/tests/axivion/compiler-errata/.clang-format new file mode 100644 index 00000000..9d159247 --- /dev/null +++ b/tests/axivion/compiler-errata/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/tests/axivion/compiler-errata/README.md b/tests/axivion/compiler-errata/README.md new file mode 100644 index 00000000..50644a5b --- /dev/null +++ b/tests/axivion/compiler-errata/README.md @@ -0,0 +1,28 @@ +# Axivion Compiler Errata Tests + +This directory and its subdirectories contain Compiler Errata tests for +different compilers. + +> **NOTE:** ``perform_tests.exe`` must be on PATH in the correct version. + +- The test files of the compiler errata tests are in the directory + ``./compiler-errata/``. + **The test files are not part of the public foxBMS 2 release.** + - ``ti-cgt-arm_20.2.6.lts``: + - [ARM Code Generation Tools v20.2.6.LTS](https://software-dl.ti.com/codegen/esd/cgt_public_sw/TMS470/20.2.6.LTS/README.html) + - test script: ``run_axivion_compiler_errata_ti-cgt-arm_20.2.6.lts_tests.bat`` + - Bauhaus version: X.Y.Z +- To ensure that the test suite is not changed inadvertently, the SHA-256 of + the directory is checked in CI: + ```console + C:\Users\vulpes\Documents\foxbms-2>tools\utils\cmd\run-python-script.bat tools\utils\verify_checksums.py tests\axivion\qualification-test\qualification-kit -vv + ``` +- If the compiler errata tests are changed/updated the following needs to be done: + - The changes need to be applied in ``./compiler-errata/`` + - The known SHA-256 of the test files needs to be updated in the CI step. + - the commit message **MUST** contain ``Axivion``. + This ensures that the compiler errata tests are run. +- When the Axivion Bauhaus Suite is updated, the compiler-errata tests need + also to be updated. + The pinned Bauhaus version is found in + ``/conf/env/paths_win32.txt``. diff --git a/tests/axivion/compiler-errata/run_axivion_compiler_errata_ti-cgt-arm_20.2.6.lts_tests.bat b/tests/axivion/compiler-errata/run_axivion_compiler_errata_ti-cgt-arm_20.2.6.lts_tests.bat new file mode 100644 index 00000000..62361242 --- /dev/null +++ b/tests/axivion/compiler-errata/run_axivion_compiler_errata_ti-cgt-arm_20.2.6.lts_tests.bat @@ -0,0 +1,85 @@ +@REM Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +@REM All rights reserved. +@REM +@REM SPDX-License-Identifier: BSD-3-Clause +@REM +@REM Redistribution and use in source and binary forms, with or without +@REM modification, are permitted provided that the following conditions are met: +@REM +@REM 1. Redistributions of source code must retain the above copyright notice, this +@REM list of conditions and the following disclaimer. +@REM +@REM 2. Redistributions in binary form must reproduce the above copyright notice, +@REM this list of conditions and the following disclaimer in the documentation +@REM and/or other materials provided with the distribution. +@REM +@REM 3. Neither the name of the copyright holder nor the names of its +@REM contributors may be used to endorse or promote products derived from +@REM this software without specific prior written permission. +@REM +@REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +@REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +@REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +@REM DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +@REM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +@REM DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +@REM SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +@REM CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +@REM OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +@REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@REM +@REM We kindly request you to use one or more of the following phrases to refer to +@REM foxBMS in your hardware, software, documentation or advertising materials: +@REM +@REM - "This product uses parts of foxBMS®" +@REM - "This product includes parts of foxBMS®" +@REM - "This product is derived from foxBMS®" + +@setlocal enableextensions enabledelayedexpansion + +@pushd %~dp0 +@CALL :NORMALIZE_PATH "%~dp0\..\" +@SET BAUHAUS_CONFIG=%NORMALIZED_PATH% +@ECHO Setting 'BAUHAUS_CONFIG' to '%BAUHAUS_CONFIG%' + +@for /f "tokens=*" %%s in (%~dp0..\..\..\conf\env\paths_win32.txt) do @( + @echo %%s | findstr /i "bauhaus">nul && (@SET BAUHAUS_DIR=%%s) +) + +@REM ensure output directory +@SET AXIVION_BUILD_DIR=%~dp0..\..\..\build\axivion +@IF NOT EXIST %AXIVION_BUILD_DIR% ( + @mkdir %AXIVION_BUILD_DIR% +) + +@REM prefer the perform_tests.exe that is found on PATH +@SET TEST_EXE=perform_tests.exe +@ECHO Searching program '%TEST_EXE%' +@WHERE %TEST_EXE% 1>NUL 2>NUL +@IF %ERRORLEVEL% neq 0 ( + @ECHO '%TEST_EXE%' is not in %%PATH%% + @SET TEST_RUNNER=%BAUHAUS_DIR%\%TEST_EXE% +) ELSE ( + @SET TEST_RUNNER=%TEST_EXE% +) + +@IF exist %TEST_RUNNER% ( + @ECHO Using '%TEST_RUNNER%' +) ELSE ( + @WHERE %TEST_EXE% 1>NUL 2>NUL + @IF %ERRORLEVEL% neq 0 ( + @ECHO Could not find program '%TEST_RUNNER%' + @EXIT /b 1 + ) +) +@echo Found '%TEST_RUNNER%' +%TEST_RUNNER% %* --language C11 ti-cgt-arm_20.2.6.lts/*.c +@SET TEST_RUNNER_EXIT_LEVEL=%ERRORLEVEL% + +@SET BAUHAUS_CONFIG= +@popd +@EXIT /B %TEST_RUNNER_EXIT_LEVEL% + +:NORMALIZE_PATH + @SET NORMALIZED_PATH=%~dpfn1 + @EXIT /B diff --git a/tests/axivion/compiler_config.json b/tests/axivion/compiler_config.json index 3bbf27ad..5799f2e4 100644 --- a/tests/axivion/compiler_config.json +++ b/tests/axivion/compiler_config.json @@ -32,7 +32,7 @@ "variadic_macros": "enabled" }, "language_version": "C11", - "native_compiler": "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\bin\\armcl.EXE", + "native_compiler": "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\bin\\armcl.EXE", "preprocessing": { "predefined_macros": { "_OPTIMIZE_FOR_SPACE": "1", @@ -113,20 +113,20 @@ }, "sys_include_envvar": null, "sys_include_path": [ - "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\include" + "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\include" ], "user_include_path": [] } }, - "language_c.command.#": "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\bin\\armcl.EXE --silicon_version=7R5 --code_state=32 --float_support=VFPv3D16 -g --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --c11 -Ooff --issue_remarks --strict_ansi", - "language_c.info.#": "20.2.5\n", + "language_c.command.#": "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\bin\\armcl.EXE --silicon_version=7R5 --code_state=32 --float_support=VFPv3D16 -g --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --c11 -Ooff --issue_remarks --strict_ansi", + "language_c.info.#": "20.2.6\n", "language_cxx": { "features": { "exceptions": false, "runtime_type_information": false }, "language_version": "Cpp14", - "native_compiler": "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\bin\\armcl.EXE", + "native_compiler": "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\bin\\armcl.EXE", "preprocessing": { "predefined_macros": { "_BOOL": "1", @@ -209,23 +209,23 @@ "__unsigned_chars__": "1" }, "sys_include_path": [ - "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\include\\libcxx", - "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\include" + "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\include\\libcxx", + "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\include" ], "user_include_path": [] } }, - "language_cxx.command.#": "C:\\ti\\ccs1100\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.5.LTS\\bin\\armcl.EXE --silicon_version=7R5 --code_state=32 --float_support=VFPv3D16 -g --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --c11 -Ooff --issue_remarks --strict_ansi", - "language_cxx.info.#": "20.2.5\n", + "language_cxx.command.#": "C:\\ti\\ccs1200\\ccs\\tools\\compiler\\ti-cgt-arm_20.2.6.LTS\\bin\\armcl.EXE --silicon_version=7R5 --code_state=32 --float_support=VFPv3D16 -g --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --c11 -Ooff --issue_remarks --strict_ansi", + "language_cxx.info.#": "20.2.6\n", "linker": { - "library_path": [], "advanced": { "ignore_input_files": { "$(delta:+)": [ "*.cmd" ] } - } + }, + "library_path": [] }, "preincludes": { "$(delta:+)": [ @@ -549,11 +549,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/config-test/run_axivion_config_tests.bat b/tests/axivion/config-test/run_axivion_config_tests.bat index 1ba762b5..fb65d615 100644 --- a/tests/axivion/config-test/run_axivion_config_tests.bat +++ b/tests/axivion/config-test/run_axivion_config_tests.bat @@ -38,7 +38,7 @@ @setlocal enableextensions enabledelayedexpansion @pushd %~dp0 -@CALL :NORMALIZEPATH "%~dp0\..\ +@CALL :NORMALIZE_PATH "%~dp0\..\" @SET BAUHAUS_CONFIG=%NORMALIZED_PATH% @ECHO Setting 'BAUHAUS_CONFIG' to '%BAUHAUS_CONFIG%' @@ -46,9 +46,15 @@ @echo %%s | findstr /i "bauhaus">nul && (@SET BAUHAUS_DIR=%%s) ) -@REM preferr the perform_tests.exe that is found on PATH +@REM ensure output directory +@SET AXIVION_BUILD_DIR=%~dp0..\..\..\build\axivion +@IF NOT EXIST %AXIVION_BUILD_DIR% ( + @mkdir %AXIVION_BUILD_DIR% +) + +@REM prefer the perform_tests.exe that is found on PATH @SET TEST_EXE=perform_tests.exe -@ECHO Seraching program '%TEST_EXE%' +@ECHO Searching program '%TEST_EXE%' @WHERE %TEST_EXE% 1>NUL 2>NUL @IF %ERRORLEVEL% neq 0 ( @ECHO '%TEST_EXE%' is not in %%PATH%% @@ -73,6 +79,6 @@ @popd @EXIT /B %ERRORLEVEL% -:NORMALIZEPATH +:NORMALIZE_PATH @SET NORMALIZED_PATH=%~dpfn1 @EXIT /B diff --git a/tests/axivion/qualification-test/.clang-format b/tests/axivion/qualification-test/.clang-format new file mode 100644 index 00000000..9d159247 --- /dev/null +++ b/tests/axivion/qualification-test/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/tests/axivion/qualification-test/README.md b/tests/axivion/qualification-test/README.md new file mode 100644 index 00000000..9575110a --- /dev/null +++ b/tests/axivion/qualification-test/README.md @@ -0,0 +1,22 @@ +# Axivion Tool Qualification Kit + +This directory and its subdirectories contain the Axivion Tool Qualification +Kit (TQK). + +> **NOTE:** ``perform_tests.exe`` must be on PATH in the correct version. + +- The test files of the TQK are in the directory ``./qualification-kit/``. + **The test files are not part of the public foxBMS 2 release.** +- To ensure that the test suite is not changed inadvertently, the SHA-256 of + the directory is checked in CI: + ```console + C:\Users\vulpes\Documents\foxbms-2>tools\utils\cmd\run-python-script.bat tools\utils\verify_checksums.py tests\axivion\qualification-test\qualification-kit -vv + ``` +- If the TQK is changed/updated the following needs to be done: + - The changes need to be applied in ``./qualification-kit/`` + - The known SHA-256 of the test files needs to be updated in the CI step. + - the commit message **MUST** contain ``Axivion``. + This ensures that the TQK is run. +- When the Axivion Bauhaus Suite is updated, the TQK needs also to be updated. + The pinned Bauhaus version is found in + ``/conf/env/paths_win32.txt``. diff --git a/tests/axivion/qualification-test/run_axivion_qualification_kit_tests.bat b/tests/axivion/qualification-test/run_axivion_qualification_kit_tests.bat new file mode 100644 index 00000000..7dc1717a --- /dev/null +++ b/tests/axivion/qualification-test/run_axivion_qualification_kit_tests.bat @@ -0,0 +1,85 @@ +@REM Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +@REM All rights reserved. +@REM +@REM SPDX-License-Identifier: BSD-3-Clause +@REM +@REM Redistribution and use in source and binary forms, with or without +@REM modification, are permitted provided that the following conditions are met: +@REM +@REM 1. Redistributions of source code must retain the above copyright notice, this +@REM list of conditions and the following disclaimer. +@REM +@REM 2. Redistributions in binary form must reproduce the above copyright notice, +@REM this list of conditions and the following disclaimer in the documentation +@REM and/or other materials provided with the distribution. +@REM +@REM 3. Neither the name of the copyright holder nor the names of its +@REM contributors may be used to endorse or promote products derived from +@REM this software without specific prior written permission. +@REM +@REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +@REM AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +@REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +@REM DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +@REM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +@REM DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +@REM SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +@REM CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +@REM OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +@REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@REM +@REM We kindly request you to use one or more of the following phrases to refer to +@REM foxBMS in your hardware, software, documentation or advertising materials: +@REM +@REM - "This product uses parts of foxBMS®" +@REM - "This product includes parts of foxBMS®" +@REM - "This product is derived from foxBMS®" + +@setlocal enableextensions enabledelayedexpansion + +@pushd %~dp0 +@CALL :NORMALIZE_PATH "%~dp0\..\" +@SET BAUHAUS_CONFIG=%NORMALIZED_PATH% +@ECHO Setting 'BAUHAUS_CONFIG' to '%BAUHAUS_CONFIG%' + +@for /f "tokens=*" %%s in (%~dp0..\..\..\conf\env\paths_win32.txt) do @( + @echo %%s | findstr /i "bauhaus">nul && (@SET BAUHAUS_DIR=%%s) +) + +@REM ensure output directory +@SET AXIVION_BUILD_DIR=%~dp0..\..\..\build\axivion +@IF NOT EXIST %AXIVION_BUILD_DIR% ( + @mkdir %AXIVION_BUILD_DIR% +) + +@REM prefer the perform_tests.exe that is found on PATH +@SET TEST_EXE=perform_tests.exe +@ECHO Searching program '%TEST_EXE%' +@WHERE %TEST_EXE% 1>NUL 2>NUL +@IF %ERRORLEVEL% neq 0 ( + @ECHO '%TEST_EXE%' is not in %%PATH%% + @SET TEST_RUNNER=%BAUHAUS_DIR%\%TEST_EXE% +) ELSE ( + @SET TEST_RUNNER=%TEST_EXE% +) + +@IF exist %TEST_RUNNER% ( + @ECHO Using '%TEST_RUNNER%' +) ELSE ( + @WHERE %TEST_EXE% 1>NUL 2>NUL + @IF %ERRORLEVEL% neq 0 ( + @ECHO Could not find program '%TEST_RUNNER%' + @EXIT /b 1 + ) +) +@echo Found '%TEST_RUNNER%' +%TEST_RUNNER% %* --language C11 */*/*.c */*/*.tst */*/*/*.c */*/*/*.tst */*/*/*/*.c */*/*/*/*.tst */*/*/*/*/*.c */*/*/*/*/*.tst +@SET TEST_RUNNER_EXIT_LEVEL=%ERRORLEVEL% + +@SET BAUHAUS_CONFIG= +@popd +@EXIT /B %TEST_RUNNER_EXIT_LEVEL% + +:NORMALIZE_PATH + @SET NORMALIZED_PATH=%~dpfn1 + @EXIT /B diff --git a/tests/axivion/rule_config_addon.json b/tests/axivion/rule_config_addon.json index 1b8823f4..3224daa9 100644 --- a/tests/axivion/rule_config_addon.json +++ b/tests/axivion/rule_config_addon.json @@ -69,11 +69,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/rule_config_bad_tokens.json b/tests/axivion/rule_config_bad_tokens.json index 73173dbc..23119dd8 100644 --- a/tests/axivion/rule_config_bad_tokens.json +++ b/tests/axivion/rule_config_bad_tokens.json @@ -20,11 +20,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/rule_config_c.json b/tests/axivion/rule_config_c.json index 9e42dae8..74e53369 100644 --- a/tests/axivion/rule_config_c.json +++ b/tests/axivion/rule_config_c.json @@ -1384,11 +1384,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/rule_config_c.py b/tests/axivion/rule_config_c.py index 15a36c05..0b31f9d8 100644 --- a/tests/axivion/rule_config_c.py +++ b/tests/axivion/rule_config_c.py @@ -89,7 +89,7 @@ def disallow_unjustified_deviations(issue): """forbid suppressing without justification""" - if issue.disabled: # TODO: see mail #9172 + if hasattr(issue, "disabled"): # TODO: see mail #9172 if not issue.justification: issue.disabled = False diff --git a/tests/axivion/rule_config_metric_lines.json b/tests/axivion/rule_config_metric_lines.json index 63a9b194..ff3cf983 100644 --- a/tests/axivion/rule_config_metric_lines.json +++ b/tests/axivion/rule_config_metric_lines.json @@ -94,11 +94,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/rule_config_names.json b/tests/axivion/rule_config_names.json index e772bc30..5c8ca2f8 100644 --- a/tests/axivion/rule_config_names.json +++ b/tests/axivion/rule_config_names.json @@ -150,11 +150,11 @@ } }, "_Format": "1.0", - "_Version": "7.4.0", + "_Version": "7.4.6", "_VersionNum": [ 7, 4, - 0, - 9870 + 6, + 10210 ] } diff --git a/tests/axivion/scripts/README.md b/tests/axivion/scripts/README.md index d02b19eb..00264a89 100644 --- a/tests/axivion/scripts/README.md +++ b/tests/axivion/scripts/README.md @@ -1,5 +1,7 @@ # Helper Scripts to Interact with Axivion Bauhaus Suite +## Directory Description + These are helper scripts for the interaction with the Axivion Bauhaus Suite in the foxBMS 2 project (The Axivion configuration is described in this [README.md](../README.md)). @@ -13,13 +15,20 @@ Files here might need to be updated to the local Axivion setup. ``` gravis --script tests/axivion/scripts/gravis_export_architecture_svg.py ``` -- ``scripts/ci_check_freshness_of_architecture_svg.py`` is used to check whether the - git timestamps of the architecture documentation and the rendered SVG are aligned, i.e., - one can not change the architecture without updating the architecture image - in the documentation. +- ``scripts/ci_check_freshness_of_architecture_svg.py`` is used to check + whether the git timestamps of the architecture documentation and the rendered + SVG are aligned, i.e., one can not change the architecture without updating + the architecture image in the documentation. The script needs to be invoked by as follows: ``` tools/utils/cmd/run-python-script.bat tests/axivion/scripts ci_check_freshness_of_architecture_svg.py ``` -- ``scripts/wrapper_make_race_pdfs.bat`` wrapper script to simplify creating the -race condition report. +- ``scripts/wrapper_make_race_pdfs.bat`` wrapper script to simplify creating + the race condition report. + +## Local Build + +1. Run once ``tests/axivion/scripts/start_local_dashserver.bat`` to start a + local dashserver. +1. Then, run ``tests/axivion/scripts/start_local_analysis.bat`` to run a local + analysis build. diff --git a/tests/axivion/scripts/start_local_analysis.bat b/tests/axivion/scripts/start_local_analysis.bat index d7661e1b..57378009 100644 --- a/tests/axivion/scripts/start_local_analysis.bat +++ b/tests/axivion/scripts/start_local_analysis.bat @@ -41,5 +41,26 @@ @set AXIVION_LOCAL_BUILD=TRUE @set STORE_REQUESTS_CA_BUNDLE=%REQUESTS_CA_BUNDLE% @set REQUESTS_CA_BUNDLE=%USERPROFILE%\.bauhaus\auto.crt + + +@FOR /F "tokens=* USEBACKQ" %%F IN (`git branch --show-current`) DO @( + @SET AXIVION_BRANCH_NAME=%%F +) + +@SET projectName=foxbms-2 +@SET analysisProjectName = %projectName% + "-" + %AXIVION_BRANCH_NAME% + "-" + %USERNAME% +@ECHO %analysisProjectName% + +@SET projectShadowRepo=%USERPROFILE%\.bauhaus\%projectName% +@ECHO Shadow repo is at '%projectShadowRepo%'. +@IF NOT EXIST %projectShadowRepo% ( + @mkdir %projectShadowRepo% +) + +@IF %ERRORLEVEL% NEQ 0 ( + @EXIT /b %ERRORLEVEL% +) +@ECHO Dashboard url is: %AXIVION_DASHBOARD_URL% + @call %~dp0start_analysis.bat @set REQUESTS_CA_BUNDLE=%STORE_REQUESTS_CA_BUNDLE% diff --git a/tests/axivion/scripts/wrapper_make_race_pdfs.bat b/tests/axivion/scripts/wrapper_make_race_pdfs.bat index b09c6cd7..1a10e3a9 100644 --- a/tests/axivion/scripts/wrapper_make_race_pdfs.bat +++ b/tests/axivion/scripts/wrapper_make_race_pdfs.bat @@ -38,5 +38,5 @@ @SETLOCAL EnableExtensions EnableDelayedExpansion @SET BAUHAUS_CONFIG=%~dp0\..\ -@SET PATH=%PATH%;C:\Bauhaus\7.4.0\doc\html\_downloads\87991abe35fa881bf14ce6d55f075d2d +@SET PATH=%PATH%;C:\Bauhaus\7.4.6\doc\html\_downloads\87991abe35fa881bf14ce6d55f075d2d @call make_race_pdfs.bat %USERPROFILE%\.bauhaus\localbuild\projects\foxbms-2.ir %USERPROFILE%\.bauhaus\localbuild\projects\foxbms-2.rfg diff --git a/tests/c-std/c-std-test-inline-helper.h b/tests/c-std/c-std-test-inline-helper.h index 5b7de3a3..3fa0dd95 100644 --- a/tests/c-std/c-std-test-inline-helper.h +++ b/tests/c-std/c-std-test-inline-helper.h @@ -43,8 +43,8 @@ * @file c-std-test-inline-helper.h * @author foxBMS Team * @date 2022-03-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TESTS * @prefix TEST * diff --git a/tests/c-std/c-std-test.c b/tests/c-std/c-std-test.c index 34319a58..98a9bd5c 100644 --- a/tests/c-std/c-std-test.c +++ b/tests/c-std/c-std-test.c @@ -43,8 +43,8 @@ * @file c-std-test.c * @author foxBMS Team * @date 2022-03-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup TESTS * @prefix TEST * diff --git a/tests/can/check_ids.py b/tests/can/check_ids.py new file mode 100644 index 00000000..a5970cd2 --- /dev/null +++ b/tests/can/check_ids.py @@ -0,0 +1,432 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# We kindly request you to use one or more of the following phrases to refer to +# foxBMS in your hardware, software, documentation or advertising materials: +# +# - "This product uses parts of foxBMS®" +# - "This product includes parts of foxBMS®" +# - "This product is derived from foxBMS®" + +"""Python script to check if all callbacks defined in the .dbc file are +implemented in callback functions.""" +import argparse +import logging +import os +import re +import sys +from pathlib import Path +from dataclasses import dataclass +from enum import Enum, auto + +import cantools +import tabulate + +HAVE_GIT = False +try: + from git import Repo + from git.exc import InvalidGitRepositoryError + + HAVE_GIT = True +except ImportError: + pass + +FILE_RE = r"\(in:([a-z_-]{1,}\.c):([A-Z]{2,5}_.*), fv:((tx)|(rx))\)" +FILE_RE_COMPILED = re.compile(FILE_RE) + + +def get_git_root(path: str) -> str: + """helper function to find the repository root + + Args: + path (string): path of test_f_guidelines + + Returns: + root (string): root path of the git repository + """ + root = os.path.join(os.path.dirname(path), "..", "..", "..") + if HAVE_GIT: + try: + repo = Repo(path, search_parent_directories=True) + root = repo.git.rev_parse("--show-toplevel") + except InvalidGitRepositoryError: + pass + return root + + +ROOT = Path(get_git_root(os.path.realpath(__file__))) +BDC_DIR_REL = Path(os.path.join("tools", "dbc")) +SRC_DIR_REL = Path(os.path.join("src", "app")) +DRIVER_CONFIGURATION_FILES = Path(os.path.join("driver", "config")) +RX_MESSAGES = ( + ROOT + / SRC_DIR_REL + / DRIVER_CONFIGURATION_FILES + / Path("can_cfg_rx-message-definitions.h") +) +TX_MESSAGES = ( + ROOT + / SRC_DIR_REL + / DRIVER_CONFIGURATION_FILES + / Path("can_cfg_tx-message-definitions.h") +) + + +class RxTx(Enum): + """Defines whether a message is to be received or transmitted""" + + Tx = auto() # pylint: disable=invalid-name + Rx = auto() # pylint: disable=invalid-name + + +@dataclass +class ExpectedCanMessageDefines: + """container for defines""" + + msg_name: str + exp_message_id_macro: str + exp_period_macro: str + exp_phase_macro: str + exp_full_message_macro: str + msg_id: str + direction: RxTx + + +@dataclass +class FoundCanMessageDefine: + """container for defines""" + + define_name: str + msg_id: str + where: str + is_dummy: bool = False + + +def construct_msg_define(msg) -> ExpectedCanMessageDefines: + """Create the base expected define name for the message""" + define_name: str = msg.name + if define_name.lower().startswith("foxbms_"): + define_name = define_name[7:] + basic_define_name = define_name[0].upper() + message_macro = basic_define_name + for i, char in enumerate(define_name[1:]): + if define_name[i].islower() and char.isupper(): # i!!! + message_macro = message_macro + "_" + elif define_name[i].isnumeric() and char.isupper(): # i!!! + message_macro = message_macro + "_" + message_macro = message_macro + char.upper() + message_id_macro = message_macro + "_ID" + period_macro = message_macro + "_PERIOD_ms" + phase_macro = message_macro + "_PHASE_ms" + full_message_macro = message_macro + "_MESSAGE" + + # once we are here, we know that this regex will match + m = FILE_RE_COMPILED.search(msg.comment) # pylint: disable=invalid-name + if m.group(3).lower() == "rx": + direction = RxTx.Rx + pref = "CANRX_" + phase_macro = "Rx has no phase" # receive messages have ne phase + elif m.group(3).lower() == "tx": + direction = RxTx.Tx + pref = "CANTX_" + phase_macro = "CANTX_" + phase_macro + else: + sys.exit("Something went wrong.") + message_id_macro = pref + message_id_macro + period_macro = pref + period_macro + full_message_macro = pref + full_message_macro + + logging.debug(f"created define '{message_id_macro}' for '{msg.name}'.") + logging.debug(f"created define '{period_macro}' for '{msg.name}'.") + if phase_macro != "Rx has no phase": + logging.debug(f"created define '{phase_macro}' for '{msg.name}'.") + logging.debug(f"created define '{full_message_macro}' for '{msg.name}'.") + return ExpectedCanMessageDefines( + msg.name, + message_id_macro, + period_macro, + phase_macro, + full_message_macro, + hex(msg.frame_id), + direction, + ) + + +def get_defines_from_file( + file_to_check: Path, selector: str +) -> list[FoundCanMessageDefine]: + """Generate a list of specific CAN defines found in a provided file.""" + defines = [] + with open(file_to_check, "r", encoding="utf-8") as f: + txt = f.read() + for i, line in enumerate(txt.splitlines()): + line: str = line.strip() + if not line.startswith("#define"): + continue + if not selector in line: + continue + line = line.split() + found_define = FoundCanMessageDefine( + line[1], line[2][1:-1], f"{file_to_check}:{i-1}" + ) + if found_define.msg_id.endswith("u"): + found_define.msg_id = found_define.msg_id[:-1] + if "dummy" in line: + found_define.is_dummy = True + defines.append(found_define) + logging.debug(found_define) + return defines + + +def log_found_msgs( + selector: str, implemented_defines: list[FoundCanMessageDefine] +) -> None: + """Logging helper for found messages""" + header = ["Name", "Define name", "ID"] + table = [] + for i in implemented_defines: + table.append([i.where, i.define_name, i.msg_id]) + table = tabulate.tabulate(table, header, tablefmt="pipe") + logging.info(f"Implemented {selector} defines are:\n{table}\n") + + +def log_found(expected_define_name, where) -> None: + """Logging helper for found messages""" + logging.debug(f"-> Found expected: {expected_define_name} @ {where}") + + +def log_not_found(exp: ExpectedCanMessageDefines, i: str, expected_file: str) -> None: + """Logging helper for NOT found messages""" + logging.error( + f"Did not find {exp.direction.name} implementation of expected macro '{i}' for" + f"'{exp.exp_message_id_macro} ({exp.msg_id})' in '{expected_file}'." + ) + + +def main(): # pylint: disable=too-many-branches + """This script checks that the CAN message IDs that are defined in the dbc + file are correctly implemented.""" + parser = argparse.ArgumentParser() + parser.add_argument( + "-v", + "--verbosity", + dest="verbosity", + action="count", + default=0, + help="set verbosity level", + ) + parser.add_argument( + "-i", + "--input-file", + dest="input_file", + action="store", + default=BDC_DIR_REL / "foxbms.dbc", + help="DBC file to be verified.", + ) + parser.add_argument( + "-t", + "--tx-message-definition-file", + dest="tx_message_definition_file", + action="store", + default=TX_MESSAGES, + help="Path to file containing the implementation TX CAN message IDs", + ) + parser.add_argument( + "-r", + "--rx-message-definition-file", + dest="rx_message_definition_file", + action="store", + default=RX_MESSAGES, + help="Path to file containing the implementation RX CAN message IDs", + ) + args = parser.parse_args() + + if args.verbosity == 1: + logging.basicConfig(level=logging.INFO) + elif args.verbosity > 1: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.ERROR) + logging.debug(args) + + if not isinstance(args.input_file, Path): + args.input_file = Path(args.input_file) + input_file = args.input_file.absolute() + can_db = cantools.database.load_file(input_file) + sorted_messages = sorted(can_db.messages, key=lambda x: x.frame_id) + + errors = 0 + for i in sorted_messages: + if not i.comment: + errors += 1 + logging.error( + f"Could not find any comment for message '{i.name}' ({hex(i.frame_id)})." + ) + continue + logging.info( + f"Found comment for message '{i.name}' ({hex(i.frame_id)}): '{i.comment}'." + ) + m = FILE_RE_COMPILED.search(i.comment) # pylint: disable=invalid-name + if not m: + errors += 1 + logging.error( + "Could not find comment for message " + f"'{i.name}' ({hex(i.frame_id)}) that matches '{FILE_RE}'." + ) + continue + if errors: + return errors + + if not isinstance(args.tx_message_definition_file, Path): + args.tx_message_definition_file = Path(args.tx_message_definition_file) + if not args.tx_message_definition_file.is_file(): + sys.exit(f"'{args.tx_message_definition_file}' is not a valid file path.") + + if not isinstance(args.rx_message_definition_file, Path): + args.rx_message_definition_file = Path(args.rx_message_definition_file) + if not args.rx_message_definition_file.is_file(): + sys.exit(f"'{args.rx_message_definition_file}' is not a valid file path.") + + expected_defines = [construct_msg_define(msg) for msg in sorted_messages] + header = [ + "Name", + "Expected message macro", + "Expected period macro", + "Expected phase macro", + "Full message macro", + "ID", + "Direction", + ] + table = [] + for i in expected_defines: + table.append( + [ + i.msg_name, + i.exp_message_id_macro, + i.exp_period_macro, + i.exp_phase_macro, + i.exp_full_message_macro, + i.msg_id, + i.direction.name, + ] + ) + table = tabulate.tabulate(table, header, tablefmt="pipe") + logging.info(f"Expected defines are:\n{table}\n") + + all_tx_defines = get_defines_from_file(args.tx_message_definition_file, "CANTX") + implemented_tx_defines = [ + i + for i in all_tx_defines + if (i.define_name.startswith("CANTX_") and i.define_name.endswith("_ID")) + ] + log_found_msgs("TX", implemented_tx_defines) + + all_rx_defines = get_defines_from_file(args.rx_message_definition_file, "CANRX") + implemented_rx_defines = [ + i + for i in all_rx_defines + if (i.define_name.startswith("CANRX_") and i.define_name.endswith("_ID")) + ] + log_found_msgs("RX", implemented_rx_defines) + errors = len(expected_defines) * 4 + for exp in expected_defines: + for i in [ + exp.exp_message_id_macro, + exp.exp_period_macro, + exp.exp_phase_macro, + exp.exp_full_message_macro, + ]: + found = False + if exp.direction == RxTx.Rx: + implemented_macros = all_rx_defines + expected_file = args.rx_message_definition_file + if i == "Rx has no phase": # rx messages do not have a phase + found = True + errors -= 1 + continue + elif exp.direction == RxTx.Tx: + implemented_macros = all_tx_defines + expected_file = args.tx_message_definition_file + else: + sys.exit("Something went really wrong...") + logging.debug(f"Searching {i} ({exp.msg_id}) in {expected_file}") + for macro in implemented_macros: + logging.debug(f" Comparing against {macro.define_name}") + if macro.define_name == i: + log_found(i, macro.where) + errors -= 1 + found = True + break + if not found: + log_not_found(exp, i, expected_file) + + # check if the id, period and phase macro appear twice in the message + # definition file. If so, we can assume that it has been defined once + # and used a second time. + dummies = [i.define_name for i in all_tx_defines + all_rx_defines if i.is_dummy] + for i in [ + exp.exp_message_id_macro, + exp.exp_period_macro, + exp.exp_phase_macro, + ]: + if i in dummies: + continue + if exp.direction == RxTx.Rx: + expected_file = args.rx_message_definition_file + if i == "Rx has no phase": # rx messages do not have a phase + continue + elif exp.direction == RxTx.Tx: + expected_file = args.tx_message_definition_file + else: + sys.exit("Something went really wrong...") + + with open(expected_file, "r", encoding="utf-8") as f: + txt = f.read() + # some message might start with the same name, therefore checking + # if it occurs two times is not good, but modulo 2 and no remainder + # is! + if not txt.count(i) % 2 == 0: + errors += 1 + logging.error( + f"Expected to find {i} twice: definition and in *_MESSAGE usage.\n" + f"Found it {txt.count(i)} times." + ) + + return errors + + +if __name__ == "__main__": + nr_of_errors = main() + if nr_of_errors: + logging.error(f"{nr_of_errors} found.") + sys.exit(nr_of_errors) diff --git a/tests/can/check_implemented.py b/tests/can/check_implemented.py index 7e39cc87..d4a4a844 100644 --- a/tests/can/check_implemented.py +++ b/tests/can/check_implemented.py @@ -58,7 +58,7 @@ except ImportError: pass -FILE_RE = r"\(in:(.*):(.*)\)" +FILE_RE = r"\(in:([a-z_-]{1,}\.c):([A-Z]{2,5}_.*), fv:((tx)|(rx))\)" FILE_RE_COMPILED = re.compile(FILE_RE) @@ -99,7 +99,7 @@ def evaluate_implementation(callback_file: Path, function_name: str) -> bool: def main(): - """This script produces a symbole file for cell voltages and temperatures""" + """This script checks whether a expected callback is implemented.""" parser = argparse.ArgumentParser() parser.add_argument( "-v", diff --git a/tests/ccs/ccs1200/ccs1200_cc-options.yaml b/tests/ccs/ccs1200/ccs1200_cc-options.yaml new file mode 100644 index 00000000..341295ab --- /dev/null +++ b/tests/ccs/ccs1200/ccs1200_cc-options.yaml @@ -0,0 +1,112 @@ +# Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# We kindly request you to use one or more of the following phrases to refer to +# foxBMS in your hardware, software, documentation or advertising materials: +# +# - "This product uses parts of foxBMS®" +# - "This product includes parts of foxBMS®" +# - "This product is derived from foxBMS®" + +FOXBMS_2_CCS_VERSION_STRICT: "v20.2.6.LTS" + +INCLUDE_PATHS: + win32: + linux: + +LIBRARY_PATHS: + win32: + linux: + +LIBRARIES: + ST: # libraries following the pattern "lib.a" + TARGET: # libraries following the pattern ".lib" + - rtsv7R4_A_be_v3D16_eabi + +CFLAGS: + # flags that are used for ALL source files (foxBMS, Operating System, HAL) + common: + - --silicon_version=7R5 + - --code_state=32 + - --float_support=VFPv3D16 + - -g + - --diag_wrap=off + - --display_error_number + - --enum_type=packed + - --abi=eabi + - --c11 + # these flags are not used when generating ppi/ppd/ppm information + common_compile_only: + - --emit_warnings_as_errors + # additional flags that are ONLY applied to foxBMS sources + foxbms: + - -Ooff + - -DASSERT_LEVEL=0 + - --issue_remarks + - --strict_ansi + # additional flags that are ONLY applied to hal sources + hal: + - -O3 # default + # additional flags that are ONLY applied to operating system sources + operating_system: + - -O3 # default + - --strict_ansi + +LINKFLAGS: + - --emit_warnings_as_errors + - --be32 + - --rom_model + - --heap_size=0x800 + - --stack_size=0x800 + - --undef_sym=__TI_static_base__ + - --undef_sym=resetEntry + - -o4 + - --unused_section_elimination + - --strict_compatibility=on + - --zero_init=on + - --scan_libraries + +HEXGENFLAGS: + - --memwidth=32 + - --tektronix + - -image + - --load_image + - --load_image:combine_sections=true + - --load_image:endian=big + - --load_image:file_type=executable + - --load_image:format=elf + - --load_image:machine=ARM + - --load_image:output_symbols=true + - --load_image:section_addresses=false + +NMFLAGS: + - --all + - -f + - -l diff --git a/tests/ccs/ccs1200/ccs1200_linker_pulls.json b/tests/ccs/ccs1200/ccs1200_linker_pulls.json new file mode 100644 index 00000000..b3cf64d3 --- /dev/null +++ b/tests/ccs/ccs1200/ccs1200_linker_pulls.json @@ -0,0 +1,5 @@ +{ + "_c_int00": "src/app/main/fstartup.c.1.obj", + "canMessageNotification": "src/app/driver/libfoxbms-driver.a", + "dmaGroupANotification": "src/app/driver/libfoxbms-driver.a" +} diff --git a/tests/ccs/ccs1200/ccs1200_paths_linux.txt b/tests/ccs/ccs1200/ccs1200_paths_linux.txt new file mode 100644 index 00000000..4832b935 --- /dev/null +++ b/tests/ccs/ccs1200/ccs1200_paths_linux.txt @@ -0,0 +1,4 @@ +/opt/ti/ccs1200/ccs/tools/compiler/ti-cgt-arm_20.2.6.LTS/bin +/opt/ti/ccs1200/ccs/tools/compiler/ti-cgt-arm_20.2.6.LTS/lib +/opt/ti/ccs1200/ccs/utils/bin +/opt/ti/ccs1200/ccs/utils/tiobj2bin diff --git a/tests/ccs/ccs1200/ccs1200_paths_win32.txt b/tests/ccs/ccs1200/ccs1200_paths_win32.txt new file mode 100644 index 00000000..c1970e61 --- /dev/null +++ b/tests/ccs/ccs1200/ccs1200_paths_win32.txt @@ -0,0 +1,10 @@ +C:\ti\ccs1200\ccs\tools\compiler\ti-cgt-arm_20.2.6.LTS\bin +C:\ti\ccs1200\ccs\tools\compiler\ti-cgt-arm_20.2.6.LTS\lib +C:\ti\ccs1200\ccs\utils\bin +C:\ti\ccs1200\ccs\utils\cygwin +C:\ti\ccs1200\ccs\utils\tiobj2bin +C:\ti\Hercules\HALCoGen\v04.07.01 +C:\Program Files\LLVM\13.0.0\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 diff --git a/tests/ccs/ccs1200/ccs1200_remarks.txt b/tests/ccs/ccs1200/ccs1200_remarks.txt new file mode 100644 index 00000000..a9030778 --- /dev/null +++ b/tests/ccs/ccs1200/ccs1200_remarks.txt @@ -0,0 +1,28 @@ +/* entries in this file are ordered by ascending order */ + +/* define has no value, and will be treated as if equal 0 */ +"--"diag_suppress=195 + +/* function has no prototype */ +"--"diag_error=225 + +/* unnecessary semicolon at line end */ +"--"diag_error=383 + +/* not referenced */ +"--"diag_remark=880 + +/* signed and unsigned comparison */ +"--"diag_error=2142 + +/* shadowing variable */ +"--"diag_remark=2710 + +/* enum comparison of different enum types */ +"--"diag_error=2912 + +/* automatic Runtime Support library selection */ +"--"diag_error=10205 + +/* Symbol defined multiple times */ +"--"diag_remark=10252 diff --git a/tests/dbc/check_parseable.py b/tests/dbc/check_parseable.py new file mode 100644 index 00000000..b1a5e60d --- /dev/null +++ b/tests/dbc/check_parseable.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# We kindly request you to use one or more of the following phrases to refer to +# foxBMS in your hardware, software, documentation or advertising materials: +# +# - "This product uses parts of foxBMS®" +# - "This product includes parts of foxBMS®" +# - "This product is derived from foxBMS®" + +"""Ensure that the CAN definition files (symbol and dbc) are parsable.""" + +import sys +import logging +from pathlib import Path +import git +from git.exc import InvalidGitRepositoryError +import click +import colorama +import cantools + + +SCRIPT_DIR = Path(__file__).parent.resolve() + +try: + repo = git.Repo(SCRIPT_DIR, search_parent_directories=True) + REPO_ROOT = Path(repo.git.rev_parse("--show-toplevel")) +except InvalidGitRepositoryError: + sys.exit("Test can only be run in a git repository.") + + +def set_logging_level(verbose: int = 0) -> None: + """sets the module logging level + + :param verbose: verbosity level""" + if verbose == 1: + logging.basicConfig(level=logging.INFO) + elif verbose > 1: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.ERROR) + + +@click.command(context_settings=dict(help_option_names=["-h", "--help"])) +@click.option("-v", "--verbose", default=0, count=True, help="Verbose information.") +@click.option( + "-s", + "--symbol", + "symbol_file", + default=REPO_ROOT / "tools" / "dbc" / "foxbms.sym", + type=click.Path(exists=True, dir_okay=False), + is_eager=True, + help="FILE path of the symbol file", +) +@click.option( + "-d", + "--dbc", + "dbc_file", + default=REPO_ROOT / "tools" / "dbc" / "foxbms.dbc", + type=click.Path(exists=True, dir_okay=False), + is_eager=True, + help="FILE path of the dbc file", +) +@click.pass_context +def main(ctx: click.Context, verbose: int, symbol_file: Path, dbc_file: Path) -> None: + """Convert symbol file to dbc file""" + colorama.init() + set_logging_level(verbose) + logging.debug("Parsing symbol file...") + cantools.database.load_file(str(symbol_file)) + logging.debug("done") + logging.debug("Parsing dbc file...") + cantools.database.load_file(str(dbc_file)) + logging.debug("done") + logging.info(f"{symbol_file} and {dbc_file} files are parsable.") + ctx.exit(0) + + +if __name__ == "__main__": + main() # pylint: disable=no-value-for-parameter diff --git a/tests/dbc/overlapping-signals.dbc b/tests/dbc/overlapping-signals.dbc new file mode 100644 index 00000000..138d5754 --- /dev/null +++ b/tests/dbc/overlapping-signals.dbc @@ -0,0 +1,89 @@ +VERSION "" + + +NS_ : + +BS_: + +BU_: Vector__XXX + +BO_ 544 foxBMS_State: 8 Vector__XXX +SG_ foxBMS_State : 3|4@0+ (1,0) [0|15] "" Vector__XXX +SG_ foxBMS_generalError : 10|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_generalWarning : 9|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_dieTemperatureMCU : 18|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_OvertempPCB : 19|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_UndertempPCB : 20|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_PrechargeVolt : 16|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_PrechargeCurrent : 17|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_insulationMonitoring : 13|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_chargingComplete : 8|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_EmergencyShutoff : 11|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_MainFuseBlown : 21|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_insulationResistance : 63|8@0+ (100,0) [0|25500] "kOhm" Vector__XXX +SG_ foxBMS_Error_Interlock : 22|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_Insulation : 23|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_Error_Cantiming : 24|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_SysMonError : 12|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_alertFlag : 27|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_NegativeContState : 5|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_PositiveContState : 6|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_PrechargeContState : 7|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_AuxiliaryFuseBlown : 23|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_chargingFuseBlown : 24|1@1+ (1,0) [0|1] "" Vector__XXX + + +CM_ BO_ 544 "Message contains foxBMS state (in:can_cbs_tx_state.c:CAN_TxState)"; +CM_ SG_ 544 foxBMS_generalError "0x00: No error detected, 0x01: Error detected"; +CM_ SG_ 544 foxBMS_generalWarning "0x00: No warning detected, 0x01: Warning detected"; +CM_ SG_ 544 foxBMS_Error_dieTemperatureMCU "0x00: No error, 0x01: Error detected"; +CM_ SG_ 544 foxBMS_Error_OvertempPCB "foxBMS Master-PCB: 0x00: No error, 0x01: Error detected"; +CM_ SG_ 544 foxBMS_Error_UndertempPCB "foxBMS Master-PCB: 0x00: No error, 0x01: Error detected"; +CM_ SG_ 544 foxBMS_Error_PrechargeVolt "0x00: precharging successful, 0x01: precharge aborted because of voltage difference"; +CM_ SG_ 544 foxBMS_Error_PrechargeCurrent "0x00: precharging successful, 0x01: precharge aborted because current limit violated"; +CM_ SG_ 544 foxBMS_insulationMonitoring "0x00: insulation monitoring active, 0x01: insulation monitoring not active"; +CM_ SG_ 544 foxBMS_chargingComplete "0x01: charging complete"; +CM_ SG_ 544 foxBMS_EmergencyShutoff "The BMS is preparing to open the contactors soon due to detected error"; +CM_ SG_ 544 foxBMS_MainFuseBlown "0x00: fuse okay, 0x01: fuse blown"; +CM_ SG_ 544 foxBMS_Error_Interlock "0x00: interlock okay, 0x01: interlock open"; +CM_ SG_ 544 foxBMS_Error_Insulation "0x00: No error, 0x01: Error detected"; +CM_ SG_ 544 foxBMS_Error_Cantiming "0x00: No error, 0x01: Error detected"; +CM_ SG_ 544 foxBMS_SysMonError "If this bit is set, it indicates that a task has violated its timing requirements."; +CM_ SG_ 544 foxBMS_alertFlag "foxBMS Alter flag: 0x00: No error, 0x01: Alert flag set"; +CM_ SG_ 544 foxBMS_NegativeContState "0x00: contactor switched OFF, 0x01: contactor switched ON"; +CM_ SG_ 544 foxBMS_PositiveContState "0x00: contactor switched OFF, 0x01: contactor switched ON"; +CM_ SG_ 544 foxBMS_PrechargeContState "0x00: contactor switched OFF, 0x01: contactor switched ON"; +CM_ SG_ 544 foxBMS_AuxiliaryFuseBlown "0x00: fuse okay, 0x01: fuse blown"; +CM_ SG_ 544 foxBMS_chargingFuseBlown "0x00: fuse okay, 0x01: fuse blown"; + +BA_DEF_ "BusType" STRING ; +BA_DEF_ SG_ "GenSigStartValue" FLOAT -3.4E+038 3.4E+038; + +BA_DEF_DEF_ "BusType" "CAN"; +BA_DEF_DEF_ "GenSigStartValue" 0; + +BA_ "BusType" "CAN"; + +BA_ "GenSigStartValue" SG_ 544 foxBMS_State 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_generalError 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_generalWarning 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_dieTemperatureMCU 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_OvertempPCB 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_UndertempPCB 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_PrechargeVolt 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_PrechargeCurrent 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_insulationMonitoring 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_chargingComplete 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_EmergencyShutoff 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_MainFuseBlown 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_insulationResistance 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_Interlock 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_Insulation 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_Cantiming 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_SysMonError 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_alertFlag 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_NegativeContState 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_PositiveContState 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_PrechargeContState 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_AuxiliaryFuseBlown 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_chargingFuseBlown 0; diff --git a/tests/dbc/overlapping-signals.py b/tests/dbc/overlapping-signals.py new file mode 100644 index 00000000..35497884 --- /dev/null +++ b/tests/dbc/overlapping-signals.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# We kindly request you to use one or more of the following phrases to refer to +# foxBMS in your hardware, software, documentation or advertising materials: +# +# - "This product uses parts of foxBMS®" +# - "This product includes parts of foxBMS®" +# - "This product is derived from foxBMS®" + +"""Unit test script, to check cantools behavior regarding overlapping signals.""" + +# pylint: disable=invalid-name + +import unittest +from pathlib import Path +import cantools +from cantools.database import load_file + +SCRIPT_DIR = Path(__file__).parent.resolve() + + +class OverlappingSignals(unittest.TestCase): + """Derived test case""" + + def test_overlapping_signals(self): + """check that cantools raises an error if signals are overlapping in a + message""" + self.assertRaises( + cantools.database.errors.Error, + load_file, + SCRIPT_DIR / "overlapping-signals.dbc", + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/dbc/overlapping-signals.sym b/tests/dbc/overlapping-signals.sym new file mode 100644 index 00000000..48658624 --- /dev/null +++ b/tests/dbc/overlapping-signals.sym @@ -0,0 +1,35 @@ +FormatVersion=5.0 // Do not edit this line! +Title="2022-09-12_foxbms" + +{ENUMS} +enum VtSig_foxBMS_modeRequest(0="mode_Standby", 1="mode_Discharge", + 2="mode_Charge") + +{SENDRECEIVE} + +[foxBMS_State] +ID=220h // Message contains foxBMS state (in:can_cbs_tx_state.c:CAN_TxState) +DLC=8 +Var=foxBMS_State unsigned 4,4 -m +Var=foxBMS_generalError bit 13,1 -m // 0x00: No error detected, 0x01: Error detected +Var=foxBMS_generalWarning bit 14,1 -m // 0x00: No warning detected, 0x01: Warning detected +Var=foxBMS_Error_dieTemperatureMCU bit 21,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_OvertempPCB bit 20,1 -m // foxBMS Master-PCB: 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_UndertempPCB bit 19,1 -m // foxBMS Master-PCB: 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_PrechargeVolt bit 23,1 -m // 0x00: precharging successful, 0x01: precharge aborted because of voltage difference +Var=foxBMS_Error_PrechargeCurrent bit 22,1 -m // 0x00: precharging successful, 0x01: precharge aborted because current limit violated +Var=foxBMS_insulationMonitoring bit 10,1 -m // 0x00: insulation monitoring active, 0x01: insulation monitoring not active +Var=foxBMS_chargingComplete bit 15,1 -m // 0x01: charging complete +Var=foxBMS_EmergencyShutoff bit 12,1 -m // The BMS is preparing to open the contactors soon due to detected error +Var=foxBMS_MainFuseBlown bit 18,1 -m // 0x00: fuse okay, 0x01: fuse blown +Var=foxBMS_insulationResistance unsigned 56,8 -m /u:kOhm /f:100 /d:0 +Var=foxBMS_Error_Interlock bit 17,1 -m // 0x00: interlock okay, 0x01: interlock open +Var=foxBMS_Error_Insulation bit 16,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_Cantiming bit 31,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_SysMonError bit 12,1 // If this bit is set, it indicates that a task has violated its timing requirements. +Var=foxBMS_alertFlag bit 28,1 -m // foxBMS Alter flag: 0x00: No error, 0x01: Alert flag set +Var=foxBMS_NegativeContState bit 5,1 // 0x00: contactor switched OFF, 0x01: contactor switched ON +Var=foxBMS_PositiveContState bit 6,1 // 0x00: contactor switched OFF, 0x01: contactor switched ON +Var=foxBMS_PrechargeContState bit 7,1 // 0x00: contactor switched OFF, 0x01: contactor switched ON +Var=foxBMS_AuxiliaryFuseBlown bit 23,1 // 0x00: fuse okay, 0x01: fuse blown +Var=foxBMS_chargingFuseBlown bit 24,1 // 0x00: fuse okay, 0x01: fuse blown diff --git a/tests/env/packages/env_test_pathspec.py b/tests/env/packages/env_test_pathspec.py index ca0e16aa..9ac6564a 100644 --- a/tests/env/packages/env_test_pathspec.py +++ b/tests/env/packages/env_test_pathspec.py @@ -39,13 +39,26 @@ # - "This product is derived from foxBMS®" """Testing 'pathspec' package""" - +import sys import argparse import logging +from pathlib import Path + # package to test import pathspec # pylint: disable=unused-import +import git +from git.exc import InvalidGitRepositoryError + +SCRIPT_DIR = Path(__file__).parent.resolve() + +try: + repo = git.Repo(SCRIPT_DIR, search_parent_directories=True) + REPO_ROOT = Path(repo.git.rev_parse("--show-toplevel")) +except InvalidGitRepositoryError: + sys.exit("Test can only be run in a git repository.") + def main(): """Testing 'pathspec' package""" @@ -67,6 +80,11 @@ def main(): else: logging.basicConfig(level=logging.ERROR) + gitignore = Path(REPO_ROOT / ".gitignore").read_text(encoding="utf-8") + pathspec.PathSpec.from_lines( + pathspec.patterns.GitWildMatchPattern, gitignore.splitlines() + ) + if __name__ == "__main__": main() diff --git a/tests/scripts/waf-tools/f_guidelines/tests/c-004_tests/c-004_test5.c b/tests/scripts/waf-tools/f_guidelines/tests/c-004_tests/c-004_test5.c index c7f4b70b..1a701192 100644 --- a/tests/scripts/waf-tools/f_guidelines/tests/c-004_tests/c-004_test5.c +++ b/tests/scripts/waf-tools/f_guidelines/tests/c-004_tests/c-004_test5.c @@ -3,7 +3,7 @@ * @file c-004_test0.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-02-22 (date of last update) + * @updated 2022-08-01 (date of last update) * @version v1.0.0 * @ingroup TEMPERATURE_SENSORS * @prefix TSEN diff --git a/tests/unit/app/application/algorithm/config/test_algorithm_cfg.c b/tests/unit/app/application/algorithm/config/test_algorithm_cfg.c index cc2a7464..8787d82b 100644 --- a/tests/unit/app/application/algorithm/config/test_algorithm_cfg.c +++ b/tests/unit/app/application/algorithm/config/test_algorithm_cfg.c @@ -43,8 +43,8 @@ * @file test_algorithm_cfg.c * @author foxBMS Team * @date 2020-06-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/moving_average/test_moving_average.c b/tests/unit/app/application/algorithm/moving_average/test_moving_average.c index d6fdd556..3d7b0094 100644 --- a/tests/unit/app/application/algorithm/moving_average/test_moving_average.c +++ b/tests/unit/app/application/algorithm/moving_average/test_moving_average.c @@ -43,8 +43,8 @@ * @file test_moving_average.c * @author foxBMS Team * @date 2020-07-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting.c b/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting.c index 0ed1115d..ddb4e6d7 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting.c +++ b/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting.c @@ -43,8 +43,8 @@ * @file test_soc_counting.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting_cfg.c index 2af36f01..3332ee9a 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soc/counting/test_soc_counting_cfg.c @@ -43,8 +43,8 @@ * @file test_soc_counting_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug.c b/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug.c index 9a61b214..9a07e0b3 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug.c +++ b/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug.c @@ -43,8 +43,8 @@ * @file test_soc_debug.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug_cfg.c index 0edb3fbe..f310224d 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soc/debug/test_soc_debug_cfg.c @@ -43,8 +43,8 @@ * @file test_soc_debug_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none.c b/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none.c index 3261a41c..b2b08302 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none.c +++ b/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none.c @@ -43,8 +43,8 @@ * @file test_soc_none.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none_cfg.c index d33e4089..cba7125d 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soc/none/test_soc_none_cfg.c @@ -43,8 +43,8 @@ * @file test_soc_none_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting.c b/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting.c index 54ca71a0..01e33256 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting.c +++ b/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting.c @@ -43,8 +43,8 @@ * @file test_soe_counting.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting_cfg.c index 7a7e490d..a8224244 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soe/counting/test_soe_counting_cfg.c @@ -43,8 +43,8 @@ * @file test_soe_counting_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug.c b/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug.c index 4348414b..0b241881 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug.c +++ b/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug.c @@ -43,8 +43,8 @@ * @file test_soe_debug.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug_cfg.c index 763096b8..ad92bf65 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soe/debug/test_soe_debug_cfg.c @@ -43,8 +43,8 @@ * @file test_soe_debug_cfg.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none.c b/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none.c index 4e390a94..867625ed 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none.c +++ b/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none.c @@ -43,8 +43,8 @@ * @file test_soe_none.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none_cfg.c index 0c06aab7..9ecea653 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soe/none/test_soe_none_cfg.c @@ -43,8 +43,8 @@ * @file test_soe_none_cfg.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid.c b/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid.c index 8293178f..f2a24745 100644 --- a/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid.c +++ b/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid.c @@ -43,8 +43,8 @@ * @file test_sof_trapezoid.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid_cfg.c b/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid_cfg.c index eb3a524b..baebcb84 100644 --- a/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/sof/trapezoid/test_sof_trapezoid_cfg.c @@ -43,8 +43,8 @@ * @file test_sof_trapezoid_cfg.c * @author foxBMS Team * @date 2020-10-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug.c b/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug.c index 924c1969..d1cd0179 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug.c +++ b/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug.c @@ -43,8 +43,8 @@ * @file test_soh_debug.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug_cfg.c index 49c627f9..eb3e689e 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soh/debug/test_soh_debug_cfg.c @@ -43,8 +43,8 @@ * @file test_soh_debug_cfg.c * @author foxBMS Team * @date 2021-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none.c b/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none.c index c3d9a693..81b06b93 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none.c +++ b/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none.c @@ -43,8 +43,8 @@ * @file test_soh_none.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none_cfg.c b/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none_cfg.c index e1c1bfb2..0c466a0d 100644 --- a/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none_cfg.c +++ b/tests/unit/app/application/algorithm/state_estimation/soh/none/test_soh_none_cfg.c @@ -43,8 +43,8 @@ * @file test_soh_none_cfg.c * @author foxBMS Team * @date 2021-12-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/state_estimation/test_state_estimation.c b/tests/unit/app/application/algorithm/state_estimation/test_state_estimation.c index 8e7e0ce7..420b716f 100644 --- a/tests/unit/app/application/algorithm/state_estimation/test_state_estimation.c +++ b/tests/unit/app/application/algorithm/state_estimation/test_state_estimation.c @@ -43,8 +43,8 @@ * @file test_state_estimation.c * @author foxBMS Team * @date 2020-10-14 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/algorithm/test_algorithm.c b/tests/unit/app/application/algorithm/test_algorithm.c index 7fe0778d..02dbfc31 100644 --- a/tests/unit/app/application/algorithm/test_algorithm.c +++ b/tests/unit/app/application/algorithm/test_algorithm.c @@ -43,8 +43,8 @@ * @file test_algorithm.c * @author foxBMS Team * @date 2020-06-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/bal/history/test_bal_strategy_history.c b/tests/unit/app/application/bal/history/test_bal_strategy_history.c index 9956fcc4..f064ed57 100644 --- a/tests/unit/app/application/bal/history/test_bal_strategy_history.c +++ b/tests/unit/app/application/bal/history/test_bal_strategy_history.c @@ -43,8 +43,8 @@ * @file test_bal_strategy_history.c * @author foxBMS Team * @date 2020-06-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/bal/none/test_bal_strategy_none.c b/tests/unit/app/application/bal/none/test_bal_strategy_none.c index 2120f38a..a4f6eb00 100644 --- a/tests/unit/app/application/bal/none/test_bal_strategy_none.c +++ b/tests/unit/app/application/bal/none/test_bal_strategy_none.c @@ -43,8 +43,8 @@ * @file test_bal_strategy_none.c * @author foxBMS Team * @date 2020-08-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/bal/test_bal.c b/tests/unit/app/application/bal/test_bal.c index afef5218..af660860 100644 --- a/tests/unit/app/application/bal/test_bal.c +++ b/tests/unit/app/application/bal/test_bal.c @@ -43,8 +43,8 @@ * @file test_bal.c * @author foxBMS Team * @date 2020-08-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/bal/voltage/test_bal_strategy_voltage.c b/tests/unit/app/application/bal/voltage/test_bal_strategy_voltage.c index 95369ba2..8f18e999 100644 --- a/tests/unit/app/application/bal/voltage/test_bal_strategy_voltage.c +++ b/tests/unit/app/application/bal/voltage/test_bal_strategy_voltage.c @@ -43,8 +43,8 @@ * @file test_bal_strategy_voltage.c * @author foxBMS Team * @date 2020-06-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/bms/test_bms.c b/tests/unit/app/application/bms/test_bms.c index dcc3bfbf..5b0c49c5 100644 --- a/tests/unit/app/application/bms/test_bms.c +++ b/tests/unit/app/application/bms/test_bms.c @@ -43,8 +43,8 @@ * @file test_bms.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -68,6 +68,8 @@ #include "Mockplausibility.h" #include "Mocksoa.h" +#include "sps_cfg.h" + #include "bms.h" #include "foxmath.h" #include "test_assert_helper.h" @@ -85,6 +87,32 @@ BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS] = { BS_STRING_WITH_PRECHARGE, }; +CONT_CONTACTOR_STATE_s cont_contactorStates[] = { + /* String contactors configuration */ + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_FEEDBACK_NORMALLY_OPEN, + BS_STRING0, + CONT_PLUS, + SPS_CHANNEL_0, + CONT_CHARGING_DIRECTION}, + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_FEEDBACK_NORMALLY_OPEN, + BS_STRING0, + CONT_MINUS, + SPS_CHANNEL_1, + CONT_DISCHARGING_DIRECTION}, + /* Precharge contactors configuration */ + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_HAS_NO_FEEDBACK, + BS_STRING0, + CONT_PRECHARGE, + SPS_CHANNEL_2, + CONT_BIDIRECTIONAL}, +}; + /*========== Setup and Teardown =============================================*/ void setUp(void) { } diff --git a/tests/unit/app/application/config/test_bal_cfg.c b/tests/unit/app/application/config/test_bal_cfg.c index 3584b28f..ee290995 100644 --- a/tests/unit/app/application/config/test_bal_cfg.c +++ b/tests/unit/app/application/config/test_bal_cfg.c @@ -43,8 +43,8 @@ * @file test_bal_cfg.c * @author foxBMS Team * @date 2022-02-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/config/test_battery_cell_cfg.c b/tests/unit/app/application/config/test_battery_cell_cfg.c index 8cabbb3d..804af86c 100644 --- a/tests/unit/app/application/config/test_battery_cell_cfg.c +++ b/tests/unit/app/application/config/test_battery_cell_cfg.c @@ -43,8 +43,8 @@ * @file test_battery_cell_cfg.c * @author foxBMS Team * @date 2020-10-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/config/test_battery_system_cfg.c b/tests/unit/app/application/config/test_battery_system_cfg.c index da434b34..dd712e5d 100644 --- a/tests/unit/app/application/config/test_battery_system_cfg.c +++ b/tests/unit/app/application/config/test_battery_system_cfg.c @@ -43,8 +43,8 @@ * @file test_battery_system_cfg.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/config/test_soa_cfg.c b/tests/unit/app/application/config/test_soa_cfg.c index 57da8c4b..f45c8dc4 100644 --- a/tests/unit/app/application/config/test_soa_cfg.c +++ b/tests/unit/app/application/config/test_soa_cfg.c @@ -43,8 +43,8 @@ * @file test_soa_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/plausibility/test_plausibility.c b/tests/unit/app/application/plausibility/test_plausibility.c index dc55289a..a52af495 100644 --- a/tests/unit/app/application/plausibility/test_plausibility.c +++ b/tests/unit/app/application/plausibility/test_plausibility.c @@ -43,8 +43,8 @@ * @file test_plausibility.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/redundancy/test_redundancy.c b/tests/unit/app/application/redundancy/test_redundancy.c index 571db472..db039fcc 100644 --- a/tests/unit/app/application/redundancy/test_redundancy.c +++ b/tests/unit/app/application/redundancy/test_redundancy.c @@ -43,8 +43,8 @@ * @file test_redundancy.c * @author foxBMS Team * @date 2020-07-31 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/application/soa/test_soa.c b/tests/unit/app/application/soa/test_soa.c index b37d8260..67769668 100644 --- a/tests/unit/app/application/soa/test_soa.c +++ b/tests/unit/app/application/soa/test_soa.c @@ -43,8 +43,8 @@ * @file test_soa.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/adc/test_adc.c b/tests/unit/app/driver/adc/test_adc.c index add54bd4..83a5f12c 100644 --- a/tests/unit/app/driver/adc/test_adc.c +++ b/tests/unit/app/driver/adc/test_adc.c @@ -43,8 +43,8 @@ * @file test_adc.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/api/test_afe_plausibility.c b/tests/unit/app/driver/afe/api/test_afe_plausibility.c index 917761e6..3abff93a 100644 --- a/tests/unit/app/driver/afe/api/test_afe_plausibility.c +++ b/tests/unit/app/driver/afe/api/test_afe_plausibility.c @@ -43,8 +43,8 @@ * @file test_afe_plausibility.c * @author foxBMS Team * @date 2020-07-13 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe.c b/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe.c index 213c1285..c124f93c 100644 --- a/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe.c +++ b/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe.c @@ -43,8 +43,8 @@ * @file test_debug_default_afe.c * @author foxBMS Team * @date 2020-05-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe_dma.c b/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe_dma.c index e48e34a3..686dbcd0 100644 --- a/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe_dma.c +++ b/tests/unit/app/driver/afe/debug/default/api/test_debug_default_afe_dma.c @@ -43,8 +43,8 @@ * @file test_debug_default_afe_dma.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/debug/default/config/test_debug_default_cfg.c b/tests/unit/app/driver/afe/debug/default/config/test_debug_default_cfg.c index 9792335d..2fab3d94 100644 --- a/tests/unit/app/driver/afe/debug/default/config/test_debug_default_cfg.c +++ b/tests/unit/app/driver/afe/debug/default/config/test_debug_default_cfg.c @@ -43,8 +43,8 @@ * @file test_debug_default_cfg.c * @author foxBMS Team * @date 2020-09-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/debug/default/test_debug_default.c b/tests/unit/app/driver/afe/debug/default/test_debug_default.c index a660baeb..5446f051 100644 --- a/tests/unit/app/driver/afe/debug/default/test_debug_default.c +++ b/tests/unit/app/driver/afe/debug/default/test_debug_default.c @@ -43,8 +43,8 @@ * @file test_debug_default.c * @author foxBMS Team * @date 2020-09-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/6806/config/test_ltc_6806_cfg.c b/tests/unit/app/driver/afe/ltc/6806/config/test_ltc_6806_cfg.c index 5aa8399b..789c7d69 100644 --- a/tests/unit/app/driver/afe/ltc/6806/config/test_ltc_6806_cfg.c +++ b/tests/unit/app/driver/afe/ltc/6806/config/test_ltc_6806_cfg.c @@ -43,8 +43,8 @@ * @file test_ltc_6806_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806.c b/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806.c index ae31fb30..e5844efb 100644 --- a/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806.c +++ b/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806.c @@ -43,8 +43,8 @@ * @file test_ltc_6806.c * @author foxBMS Team * @date 2020-07-13 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806_pec_in_arrays.c b/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806_pec_in_arrays.c index d31f5028..a818e9b7 100644 --- a/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806_pec_in_arrays.c +++ b/tests/unit/app/driver/afe/ltc/6806/test_ltc_6806_pec_in_arrays.c @@ -43,8 +43,8 @@ * @file test_ltc_6806_pec_in_arrays.c * @author foxBMS Team * @date 2020-12-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/6813-1/config/test_ltc_6813-1_cfg.c b/tests/unit/app/driver/afe/ltc/6813-1/config/test_ltc_6813-1_cfg.c index 4ddc10f9..9b668019 100644 --- a/tests/unit/app/driver/afe/ltc/6813-1/config/test_ltc_6813-1_cfg.c +++ b/tests/unit/app/driver/afe/ltc/6813-1/config/test_ltc_6813-1_cfg.c @@ -43,8 +43,8 @@ * @file test_ltc_6813-1_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1.c b/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1.c index 9ddc60a7..22225fc6 100644 --- a/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1.c +++ b/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1.c @@ -43,8 +43,8 @@ * @file test_ltc_6813-1.c * @author foxBMS Team * @date 2020-03-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1_pec_in_arrays.c b/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1_pec_in_arrays.c index f9777e53..b45d78f7 100644 --- a/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1_pec_in_arrays.c +++ b/tests/unit/app/driver/afe/ltc/6813-1/test_ltc_6813-1_pec_in_arrays.c @@ -43,8 +43,8 @@ * @file test_ltc_6813-1_pec_in_arrays.c * @author foxBMS Team * @date 2020-03-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/api/test_ltc_afe.c b/tests/unit/app/driver/afe/ltc/api/test_ltc_afe.c index 6cab539a..5a64e558 100644 --- a/tests/unit/app/driver/afe/ltc/api/test_ltc_afe.c +++ b/tests/unit/app/driver/afe/ltc/api/test_ltc_afe.c @@ -43,8 +43,8 @@ * @file test_ltc_afe.c * @author foxBMS Team * @date 2020-05-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/common/config/test_ltc_afe_dma_cfg.c b/tests/unit/app/driver/afe/ltc/common/config/test_ltc_afe_dma_cfg.c index dff0f4f0..f7df636e 100644 --- a/tests/unit/app/driver/afe/ltc/common/config/test_ltc_afe_dma_cfg.c +++ b/tests/unit/app/driver/afe/ltc/common/config/test_ltc_afe_dma_cfg.c @@ -43,8 +43,8 @@ * @file test_ltc_afe_dma_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/ltc/common/test_ltc_afe_dma.c b/tests/unit/app/driver/afe/ltc/common/test_ltc_afe_dma.c index 842a4515..20ff33b4 100644 --- a/tests/unit/app/driver/afe/ltc/common/test_ltc_afe_dma.c +++ b/tests/unit/app/driver/afe/ltc/common/test_ltc_afe_dma.c @@ -43,8 +43,8 @@ * @file test_ltc_afe_dma.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/maxim/api/test_mxm_afe.c b/tests/unit/app/driver/afe/maxim/api/test_mxm_afe.c index a4a4df45..081521b2 100644 --- a/tests/unit/app/driver/afe/maxim/api/test_mxm_afe.c +++ b/tests/unit/app/driver/afe/maxim/api/test_mxm_afe.c @@ -43,8 +43,8 @@ * @file test_mxm_afe.c * @author foxBMS Team * @date 2020-06-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/maxim/common/config/test_mxm_cfg.c b/tests/unit/app/driver/afe/maxim/common/config/test_mxm_cfg.c index f9eb4b50..1b2c9f97 100644 --- a/tests/unit/app/driver/afe/maxim/common/config/test_mxm_cfg.c +++ b/tests/unit/app/driver/afe/maxim/common/config/test_mxm_cfg.c @@ -43,8 +43,8 @@ * @file test_mxm_cfg.c * @author foxBMS Team * @date 2020-06-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_17841b.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_17841b.c index 70974b6c..3edcf8b2 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_17841b.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_17841b.c @@ -43,8 +43,8 @@ * @file test_mxm_17841b.c * @author foxBMS Team * @date 2020-06-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x.c index dab33ae2..d2cefaa3 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x.c @@ -43,8 +43,8 @@ * @file test_mxm_1785x.c * @author foxBMS Team * @date 2020-07-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x_tools.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x_tools.c index bf706df2..7be79bbd 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x_tools.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_1785x_tools.c @@ -43,8 +43,8 @@ * @file test_mxm_1785x_tools.c * @author foxBMS Team * @date 2020-07-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_afe_dma.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_afe_dma.c index a3ddeafc..4385c397 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_afe_dma.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_afe_dma.c @@ -43,8 +43,8 @@ * @file test_mxm_afe_dma.c * @author foxBMS Team * @date 2020-06-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_battery_management.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_battery_management.c index 4d9d7a5d..c5fa20a0 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_battery_management.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_battery_management.c @@ -43,8 +43,8 @@ * @file test_mxm_battery_management.c * @author foxBMS Team * @date 2020-07-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_bitextract.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_bitextract.c index 4740364d..87df944e 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_bitextract.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_bitextract.c @@ -43,8 +43,8 @@ * @file test_mxm_bitextract.c * @author foxBMS Team * @date 2020-04-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_crc8.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_crc8.c index fa2be686..efccd9f1 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_crc8.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_crc8.c @@ -43,8 +43,8 @@ * @file test_mxm_crc8.c * @author foxBMS Team * @date 2020-03-13 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_register_map.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_register_map.c index 38c17163..16e71fe5 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_register_map.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_register_map.c @@ -43,8 +43,8 @@ * @file test_mxm_register_map.c * @author foxBMS Team * @date 2020-04-07 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/maxim/common/test_mxm_registry.c b/tests/unit/app/driver/afe/maxim/common/test_mxm_registry.c index d772ebb1..74506c45 100644 --- a/tests/unit/app/driver/afe/maxim/common/test_mxm_registry.c +++ b/tests/unit/app/driver/afe/maxim/common/test_mxm_registry.c @@ -43,8 +43,8 @@ * @file test_mxm_registry.c * @author foxBMS Team * @date 2020-07-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/maxim/max17852/test_mxm_17852.c b/tests/unit/app/driver/afe/maxim/max17852/test_mxm_17852.c index c4522301..a0d5fecd 100644 --- a/tests/unit/app/driver/afe/maxim/max17852/test_mxm_17852.c +++ b/tests/unit/app/driver/afe/maxim/max17852/test_mxm_17852.c @@ -43,8 +43,8 @@ * @file test_mxm_17852.c * @author foxBMS Team * @date 2021-11-30 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix MXM * diff --git a/tests/unit/app/driver/afe/nxp/api/test_nxp_afe.c b/tests/unit/app/driver/afe/nxp/api/test_nxp_afe.c index 1cf7bc0a..1873568b 100644 --- a/tests/unit/app/driver/afe/nxp/api/test_nxp_afe.c +++ b/tests/unit/app/driver/afe/nxp/api/test_nxp_afe.c @@ -43,8 +43,8 @@ * @file test_nxp_afe.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/nxp/mc33775a/api/test_nxp_mc33775a_afe.c b/tests/unit/app/driver/afe/nxp/mc33775a/api/test_nxp_mc33775a_afe.c index ed950c5e..9da089b8 100644 --- a/tests/unit/app/driver/afe/nxp/mc33775a/api/test_nxp_mc33775a_afe.c +++ b/tests/unit/app/driver/afe/nxp/mc33775a/api/test_nxp_mc33775a_afe.c @@ -43,8 +43,8 @@ * @file test_nxp_mc33775a_afe.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_afe_dma_cfg.c b/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_afe_dma_cfg.c index 71018e99..daec6005 100644 --- a/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_afe_dma_cfg.c +++ b/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_afe_dma_cfg.c @@ -43,8 +43,8 @@ * @file test_nxp_afe_dma_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_mc33775a_cfg.c b/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_mc33775a_cfg.c index 90f5a9a3..e3a6bec4 100644 --- a/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_mc33775a_cfg.c +++ b/tests/unit/app/driver/afe/nxp/mc33775a/config/test_nxp_mc33775a_cfg.c @@ -43,8 +43,8 @@ * @file test_nxp_mc33775a_cfg.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_afe_dma.c b/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_afe_dma.c index 93878a0a..59364c05 100644 --- a/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_afe_dma.c +++ b/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_afe_dma.c @@ -43,8 +43,8 @@ * @file test_nxp_afe_dma.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a-ll.c b/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a-ll.c index 3c702eb0..977354f3 100644 --- a/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a-ll.c +++ b/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a-ll.c @@ -43,8 +43,8 @@ * @file test_nxp_mc33775a-ll.c * @author foxBMS Team * @date 2021-10-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a.c b/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a.c index b462c15c..38544fc2 100644 --- a/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a.c +++ b/tests/unit/app/driver/afe/nxp/mc33775a/test_nxp_mc33775a.c @@ -43,8 +43,8 @@ * @file test_nxp_mc33775a.c * @author foxBMS Team * @date 2021-10-20 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_current_sensor.c b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_current-sensor.c similarity index 96% rename from tests/unit/app/driver/can/cbs/test_can_cbs_rx_current_sensor.c rename to tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_current-sensor.c index 0815b390..9d776df8 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_current_sensor.c +++ b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_current-sensor.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_rx_current_sensor.c + * @file test_can_cbs_rx_current-sensor.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,10 +64,10 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_rx.h" #include "can_helper.h" -TEST_FILE("can_cbs_rx_current_sensor.c") +TEST_FILE("can_cbs_rx_current-sensor.c") /*========== Definitions and Implementations for Unit Test ==================*/ diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_imd.c b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_imd.c similarity index 98% rename from tests/unit/app/driver/can/cbs/test_can_cbs_rx_imd.c rename to tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_imd.c index 25a828a1..b377edee 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_imd.c +++ b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_imd.c @@ -43,8 +43,8 @@ * @file test_can_cbs_rx_imd.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,7 +64,7 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_rx.h" #include "can_helper.h" TEST_FILE("can_cbs_rx_imd.c") diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_misc.c b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_misc.c similarity index 98% rename from tests/unit/app/driver/can/cbs/test_can_cbs_rx_misc.c rename to tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_misc.c index fd161a02..2c274a17 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_misc.c +++ b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_misc.c @@ -43,8 +43,8 @@ * @file test_can_cbs_rx_misc.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,7 +64,7 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_rx.h" #include "can_helper.h" TEST_FILE("can_cbs_rx_misc.c") diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_command.c b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_state-request.c similarity index 81% rename from tests/unit/app/driver/can/cbs/test_can_cbs_rx_command.c rename to tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_state-request.c index cf28453b..ee24b900 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_rx_command.c +++ b/tests/unit/app/driver/can/cbs/rx/test_can_cbs_rx_state-request.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_rx_command.c + * @file test_can_cbs_rx_state-request.c * @author foxBMS Team * @date 2021-07-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -68,11 +68,12 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_rx.h" +#include "can_cfg_rx-message-definitions.h" #include "can_helper.h" #include "test_assert_helper.h" -TEST_FILE("can_cbs_rx_command.c") +TEST_FILE("can_cbs_rx_state-request.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -128,21 +129,38 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ /** test the handling of illegal input by callback */ void testRxRequestIllegalInput(void) { - uint32_t id = 0u; - uint8_t dlc = 0u; - CAN_ENDIANNESS_e endianness = CAN_LITTLE_ENDIAN; + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CAN_MAX_11BIT_ID, + .dlc = 0u, + .endianness = CAN_LITTLE_ENDIAN, + }; + uint8_t canData[CAN_MAX_DLC] = {0}; - TEST_ASSERT_FAIL_ASSERT(CAN_RxRequest(CAN_MAX_11BIT_ID, dlc, endianness, canData, &can_kShim)); - TEST_ASSERT_FAIL_ASSERT(CAN_RxRequest(id, (CAN_DLC + 1u), endianness, canData, &can_kShim)); - TEST_ASSERT_FAIL_ASSERT(CAN_RxRequest(id, dlc, endianness, NULL_PTR, &can_kShim)); - TEST_ASSERT_FAIL_ASSERT(CAN_RxRequest(id, dlc, endianness, canData, NULL_PTR)); + + /* test 0 */ + TEST_ASSERT_FAIL_ASSERT(CANRX_BmsStateRequest(testMessage, canData, &can_kShim)); + + /* test 1 */ + testMessage.id = 0u; + testMessage.dlc = CAN_DEFAULT_DLC + 1u; + + TEST_ASSERT_FAIL_ASSERT(CANRX_BmsStateRequest(testMessage, canData, &can_kShim)); + + /* test 2 */ + TEST_ASSERT_FAIL_ASSERT(CANRX_BmsStateRequest(testMessage, NULL_PTR, &can_kShim)); + + /* test 3 */ + TEST_ASSERT_FAIL_ASSERT(CANRX_BmsStateRequest(testMessage, canData, NULL_PTR)); } /** test mode request */ void testRxRequestModeRequest(void) { - uint32_t id = 0u; - uint8_t dlc = 0u; - CAN_ENDIANNESS_e endianness = CAN_BIG_ENDIAN; + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANRX_BMS_STATE_REQUEST_ID, + .dlc = CAN_FOXBMS_MESSAGES_DEFAULT_DLC, + .endianness = CAN_BIG_ENDIAN, + }; + uint8_t canData[CAN_MAX_DLC] = {0}; /* ignore reads that are not used in this test */ @@ -153,28 +171,28 @@ void testRxRequestModeRequest(void) { /* request disconnect (STANDBY) */ canData[0u] = 0u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(BMS_REQ_ID_STANDBY, can_tableStateRequest.stateRequestViaCan); /* request discharge (NORMAL) */ canData[0u] = 1u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(BMS_REQ_ID_NORMAL, can_tableStateRequest.stateRequestViaCan); /* request charge (CHARGE) */ canData[0u] = 2u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(BMS_REQ_ID_CHARGE, can_tableStateRequest.stateRequestViaCan); /* no valid request */ canData[0u] = 3u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(BMS_REQ_ID_NOREQ, can_tableStateRequest.stateRequestViaCan); /* state counter overflow */ can_tableStateRequest.stateCounter = UINT8_MAX; canData[0u] = 0u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(0u, can_tableStateRequest.stateCounter); /* state: no update without change an no time */ @@ -183,7 +201,7 @@ void testRxRequestModeRequest(void) { OS_CheckTimeHasPassed_IgnoreArg_oldTimeStamp_ms(); OS_CheckTimeHasPassed_IgnoreArg_timeToPass_ms(); can_tableStateRequest.stateRequestViaCanPending = 42u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(42u, can_tableStateRequest.stateRequestViaCanPending); /* state: update with change of time */ @@ -192,15 +210,17 @@ void testRxRequestModeRequest(void) { OS_CheckTimeHasPassed_IgnoreArg_oldTimeStamp_ms(); OS_CheckTimeHasPassed_IgnoreArg_timeToPass_ms(); can_tableStateRequest.stateRequestViaCanPending = 42u; - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); TEST_ASSERT_EQUAL(BMS_REQ_ID_STANDBY, can_tableStateRequest.stateRequestViaCanPending); } /** test balancing request */ void testRxRequestBalancingRequest(void) { - uint32_t id = 0u; - uint8_t dlc = 0u; - CAN_ENDIANNESS_e endianness = CAN_BIG_ENDIAN; + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANRX_BMS_STATE_REQUEST_ID, + .dlc = CAN_FOXBMS_MESSAGES_DEFAULT_DLC, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t canData[CAN_MAX_DLC] = {0}; /* ignore reads that are not used in this test */ @@ -214,7 +234,7 @@ void testRxRequestBalancingRequest(void) { BAL_GetInitializationState_ExpectAndReturn(STD_OK); BAL_SetStateRequest_ExpectAndReturn(BAL_STATE_GLOBAL_DISABLE_REQUEST, BAL_OK); BAL_SetBalancingThreshold_Expect(0u); - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); /* request balancing */ canData[1u] = 1u; @@ -222,21 +242,23 @@ void testRxRequestBalancingRequest(void) { BAL_GetInitializationState_ExpectAndReturn(STD_OK); BAL_SetStateRequest_ExpectAndReturn(BAL_STATE_GLOBAL_ENABLE_REQUEST, BAL_OK); BAL_SetBalancingThreshold_Expect(0x42u); - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); /* balancing not initialized */ canData[1u] = 1u; canData[2u] = 0x33u; BAL_GetInitializationState_ExpectAndReturn(STD_NOT_OK); BAL_SetBalancingThreshold_Expect(0x33u); - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); } /** test reset flags request */ void testRxRequestResetFlags(void) { - uint32_t id = 0u; - uint8_t dlc = 0u; - CAN_ENDIANNESS_e endianness = CAN_BIG_ENDIAN; + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANRX_BMS_STATE_REQUEST_ID, + .dlc = CAN_FOXBMS_MESSAGES_DEFAULT_DLC, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t canData[CAN_MAX_DLC] = {0}; /* ignore reads that are not used in this test */ @@ -253,5 +275,5 @@ void testRxRequestResetFlags(void) { DIAG_ID_DEEP_DISCHARGE_DETECTED, DIAG_EVENT_OK, DIAG_STRING, s, DIAG_HANDLER_RETURN_OK); } SYSM_ClearAllTimingViolations_Expect(); - CAN_RxRequest(id, dlc, endianness, canData, &can_kShim); + CANRX_BmsStateRequest(testMessage, canData, &can_kShim); } diff --git a/tests/unit/app/driver/can/cbs/test_can_helper.c b/tests/unit/app/driver/can/cbs/test_can_helper.c index 0c14d088..b5cd6e86 100644 --- a/tests/unit/app/driver/can/cbs/test_can_helper.c +++ b/tests/unit/app/driver/can/cbs/test_can_helper.c @@ -43,8 +43,8 @@ * @file test_can_helper.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,7 +64,7 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" #include "can_helper.h" #include "test_assert_helper.h" diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_temperature.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_cell-temperatures.c similarity index 93% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_temperature.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_cell-temperatures.c index bb2faa42..01f28f74 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_temperature.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_cell-temperatures.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_tx_temperature.c + * @file test_can_cbs_tx_cell-temperatures.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,11 +64,12 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" #include "database_helper.h" -TEST_FILE("can_cbs_tx_temperature.c") +TEST_FILE("can_cbs_tx_cell-temperatures.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -119,6 +120,11 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ void testCAN_TxCellTemperature(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_CELL_TEMPERATURES_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; DATA_Read1DataBlock_IgnoreAndReturn(0u); @@ -132,7 +138,7 @@ void testCAN_TxCellTemperature(void) { can_kShim.pTableCellTemperature->cellTemperature_ddegC[s][5] = -100; } - CAN_TxCellTemperature(0x111, 8, CAN_BIG_ENDIAN, data, &muxId, &can_kShim); + CANTX_CellTemperatures(testMessage, data, &muxId, &can_kShim); TEST_ASSERT_EQUAL(0, data[0]); TEST_ASSERT_EQUAL(0, data[1]); diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_voltage.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_cell-voltages.c similarity index 93% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_voltage.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_cell-voltages.c index c472f886..b2f561ff 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_voltage.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_cell-voltages.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_tx_voltage.c + * @file test_can_cbs_tx_cell-voltages.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,11 +64,12 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" #include "database_helper.h" -TEST_FILE("can_cbs_tx_voltage.c") +TEST_FILE("can_cbs_tx_cell-voltages.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -119,6 +120,11 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ void testCAN_TxVoltage(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_CELL_VOLTAGES_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; DATA_Read1DataBlock_IgnoreAndReturn(0u); @@ -130,7 +136,7 @@ void testCAN_TxVoltage(void) { can_kShim.pTableCellVoltage->cellVoltage_mV[s][3] = 3700; } - CAN_TxVoltage(CAN_ID_TX_VOLTAGES, 8, CAN_BIG_ENDIAN, data, &muxId, &can_kShim); + CANTX_CellVoltages(testMessage, data, &muxId, &can_kShim); /* MuxID: 0 * Cell voltage 0: 2000mV diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_limits.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_limit-values.c similarity index 93% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_limits.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_limit-values.c index 8a89f641..49102161 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_limits.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_limit-values.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_tx_limits.c + * @file test_can_cbs_tx_limit-values.c * @author foxBMS Team * @date 2021-07-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -65,10 +65,11 @@ #include "battery_cell_cfg.h" #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" -TEST_FILE("can_cbs_tx_limits.c") +TEST_FILE("can_cbs_tx_limit-values.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -119,6 +120,11 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ void testCAN_TxLimitValues(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_LIMIT_VALUES_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { @@ -128,7 +134,7 @@ void testCAN_TxLimitValues(void) { DATA_Read1DataBlock_IgnoreAndReturn(0u); - CAN_TxLimitValues(CAN_ID_TX_LIMIT_VALUES, 8, CAN_BIG_ENDIAN, data, NULL_PTR, &can_kShim); + CANTX_LimitValues(testMessage, data, NULL_PTR, &can_kShim); /** Values of: * max. charge current: 240A diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_minmax.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_minimum-maximum-values.c similarity index 89% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_minmax.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_minimum-maximum-values.c index 9b235bb3..0261a567 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_minmax.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_minimum-maximum-values.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_tx_minmax.c + * @file test_can_cbs_tx_minimum-maximum-values.c * @author foxBMS Team * @date 2021-04-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -65,10 +65,11 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" -TEST_FILE("can_cbs_tx_minmax.c") +TEST_FILE("can_cbs_tx_minimum-maximum-values.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -118,7 +119,12 @@ void tearDown(void) { } /*========== Test Cases =====================================================*/ -void testCAN_TxMinimumMaximumValuesAllStringsOpen(void) { +void testCANTX_MinimumMaximumValuesAllStringsOpen(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_MINIMUM_MAXIMUM_VALUES_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { @@ -130,7 +136,7 @@ void testCAN_TxMinimumMaximumValuesAllStringsOpen(void) { DATA_Read1DataBlock_IgnoreAndReturn(0u); BMS_GetNumberOfConnectedStrings_IgnoreAndReturn(0u); - CAN_TxMinimumMaximumValues(CAN_ID_TX_MINIMUM_MAXIMUM_VALUES, 8, CAN_BIG_ENDIAN, data, NULL_PTR, &can_kShim); + CANTX_MinimumMaximumValues(testMessage, data, NULL_PTR, &can_kShim); /** Values of: * minimum cell voltage: 2000mV @@ -148,7 +154,12 @@ void testCAN_TxMinimumMaximumValuesAllStringsOpen(void) { TEST_ASSERT_EQUAL(0xF1, data[7]); } -void testCAN_TxMinimumMaximumValuesAllStringsClosed(void) { +void testCANTX_MinimumMaximumValuesAllStringsClosed(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_MINIMUM_MAXIMUM_VALUES_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { @@ -163,7 +174,7 @@ void testCAN_TxMinimumMaximumValuesAllStringsClosed(void) { for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { BMS_IsStringClosed_IgnoreAndReturn(true); } - CAN_TxMinimumMaximumValues(CAN_ID_TX_MINIMUM_MAXIMUM_VALUES, 8, CAN_BIG_ENDIAN, data, NULL_PTR, &can_kShim); + CANTX_MinimumMaximumValues(testMessage, data, NULL_PTR, &can_kShim); /** Values of: * minimum cell voltage: 2000mV diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_state_estimation.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_pack-state-estimation.c similarity index 92% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_state_estimation.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_pack-state-estimation.c index fea2a091..bb47edb9 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_state_estimation.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_pack-state-estimation.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_tx_state_estimation.c + * @file test_can_cbs_tx_pack-state-estimation.c * @author foxBMS Team * @date 2021-07-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -65,10 +65,11 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" -TEST_FILE("can_cbs_tx_state_estimation.c") +TEST_FILE("can_cbs_tx_pack-state-estimation.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -119,6 +120,11 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ void testCAN_TxStateEstimationCharging(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_PACK_STATE_ESTIMATION_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { @@ -142,7 +148,7 @@ void testCAN_TxStateEstimationCharging(void) { BMS_GetNumberOfConnectedStrings_IgnoreAndReturn(BS_NR_OF_STRINGS); BMS_GetNumberOfConnectedStrings_IgnoreAndReturn(BS_NR_OF_STRINGS); - CAN_TxStateEstimation(CAN_ID_TX_PACK_STATE_ESTIMATION, 8, CAN_BIG_ENDIAN, data, NULL_PTR, &can_kShim); + CANTX_PackStateEstimation(testMessage, data, NULL_PTR, &can_kShim); /** Values of: * pack SOC: 74.2% @@ -161,6 +167,12 @@ void testCAN_TxStateEstimationCharging(void) { } void testCAN_TxStateEstimationDischarging(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_PACK_STATE_ESTIMATION_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; + uint8_t data[8] = {0}; for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) { @@ -184,7 +196,7 @@ void testCAN_TxStateEstimationDischarging(void) { BMS_GetNumberOfConnectedStrings_IgnoreAndReturn(BS_NR_OF_STRINGS); BMS_GetNumberOfConnectedStrings_IgnoreAndReturn(BS_NR_OF_STRINGS); - CAN_TxStateEstimation(CAN_ID_TX_PACK_STATE_ESTIMATION, 8, CAN_BIG_ENDIAN, data, NULL_PTR, &can_kShim); + CANTX_PackStateEstimation(testMessage, data, NULL_PTR, &can_kShim); /** Values of: * pack SOC: 74.2% diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_state.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_state.c similarity index 98% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_state.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_state.c index 6a831f47..a6684d29 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_state.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_state.c @@ -43,8 +43,8 @@ * @file test_can_cbs_tx_state.c * @author foxBMS Team * @date 2021-07-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -66,7 +66,7 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" #include "can_helper.h" TEST_FILE("can_cbs_tx_state.c") diff --git a/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_string-state-estimation.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_string-state-estimation.c new file mode 100644 index 00000000..7716dacb --- /dev/null +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_string-state-estimation.c @@ -0,0 +1,123 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_can_cbs_tx_string-state-estimation.c + * @author foxBMS Team + * @date 2021-07-27 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Tests for the CAN driver callbacks + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockbms.h" +#include "Mockcan.h" +#include "Mockdatabase.h" +#include "Mockdiag.h" +#include "Mockfoxmath.h" +#include "Mockimd.h" +#include "Mockmpu_prototypes.h" +#include "Mockos.h" + +#include "database_cfg.h" + +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" +#include "can_helper.h" + +TEST_FILE("can_cbs_tx_string-state-estimation.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ + +static DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE}; +static DATA_BLOCK_CELL_TEMPERATURE_s can_tableTemperatures = {.header.uniqueId = DATA_BLOCK_ID_CELL_TEMPERATURE}; +static DATA_BLOCK_MIN_MAX_s can_tableMinimumMaximumValues = {.header.uniqueId = DATA_BLOCK_ID_MIN_MAX}; +static DATA_BLOCK_CURRENT_SENSOR_s can_tableCurrentSensor = {.header.uniqueId = DATA_BLOCK_ID_CURRENT_SENSOR}; +static DATA_BLOCK_OPEN_WIRE_s can_tableOpenWire = {.header.uniqueId = DATA_BLOCK_ID_OPEN_WIRE_BASE}; +static DATA_BLOCK_STATEREQUEST_s can_tableStateRequest = {.header.uniqueId = DATA_BLOCK_ID_STATEREQUEST}; +static DATA_BLOCK_PACK_VALUES_s can_tablePackValues = {.header.uniqueId = DATA_BLOCK_ID_PACK_VALUES}; +static DATA_BLOCK_SOF_s can_tableSof = {.header.uniqueId = DATA_BLOCK_ID_SOF}; +static DATA_BLOCK_SOX_s can_tableSox = {.header.uniqueId = DATA_BLOCK_ID_SOX}; +static DATA_BLOCK_ERRORSTATE_s can_tableErrorState = {.header.uniqueId = DATA_BLOCK_ID_ERRORSTATE}; +static DATA_BLOCK_INSULATION_MONITORING_s can_tableInsulation = { + .header.uniqueId = DATA_BLOCK_ID_INSULATION_MONITORING}; +static DATA_BLOCK_MSL_FLAG_s can_tableMslFlags = {.header.uniqueId = DATA_BLOCK_ID_MSL_FLAG}; +static DATA_BLOCK_RSL_FLAG_s can_tableRslFlags = {.header.uniqueId = DATA_BLOCK_ID_RSL_FLAG}; +static DATA_BLOCK_MOL_FLAG_s can_tableMolFlags = {.header.uniqueId = DATA_BLOCK_ID_MOL_FLAG}; + +QueueHandle_t imd_canDataQueue = NULL_PTR; + +const CAN_SHIM_s can_kShim = { + .pQueueImd = &imd_canDataQueue, + .pTableCellVoltage = &can_tableCellVoltages, + .pTableCellTemperature = &can_tableTemperatures, + .pTableMinMax = &can_tableMinimumMaximumValues, + .pTableCurrentSensor = &can_tableCurrentSensor, + .pTableOpenWire = &can_tableOpenWire, + .pTableStateRequest = &can_tableStateRequest, + .pTablePackValues = &can_tablePackValues, + .pTableSof = &can_tableSof, + .pTableSox = &can_tableSox, + .pTableErrorState = &can_tableErrorState, + .pTableInsulation = &can_tableInsulation, + .pTableMsl = &can_tableMslFlags, + .pTableRsl = &can_tableRslFlags, + .pTableMol = &can_tableMolFlags, +}; + +static uint8_t muxId = 0u; + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testDummy(void) { +} diff --git a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_system_values.c b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_system-values.c similarity index 93% rename from tests/unit/app/driver/can/cbs/test_can_cbs_tx_system_values.c rename to tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_system-values.c index a64d4e6e..4c762ce0 100644 --- a/tests/unit/app/driver/can/cbs/test_can_cbs_tx_system_values.c +++ b/tests/unit/app/driver/can/cbs/tx/test_can_cbs_tx_system-values.c @@ -40,11 +40,11 @@ */ /** - * @file test_can_cbs_tx_system_values.c + * @file test_can_cbs_tx_system-values.c * @author foxBMS Team * @date 2021-07-27 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -64,10 +64,11 @@ #include "database_cfg.h" -#include "can_cbs.h" +#include "can_cbs_tx.h" +#include "can_cfg_tx-message-definitions.h" #include "can_helper.h" -TEST_FILE("can_cbs_tx_system_values.c") +TEST_FILE("can_cbs_tx_system-values.c") /*========== Definitions and Implementations for Unit Test ==================*/ @@ -118,6 +119,11 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ void testCAN_TxPackValues(void) { + CAN_MESSAGE_PROPERTIES_s testMessage = { + .id = CANTX_PACK_VALUES_ID, + .dlc = 8u, + .endianness = CAN_BIG_ENDIAN, + }; uint8_t data[8] = {0}; can_kShim.pTablePackValues->packCurrent_mA = -200500; @@ -126,7 +132,7 @@ void testCAN_TxPackValues(void) { can_kShim.pTablePackValues->packPower_W = -65100; DATA_Read1DataBlock_IgnoreAndReturn(0u); - CAN_TxPackValues(CAN_ID_TX_PACK_VALUES, 8, CAN_BIG_ENDIAN, data, NULL_PTR, &can_kShim); + CANTX_PackValues(testMessage, data, NULL_PTR, &can_kShim); /** Values of: * pack current: -200.5A diff --git a/tests/unit/app/driver/can/test_can.c b/tests/unit/app/driver/can/test_can.c index 3dc9a43a..305e498c 100644 --- a/tests/unit/app/driver/can/test_can.c +++ b/tests/unit/app/driver/can/test_can.c @@ -43,8 +43,8 @@ * @file test_can.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -74,17 +74,38 @@ #include "test_assert_helper.h" /*========== Definitions and Implementations for Unit Test ==================*/ -/* Dummy for version file implementation */ -const VER_VERSION_s ver_foxbmsVersionInformation = { - .underVersionControl = true, - .isDirty = true, - .major = 1, - .minor = 1, - .patch = 1, - .distanceFromLastRelease = 42, - .commitHash = "deadbeef", - .gitRemote = "onTheDarkSideOfTheMoon.git", -}; + +/* see src/app/driver/config/can_cfg_rx-message-definitions.h, but we omit + this include here */ +#define CANRX_NOT_PERIODIC (0u) + +/* TX test case */ +#define TEST_CANTX_ID_DUMMY (0x001) +#define TEST_CANTX_DUMMY_PERIOD_ms (100) +#define TEST_CANTX_DUMMY_PHASE_ms (0) + +#define TEST_CANTX_DUMMY_MESSAGE \ + { \ + .id = TEST_CANTX_ID_DUMMY, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = TEST_CANTX_DUMMY_PERIOD_ms, .phase = TEST_CANTX_DUMMY_PHASE_ms \ + } + +/* Rx test case*/ +#define TEST_CANRX_ID_DUMMY (0x002) + +#define TEST_CANRX_DUMMY_MESSAGE \ + { \ + .id = TEST_CANRX_ID_DUMMY, \ + .dlc = CAN_DEFAULT_DLC, \ + .endianness = CAN_LITTLE_ENDIAN, \ + }, \ + { \ + .period = CANRX_NOT_PERIODIC \ + } static DATA_BLOCK_CELL_VOLTAGE_s can_tableCellVoltages = {.header.uniqueId = DATA_BLOCK_ID_CELL_VOLTAGE}; static DATA_BLOCK_CELL_TEMPERATURE_s can_tableTemperatures = {.header.uniqueId = DATA_BLOCK_ID_CELL_TEMPERATURE}; @@ -105,22 +126,27 @@ const CAN_SHIM_s can_kShim = { .pTableStateRequest = &can_tableStateRequest, }; -static uint32_t can_dummy( - uint32_t id, - uint8_t dlc, - CAN_ENDIANNESS_e endianness, +static uint32_t TEST_CANTX_DummyCallback( + CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, - const CAN_SHIM_s const *kpkCanShim) { + const CAN_SHIM_s *const kpkCanShim) { + return 0; +} + +static uint32_t TEST_CANRX_DummyCallback( + CAN_MESSAGE_PROPERTIES_s message, + const uint8_t *const kpkCanData, + const CAN_SHIM_s *const kpkCanShim) { return 0; } -const CAN_MSG_TX_TYPE_s can_txMessages[] = { - {CAN1_NODE, 0x001, 8, 100, 0, CAN_LITTLE_ENDIAN, &can_dummy, NULL_PTR}, +const CAN_TX_MESSAGE_TYPE_s can_txMessages[] = { + {CAN_NODE_1, TEST_CANTX_DUMMY_MESSAGE, &TEST_CANTX_DummyCallback, NULL_PTR}, }; -const CAN_MSG_RX_TYPE_s can_rxMessages[] = { - {CAN1_NODE, 0x002, 8, CAN_LITTLE_ENDIAN, &can_dummy}, +const CAN_RX_MESSAGE_TYPE_s can_rxMessages[] = { + {CAN_NODE_1, TEST_CANRX_DUMMY_MESSAGE, &TEST_CANRX_DummyCallback}, }; const uint8_t can_txLength = sizeof(can_txMessages) / sizeof(can_txMessages[0]); @@ -166,7 +192,7 @@ void testDataSendNullPointerAsData(void) { } void testDataSendNoMessagePending(void) { - canBASE_t *pNode = CAN1_NODE; + canBASE_t *pNode = CAN_NODE_1; uint8_t data = 0; canIsTxMessagePending_IgnoreAndReturn(1u); @@ -177,7 +203,7 @@ void testDataSendNoMessagePending(void) { } void testDataSendMessagePending(void) { - canBASE_t *pNode = CAN1_NODE; + canBASE_t *pNode = CAN_NODE_1; uint8_t data = 0; /* simulate first messageBox has pending message */ @@ -241,7 +267,7 @@ void testCAN_TransmitBootMessage(void) { } /** - * @brief test #CAN_TransmitDieId() + * @brief test #CANTX_TransmitDieId() * @details Currently not implemented. Implementing a test for this function * would require implementing a harness that mocks away the * systemREG1 (defined in HAL) as otherwise the test would attempt to @@ -251,5 +277,5 @@ void testCAN_TransmitBootMessage(void) { * tested in the integration test. * */ -void testCAN_TransmitDieId(void) { +void testCANTX_TransmitDieId(void) { } diff --git a/tests/unit/app/driver/checksum/test_checksum.c b/tests/unit/app/driver/checksum/test_checksum.c index 0c7f9ca5..8ad66a7e 100644 --- a/tests/unit/app/driver/checksum/test_checksum.c +++ b/tests/unit/app/driver/checksum/test_checksum.c @@ -43,8 +43,8 @@ * @file test_checksum.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_can_cfg.c b/tests/unit/app/driver/config/test_can_cfg.c index dca2fae2..4813b84c 100644 --- a/tests/unit/app/driver/config/test_can_cfg.c +++ b/tests/unit/app/driver/config/test_can_cfg.c @@ -43,8 +43,8 @@ * @file test_can_cfg.c * @author foxBMS Team * @date 2020-07-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -55,7 +55,6 @@ /*========== Includes =======================================================*/ #include "unity.h" #include "Mockcan.h" -#include "Mockcan_cbs.h" #include "Mockdatabase.h" #include "Mockdiag.h" #include "Mockfoxmath.h" diff --git a/tests/unit/app/driver/config/test_can_cfg_rx.c b/tests/unit/app/driver/config/test_can_cfg_rx.c new file mode 100644 index 00000000..d1b0b28f --- /dev/null +++ b/tests/unit/app/driver/config/test_can_cfg_rx.c @@ -0,0 +1,88 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_can_cfg_rx.c + * @author foxBMS Team + * @date 2020-07-28 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Tests for the CAN driver + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockcan.h" +#include "Mockcan_cbs_rx.h" +#include "Mockdatabase.h" +#include "Mockdiag.h" +#include "Mockfoxmath.h" +#include "Mockftask.h" +#include "Mockimd.h" +#include "Mockmpu_prototypes.h" +#include "Mockos.h" + +#include "can_cfg.h" +#include "database_cfg.h" + +TEST_FILE("can_cfg_rx.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ + +QueueHandle_t ftsk_dataQueue = NULL_PTR; +QueueHandle_t ftsk_imdCanDataQueue = NULL_PTR; +QueueHandle_t ftsk_canRxQueue = NULL_PTR; +volatile bool ftsk_allQueuesCreated = false; + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testDummy(void) { +} diff --git a/tests/unit/app/driver/config/test_can_cfg_tx.c b/tests/unit/app/driver/config/test_can_cfg_tx.c new file mode 100644 index 00000000..eee1f15d --- /dev/null +++ b/tests/unit/app/driver/config/test_can_cfg_tx.c @@ -0,0 +1,88 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_can_cfg_tx.c + * @author foxBMS Team + * @date 2020-07-28 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Tests for the CAN driver + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockcan.h" +#include "Mockcan_cbs_tx.h" +#include "Mockdatabase.h" +#include "Mockdiag.h" +#include "Mockfoxmath.h" +#include "Mockftask.h" +#include "Mockimd.h" +#include "Mockmpu_prototypes.h" +#include "Mockos.h" + +#include "can_cfg.h" +#include "database_cfg.h" + +TEST_FILE("can_cfg_tx.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ + +QueueHandle_t ftsk_dataQueue = NULL_PTR; +QueueHandle_t ftsk_imdCanDataQueue = NULL_PTR; +QueueHandle_t ftsk_canRxQueue = NULL_PTR; +volatile bool ftsk_allQueuesCreated = false; + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testDummy(void) { +} diff --git a/tests/unit/app/driver/config/test_can_cfg_tx_boot-message.c b/tests/unit/app/driver/config/test_can_cfg_tx_boot-message.c new file mode 100644 index 00000000..e9ea19c6 --- /dev/null +++ b/tests/unit/app/driver/config/test_can_cfg_tx_boot-message.c @@ -0,0 +1,90 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_can_cfg_tx_boot-message.c + * @author foxBMS Team + * @date 2022-08-17 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Tests for the CAN driver callbacks + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockcan.h" + +#include "database_cfg.h" +#include "version_cfg.h" + +#include "can_cbs_tx.h" +#include "can_helper.h" +#include "foxmath.h" + +TEST_FILE("can_cfg_tx_boot-message.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ +/* Dummy for version file implementation */ +const VER_VERSION_s ver_foxbmsVersionInformation = { + .underVersionControl = true, + .isDirty = true, + .major = 1, + .minor = 1, + .patch = 1, + .distanceFromLastRelease = 42, + .commitHash = "deadbeef", + .gitRemote = "onTheDarkSideOfTheMoon.git", +}; + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testDummy(void) { +} diff --git a/tests/unit/app/driver/config/test_contactor_cfg.c b/tests/unit/app/driver/config/test_contactor_cfg.c index 44c30367..bc69e62a 100644 --- a/tests/unit/app/driver/config/test_contactor_cfg.c +++ b/tests/unit/app/driver/config/test_contactor_cfg.c @@ -43,8 +43,8 @@ * @file test_contactor_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_dma_cfg.c b/tests/unit/app/driver/config/test_dma_cfg.c index 0e1f8d98..2017035c 100644 --- a/tests/unit/app/driver/config/test_dma_cfg.c +++ b/tests/unit/app/driver/config/test_dma_cfg.c @@ -43,8 +43,8 @@ * @file test_dma_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_fram_cfg.c b/tests/unit/app/driver/config/test_fram_cfg.c index b3897285..4f6bc820 100644 --- a/tests/unit/app/driver/config/test_fram_cfg.c +++ b/tests/unit/app/driver/config/test_fram_cfg.c @@ -43,8 +43,8 @@ * @file test_fram_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_interlock_cfg.c b/tests/unit/app/driver/config/test_interlock_cfg.c index 0f6f4ee9..09ac13b9 100644 --- a/tests/unit/app/driver/config/test_interlock_cfg.c +++ b/tests/unit/app/driver/config/test_interlock_cfg.c @@ -43,8 +43,8 @@ * @file test_interlock_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_nxpfs85xx_cfg.c b/tests/unit/app/driver/config/test_nxpfs85xx_cfg.c index 0e28d414..3eb53dbf 100644 --- a/tests/unit/app/driver/config/test_nxpfs85xx_cfg.c +++ b/tests/unit/app/driver/config/test_nxpfs85xx_cfg.c @@ -43,8 +43,8 @@ * @file test_nxpfs85xx_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_pex_cfg.c b/tests/unit/app/driver/config/test_pex_cfg.c index 0e0f7cae..9cb027ea 100644 --- a/tests/unit/app/driver/config/test_pex_cfg.c +++ b/tests/unit/app/driver/config/test_pex_cfg.c @@ -43,8 +43,8 @@ * @file test_pex_cfg.c * @author foxBMS Team * @date 2021-08-03 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_spi_cfg.c b/tests/unit/app/driver/config/test_spi_cfg.c index 028a2176..b6a87171 100644 --- a/tests/unit/app/driver/config/test_spi_cfg.c +++ b/tests/unit/app/driver/config/test_spi_cfg.c @@ -43,8 +43,8 @@ * @file test_spi_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/config/test_sps_cfg.c b/tests/unit/app/driver/config/test_sps_cfg.c index a6ec381e..74d96ebd 100644 --- a/tests/unit/app/driver/config/test_sps_cfg.c +++ b/tests/unit/app/driver/config/test_sps_cfg.c @@ -43,8 +43,8 @@ * @file test_sps_cfg.c * @author foxBMS Team * @date 2020-10-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/contactor/test_contactor.c b/tests/unit/app/driver/contactor/test_contactor.c index b1a076c2..2d217436 100644 --- a/tests/unit/app/driver/contactor/test_contactor.c +++ b/tests/unit/app/driver/contactor/test_contactor.c @@ -43,8 +43,8 @@ * @file test_contactor.c * @author foxBMS Team * @date 2020-03-31 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -55,6 +55,7 @@ /*========== Includes =======================================================*/ #include "unity.h" #include "Mockcontactor_cfg.h" +#include "Mockdiag.h" #include "Mockfassert.h" #include "Mockio.h" #include "Mockmcu.h" @@ -69,10 +70,30 @@ BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS] = { BS_STRING_WITH_PRECHARGE, }; -CONT_CONTACTOR_STATE_s cont_contactorStates[BS_NR_OF_CONTACTORS] = { - {CONT_SWITCH_OFF, CONT_SWITCH_OFF, CONT_FEEDBACK_THROUGH_CURRENT, 0u, CONT_STRING0_PLUS}, - {CONT_SWITCH_OFF, CONT_SWITCH_OFF, CONT_FEEDBACK_THROUGH_CURRENT, 1u, CONT_STRING0_MINUS}, - {CONT_SWITCH_OFF, CONT_SWITCH_OFF, CONT_FEEDBACK_THROUGH_CURRENT, 2u, CONT_STRING1_PLUS}, +CONT_CONTACTOR_STATE_s cont_contactorStates[] = { + /* String contactors configuration */ + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_FEEDBACK_NORMALLY_OPEN, + BS_STRING0, + CONT_PLUS, + SPS_CHANNEL_0, + CONT_CHARGING_DIRECTION}, + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_FEEDBACK_NORMALLY_OPEN, + BS_STRING0, + CONT_MINUS, + SPS_CHANNEL_1, + CONT_DISCHARGING_DIRECTION}, + /* Precharge contactors configuration */ + {CONT_SWITCH_OFF, + CONT_SWITCH_OFF, + CONT_HAS_NO_FEEDBACK, + BS_STRING0, + CONT_PRECHARGE, + SPS_CHANNEL_2, + CONT_BIDIRECTIONAL}, }; /*========== Setup and Teardown =============================================*/ @@ -94,59 +115,3 @@ void testCONT_InitializationCheckOfContactorRegistryWrongAffiliation(void) { SPS_GetChannelAffiliation_IgnoreAndReturn(SPS_AFF_GENERAL_IO); TEST_ASSERT_FAIL_ASSERT(TEST_CONT_InitializationCheckOfContactorRegistry()); } -void testCONT_ResolveContactorNameExistingNamesFirst(void) { - /* check if the name of the first entry returns the first entry of the array */ - CONT_CONTACTOR_INDEX index = 0u; - TEST_ASSERT_PASS_ASSERT(TEST_ASSERT_EQUAL(index, TEST_CONT_ResolveContactorName(cont_contactorStates[index].name))); -} - -void testCONT_ResolveContactorNameExistingNamesLast(void) { - /* check if the name of the last entry returns the last entry of the array */ - CONT_CONTACTOR_INDEX index = BS_NR_OF_CONTACTORS - 1u; - TEST_ASSERT_PASS_ASSERT(TEST_ASSERT_EQUAL(index, TEST_CONT_ResolveContactorName(cont_contactorStates[index].name))); -} - -void testCONT_ResolveContactorNameInvalidName(void) { - /* check if an invalid name asserts */ - TEST_ASSERT_FAIL_ASSERT(TEST_ASSERT_EQUAL(0u, TEST_CONT_ResolveContactorName(84u))); -} - -void testCONT_SetContactorStateInvalidState(void) { - SPS_RequestContactorState_Ignore(); - - TEST_ASSERT_FAIL_ASSERT(CONT_SetContactorState(0u, 42u)); -} - -void testCONT_SetContactorStateInvalidContactorNumber(void) { - SPS_RequestContactorState_Ignore(); - - TEST_ASSERT_FAIL_ASSERT(CONT_SetContactorState(42u, CONT_SWITCH_OFF)); -} - -void testCONT_SetContactorStateCopyStates(void) { - /* Check that every contactor is requested off when undef is used */ - for (uint8_t contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { - /* when undef is called, channels should not be touched normally */ - SPS_RequestContactorState_Expect(contactor, SPS_CHANNEL_OFF); - TEST_ASSERT_PASS_ASSERT(TEST_ASSERT_EQUAL(STD_NOT_OK, CONT_SetContactorState(contactor, CONT_SWITCH_UNDEF))); - } - - /* Check that every contactor is requested on */ - for (uint8_t contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { - SPS_RequestContactorState_Expect(contactor, SPS_CHANNEL_ON); - TEST_ASSERT_PASS_ASSERT(TEST_ASSERT_EQUAL(STD_OK, CONT_SetContactorState(contactor, CONT_SWITCH_ON))); - } - - /* Check that every contactor is requested off when undef is used */ - for (uint8_t contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { - /* when undef is called, channels should not be touched normally */ - SPS_RequestContactorState_Expect(contactor, SPS_CHANNEL_ON); - TEST_ASSERT_PASS_ASSERT(TEST_ASSERT_EQUAL(STD_NOT_OK, CONT_SetContactorState(contactor, CONT_SWITCH_UNDEF))); - } - - /* Check that every contactor is requested off */ - for (uint8_t contactor = 0u; contactor < BS_NR_OF_CONTACTORS; contactor++) { - SPS_RequestContactorState_Expect(contactor, SPS_CHANNEL_OFF); - TEST_ASSERT_PASS_ASSERT(TEST_ASSERT_EQUAL(STD_OK, CONT_SetContactorState(contactor, CONT_SWITCH_OFF))); - } -} diff --git a/tests/unit/app/driver/crc/test_crc.c b/tests/unit/app/driver/crc/test_crc.c index fb5a2e9e..30e10e0f 100644 --- a/tests/unit/app/driver/crc/test_crc.c +++ b/tests/unit/app/driver/crc/test_crc.c @@ -43,8 +43,8 @@ * @file test_crc.c * @author foxBMS Team * @date 2022-02-23 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/dma/test_dma.c b/tests/unit/app/driver/dma/test_dma.c index 4b902ba8..f4f635a1 100644 --- a/tests/unit/app/driver/dma/test_dma.c +++ b/tests/unit/app/driver/dma/test_dma.c @@ -43,8 +43,8 @@ * @file test_dma.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/foxmath/test_foxmath.c b/tests/unit/app/driver/foxmath/test_foxmath.c index e2c23a7d..b6c092e2 100644 --- a/tests/unit/app/driver/foxmath/test_foxmath.c +++ b/tests/unit/app/driver/foxmath/test_foxmath.c @@ -43,8 +43,8 @@ * @file test_foxmath.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/fram/test_fram.c b/tests/unit/app/driver/fram/test_fram.c index 05d31cba..1c2d2789 100644 --- a/tests/unit/app/driver/fram/test_fram.c +++ b/tests/unit/app/driver/fram/test_fram.c @@ -43,8 +43,8 @@ * @file test_fram.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/htsensor/test_htsensor.c b/tests/unit/app/driver/htsensor/test_htsensor.c index 2f2949d0..bf0d11c1 100644 --- a/tests/unit/app/driver/htsensor/test_htsensor.c +++ b/tests/unit/app/driver/htsensor/test_htsensor.c @@ -43,8 +43,8 @@ * @file test_htsensor.c * @author foxBMS Team * @date 2021-08-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/i2c/test_i2c.c b/tests/unit/app/driver/i2c/test_i2c.c index f0a13762..dd6a62ab 100644 --- a/tests/unit/app/driver/i2c/test_i2c.c +++ b/tests/unit/app/driver/i2c/test_i2c.c @@ -43,8 +43,8 @@ * @file test_i2c.c * @author foxBMS Team * @date 2021-07-23 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155.c b/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155.c index f4c8f7a6..89ff29af 100644 --- a/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155.c +++ b/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155.c @@ -43,8 +43,8 @@ * @file test_bender_ir155.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155_helper.c b/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155_helper.c index 0f85e683..fbda3fe2 100644 --- a/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155_helper.c +++ b/tests/unit/app/driver/imd/bender/ir155/test_bender_ir155_helper.c @@ -43,8 +43,8 @@ * @file test_bender_ir155_helper.c * @author foxBMS Team * @date 2020-11-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/imd/bender/iso165c/config/test_bender_iso165c_cfg.c b/tests/unit/app/driver/imd/bender/iso165c/config/test_bender_iso165c_cfg.c index 64423efb..adac55bb 100644 --- a/tests/unit/app/driver/imd/bender/iso165c/config/test_bender_iso165c_cfg.c +++ b/tests/unit/app/driver/imd/bender/iso165c/config/test_bender_iso165c_cfg.c @@ -43,8 +43,8 @@ * @file test_bender_iso165c_cfg.c * @author foxBMS Team * @date 2021-03-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/imd/bender/iso165c/test_bender_iso165c.c b/tests/unit/app/driver/imd/bender/iso165c/test_bender_iso165c.c index efc5b68e..3951101d 100644 --- a/tests/unit/app/driver/imd/bender/iso165c/test_bender_iso165c.c +++ b/tests/unit/app/driver/imd/bender/iso165c/test_bender_iso165c.c @@ -43,8 +43,8 @@ * @file test_bender_iso165c.c * @author foxBMS Team * @date 2021-01-19 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -65,6 +65,7 @@ #include "Mockos.h" #include "bender_iso165c.h" +#include "can_cfg_rx-message-definitions.h" #include "test_assert_helper.h" /*========== Definitions and Implementations for Unit Test ==================*/ @@ -88,7 +89,7 @@ void tearDown(void) { * */ void testMessageComposition(void) { - CAN_BUFFERELEMENT_s canMessage; + CAN_BUFFER_ELEMENT_s canMessage; uint8_t dataWord; uint8_t dataByte; uint16_t data16; @@ -193,25 +194,25 @@ void testMessageComposition(void) { TEST_ASSERT_FAIL_ASSERT(TEST_I165C_CheckResponse(command, NULL_PTR)); /* Check that response ID corresponds to awaited acknowledge */ - canMessage.id = CAN_ID_IMD_RESPONSE; + canMessage.id = CANRX_IMD_RESPONSE_ID; canMessage.data[0u] = 0xA; command = 0xA; TEST_ASSERT_EQUAL(true, TEST_I165C_CheckResponse(command, &canMessage)); /* Check that response ID does not correspond to awaited acknowledge */ - canMessage.id = CAN_ID_IMD_RESPONSE; + canMessage.id = CANRX_IMD_RESPONSE_ID; canMessage.data[0u] = 0xA; command = 0xB; TEST_ASSERT_EQUAL(false, TEST_I165C_CheckResponse(command, &canMessage)); - /* Check that response failed if ID is not CAN_ID_IMD_RESPONSE, even if response matches command */ - canMessage.id = CAN_ID_IMD_INFO; + /* Check that response failed if ID is not CANRX_IMD_RESPONSE_ID, even if response matches command */ + canMessage.id = CANRX_IMD_INFO_ID; canMessage.data[0u] = 0xA; command = 0xA; TEST_ASSERT_EQUAL(false, TEST_I165C_CheckResponse(command, &canMessage)); - /* Check that response failed if ID is not CAN_ID_IMD_RESPONSE, if respose does not match command */ - canMessage.id = CAN_ID_IMD_INFO; + /* Check that response failed if ID is not CANRX_IMD_RESPONSE_ID, if respose does not match command */ + canMessage.id = CANRX_IMD_INFO_ID; canMessage.data[0u] = 0xA; command = 0xB; TEST_ASSERT_EQUAL(false, TEST_I165C_CheckResponse(command, &canMessage)); @@ -258,7 +259,7 @@ void testMessageComposition(void) { TEST_ASSERT_FAIL_ASSERT(TEST_I165C_CheckAcknowledgeArrived(command, &tries, NULL_PTR)); /* Acknowledge arrived */ - canMessage.id = CAN_ID_IMD_RESPONSE; + canMessage.id = CANRX_IMD_RESPONSE_ID; tries = 0u; command = 0xA; canMessage.data[0] = 0xA; @@ -269,7 +270,7 @@ void testMessageComposition(void) { TEST_ASSERT_EQUAL(0u, tries); /* Acknowledge not arrived, increment try counter */ - canMessage.id = CAN_ID_IMD_RESPONSE; + canMessage.id = CANRX_IMD_RESPONSE_ID; tries = 0u; command = 0xA; canMessage.data[0] = 0xB; diff --git a/tests/unit/app/driver/imd/none/test_no-imd.c b/tests/unit/app/driver/imd/none/test_no-imd.c index bcdc2e2a..09706055 100644 --- a/tests/unit/app/driver/imd/none/test_no-imd.c +++ b/tests/unit/app/driver/imd/none/test_no-imd.c @@ -43,8 +43,8 @@ * @file test_no-imd.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/imd/test_imd.c b/tests/unit/app/driver/imd/test_imd.c index 879b2a65..6a02865c 100644 --- a/tests/unit/app/driver/imd/test_imd.c +++ b/tests/unit/app/driver/imd/test_imd.c @@ -43,8 +43,8 @@ * @file test_imd.c * @author foxBMS Team * @date 2021-11-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/interlock/test_interlock.c b/tests/unit/app/driver/interlock/test_interlock.c index b26766c7..618a3373 100644 --- a/tests/unit/app/driver/interlock/test_interlock.c +++ b/tests/unit/app/driver/interlock/test_interlock.c @@ -43,8 +43,8 @@ * @file test_interlock.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/io/test_io.c b/tests/unit/app/driver/io/test_io.c index b7b99f25..f376bb66 100644 --- a/tests/unit/app/driver/io/test_io.c +++ b/tests/unit/app/driver/io/test_io.c @@ -43,8 +43,8 @@ * @file test_io.c * @author foxBMS Team * @date 2020-06-10 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/led/test_led.c b/tests/unit/app/driver/led/test_led.c index 77ee9ec5..3794f506 100644 --- a/tests/unit/app/driver/led/test_led.c +++ b/tests/unit/app/driver/led/test_led.c @@ -43,8 +43,8 @@ * @file test_led.c * @author foxBMS Team * @date 2020-10-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/mcu/test_mcu.c b/tests/unit/app/driver/mcu/test_mcu.c index 02d2eee6..5cdb9bb6 100644 --- a/tests/unit/app/driver/mcu/test_mcu.c +++ b/tests/unit/app/driver/mcu/test_mcu.c @@ -43,8 +43,8 @@ * @file test_mcu.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/meas/test_meas.c b/tests/unit/app/driver/meas/test_meas.c index 18688fb9..965e6547 100644 --- a/tests/unit/app/driver/meas/test_meas.c +++ b/tests/unit/app/driver/meas/test_meas.c @@ -43,8 +43,8 @@ * @file test_meas.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/pex/test_pex.c b/tests/unit/app/driver/pex/test_pex.c index d5c8ad1c..0e0cd661 100644 --- a/tests/unit/app/driver/pex/test_pex.c +++ b/tests/unit/app/driver/pex/test_pex.c @@ -43,8 +43,8 @@ * @file test_pex.c * @author foxBMS Team * @date 2021-09-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/pwm/test_pwm.c b/tests/unit/app/driver/pwm/test_pwm.c index 0d714f9e..bd0cc88f 100644 --- a/tests/unit/app/driver/pwm/test_pwm.c +++ b/tests/unit/app/driver/pwm/test_pwm.c @@ -43,8 +43,8 @@ * @file test_pwm.c * @author foxBMS Team * @date 2021-10-08 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/rtc/test_rtc.c b/tests/unit/app/driver/rtc/test_rtc.c index 35042f0b..9e89d9c9 100644 --- a/tests/unit/app/driver/rtc/test_rtc.c +++ b/tests/unit/app/driver/rtc/test_rtc.c @@ -43,8 +43,8 @@ * @file test_rtc.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/sbc/test_nxpfs85xx.c b/tests/unit/app/driver/sbc/test_nxpfs85xx.c index 4cca35c8..dd0163fb 100644 --- a/tests/unit/app/driver/sbc/test_nxpfs85xx.c +++ b/tests/unit/app/driver/sbc/test_nxpfs85xx.c @@ -43,8 +43,8 @@ * @file test_nxpfs85xx.c * @author foxBMS Team * @date 2020-04-06 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix SBC * diff --git a/tests/unit/app/driver/sbc/test_sbc.c b/tests/unit/app/driver/sbc/test_sbc.c index b61578b0..5549db44 100644 --- a/tests/unit/app/driver/sbc/test_sbc.c +++ b/tests/unit/app/driver/sbc/test_sbc.c @@ -43,8 +43,8 @@ * @file test_sbc.c * @author foxBMS Team * @date 2020-07-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix SBC * diff --git a/tests/unit/app/driver/spi/test_spi.c b/tests/unit/app/driver/spi/test_spi.c index 925ff4ff..da32c557 100644 --- a/tests/unit/app/driver/spi/test_spi.c +++ b/tests/unit/app/driver/spi/test_spi.c @@ -43,8 +43,8 @@ * @file test_spi.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/sps/test_sps.c b/tests/unit/app/driver/sps/test_sps.c index 00c14d5c..ebb15fdf 100644 --- a/tests/unit/app/driver/sps/test_sps.c +++ b/tests/unit/app/driver/sps/test_sps.c @@ -43,8 +43,8 @@ * @file test_sps.c * @author foxBMS Team * @date 2020-10-28 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/api/test_tsi_limits.c b/tests/unit/app/driver/ts/api/test_tsi_limits.c index ad44c0d2..ea5c2b42 100644 --- a/tests/unit/app/driver/ts/api/test_tsi_limits.c +++ b/tests/unit/app/driver/ts/api/test_tsi_limits.c @@ -43,8 +43,8 @@ * @file test_tsi_limits.c * @author foxBMS Team * @date 2021-01-15 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TSI * diff --git a/tests/unit/app/driver/ts/epcos/b57251v5103j060/lookup-table/test_epcos_b57251v5103j060_lookup-table.c b/tests/unit/app/driver/ts/epcos/b57251v5103j060/lookup-table/test_epcos_b57251v5103j060_lookup-table.c index 8c92ca5a..dc68ba48 100644 --- a/tests/unit/app/driver/ts/epcos/b57251v5103j060/lookup-table/test_epcos_b57251v5103j060_lookup-table.c +++ b/tests/unit/app/driver/ts/epcos/b57251v5103j060/lookup-table/test_epcos_b57251v5103j060_lookup-table.c @@ -43,8 +43,8 @@ * @file test_epcos_b57251v5103j060_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/epcos/b57251v5103j060/polynomial/test_epcos_b57251v5103j060_polynomial.c b/tests/unit/app/driver/ts/epcos/b57251v5103j060/polynomial/test_epcos_b57251v5103j060_polynomial.c index 481a3222..b64cd41e 100644 --- a/tests/unit/app/driver/ts/epcos/b57251v5103j060/polynomial/test_epcos_b57251v5103j060_polynomial.c +++ b/tests/unit/app/driver/ts/epcos/b57251v5103j060/polynomial/test_epcos_b57251v5103j060_polynomial.c @@ -43,8 +43,8 @@ * @file test_epcos_b57251v5103j060_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/epcos/b57251v5103j060/test_epcos_b57251v5103j060.c b/tests/unit/app/driver/ts/epcos/b57251v5103j060/test_epcos_b57251v5103j060.c index 2e11988b..be800103 100644 --- a/tests/unit/app/driver/ts/epcos/b57251v5103j060/test_epcos_b57251v5103j060.c +++ b/tests/unit/app/driver/ts/epcos/b57251v5103j060/test_epcos_b57251v5103j060.c @@ -43,8 +43,8 @@ * @file test_epcos_b57251v5103j060.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/epcos/b57861s0103f045/lookup-table/test_epcos_b57861s0103f045_lookup-table.c b/tests/unit/app/driver/ts/epcos/b57861s0103f045/lookup-table/test_epcos_b57861s0103f045_lookup-table.c index 0e35a817..63fa39f8 100644 --- a/tests/unit/app/driver/ts/epcos/b57861s0103f045/lookup-table/test_epcos_b57861s0103f045_lookup-table.c +++ b/tests/unit/app/driver/ts/epcos/b57861s0103f045/lookup-table/test_epcos_b57861s0103f045_lookup-table.c @@ -43,8 +43,8 @@ * @file test_epcos_b57861s0103f045_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/epcos/b57861s0103f045/polynomial/test_epcos_b57861s0103f045_polynomial.c b/tests/unit/app/driver/ts/epcos/b57861s0103f045/polynomial/test_epcos_b57861s0103f045_polynomial.c index 955aeaed..1435b5d7 100644 --- a/tests/unit/app/driver/ts/epcos/b57861s0103f045/polynomial/test_epcos_b57861s0103f045_polynomial.c +++ b/tests/unit/app/driver/ts/epcos/b57861s0103f045/polynomial/test_epcos_b57861s0103f045_polynomial.c @@ -43,8 +43,8 @@ * @file test_epcos_b57861s0103f045_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/epcos/b57861s0103f045/test_epcos_b57861s0103f045.c b/tests/unit/app/driver/ts/epcos/b57861s0103f045/test_epcos_b57861s0103f045.c index ed13e8ad..7233269e 100644 --- a/tests/unit/app/driver/ts/epcos/b57861s0103f045/test_epcos_b57861s0103f045.c +++ b/tests/unit/app/driver/ts/epcos/b57861s0103f045/test_epcos_b57861s0103f045.c @@ -43,8 +43,8 @@ * @file test_epcos_b57861s0103f045.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/fake/none/lookup-table/test_fake_none_lookup-table.c b/tests/unit/app/driver/ts/fake/none/lookup-table/test_fake_none_lookup-table.c index 853476ff..854af03e 100644 --- a/tests/unit/app/driver/ts/fake/none/lookup-table/test_fake_none_lookup-table.c +++ b/tests/unit/app/driver/ts/fake/none/lookup-table/test_fake_none_lookup-table.c @@ -43,8 +43,8 @@ * @file test_fake_none_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/fake/none/polynomial/test_fake_none_polynomial.c b/tests/unit/app/driver/ts/fake/none/polynomial/test_fake_none_polynomial.c index 58cd09a9..698c33fb 100644 --- a/tests/unit/app/driver/ts/fake/none/polynomial/test_fake_none_polynomial.c +++ b/tests/unit/app/driver/ts/fake/none/polynomial/test_fake_none_polynomial.c @@ -43,8 +43,8 @@ * @file test_fake_none_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/fake/none/test_fake_none.c b/tests/unit/app/driver/ts/fake/none/test_fake_none.c index 103b169c..0876d4d8 100644 --- a/tests/unit/app/driver/ts/fake/none/test_fake_none.c +++ b/tests/unit/app/driver/ts/fake/none/test_fake_none.c @@ -43,8 +43,8 @@ * @file test_fake_none.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/lookup-table/test_murata_ncu15xh103f6sxx_lookup-table.c b/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/lookup-table/test_murata_ncu15xh103f6sxx_lookup-table.c new file mode 100644 index 00000000..92f29ddd --- /dev/null +++ b/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/lookup-table/test_murata_ncu15xh103f6sxx_lookup-table.c @@ -0,0 +1,79 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_murata_ncu15xh103f6sxx_lookup-table.c + * @author foxBMS Team + * @date 2022-10-13 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Test of fake temperature sensor + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockmurata_ncu15xh103f6sxx.h" + +#include "foxmath.h" +#include "tsi.h" + +TEST_FILE("murata_ncu15xh103f6sxx_lookup-table.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testTSI_GetTemperatureFromEpcosB57861S0103F045LookupTable(void) { + const uint8_t test_adcVoltage_mv = 5; + const float test_temperature = 1.0; + TS_Mur00GetTemperatureFromLut_ExpectAndReturn(test_adcVoltage_mv, test_temperature); + TEST_ASSERT_EQUAL(test_temperature, TSI_GetTemperature(test_adcVoltage_mv)); +} diff --git a/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/polynomial/test_murata_ncu15xh103f6sxx_polynomial.c b/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/polynomial/test_murata_ncu15xh103f6sxx_polynomial.c new file mode 100644 index 00000000..d64c5dc3 --- /dev/null +++ b/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/polynomial/test_murata_ncu15xh103f6sxx_polynomial.c @@ -0,0 +1,80 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_murata_ncu15xh103f6sxx_polynomial.c + * @author foxBMS Team + * @date 2022-12-13 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Test of fake temperature sensor + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockmurata_ncu15xh103f6sxx.h" + +#include "foxmath.h" +#include "test_assert_helper.h" +#include "tsi.h" + +TEST_FILE("murata_ncu15xh103f6sxx_polynomial.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testTSI_GetTemperatureFromMurataNcu15xh103f6sxx(void) { + const uint8_t test_adcVoltage_mv = 0x64; + const float test_temperature = 3.5; + TS_Mur00GetTemperatureFromPolynomial_ExpectAndReturn(test_adcVoltage_mv, test_temperature); + TEST_ASSERT_EQUAL(test_temperature, TSI_GetTemperature(test_adcVoltage_mv)); +} diff --git a/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/test_murata_ncu15xh103f6sxx.c b/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/test_murata_ncu15xh103f6sxx.c new file mode 100644 index 00000000..f94c3eed --- /dev/null +++ b/tests/unit/app/driver/ts/murata/ncu15xh103f6sxx/test_murata_ncu15xh103f6sxx.c @@ -0,0 +1,80 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_murata_ncu15xh103f6sxx.c + * @author foxBMS Team + * @date 2022-10-13 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Tests for the epcos_b57861s0103f045 module + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" + +#include "foxmath.h" +#include "murata_ncu15xh103f6sxx.h" +#include "test_assert_helper.h" + +/*========== Definitions and Implementations for Unit Test ==================*/ + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testTS_Mur00GetTemperatureFromLutFixedValues(void) { + TEST_ASSERT_EQUAL_INT16(INT16_MAX, TS_Mur00GetTemperatureFromLut(0u)); + TEST_ASSERT_EQUAL_INT16(INT16_MIN, TS_Mur00GetTemperatureFromLut(4000u)); + TEST_ASSERT_EQUAL_INT16(139, TS_Mur00GetTemperatureFromLut(2000u)); +} + +void testTS_Mur00GetTemperatureFromPolynomialFixedValues(void) { + TEST_ASSERT_FAIL_ASSERT(TS_Mur00GetTemperatureFromPolynomial(100u)); +} diff --git a/tests/unit/app/driver/ts/test_beta.c b/tests/unit/app/driver/ts/test_beta.c index fbf16126..ebc95f89 100644 --- a/tests/unit/app/driver/ts/test_beta.c +++ b/tests/unit/app/driver/ts/test_beta.c @@ -43,8 +43,8 @@ * @file test_beta.c * @author foxBMS Team * @date 2020-03-13 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix BETA * diff --git a/tests/unit/app/driver/ts/vishay/ntcalug01a103g/lookup-table/test_vishay_ntcalug01a103g_lookup-table.c b/tests/unit/app/driver/ts/vishay/ntcalug01a103g/lookup-table/test_vishay_ntcalug01a103g_lookup-table.c index 544f33db..61be7e30 100644 --- a/tests/unit/app/driver/ts/vishay/ntcalug01a103g/lookup-table/test_vishay_ntcalug01a103g_lookup-table.c +++ b/tests/unit/app/driver/ts/vishay/ntcalug01a103g/lookup-table/test_vishay_ntcalug01a103g_lookup-table.c @@ -43,8 +43,8 @@ * @file test_vishay_ntcalug01a103g_lookup-table.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/vishay/ntcalug01a103g/polynomial/test_vishay_ntcalug01a103g_polynomial.c b/tests/unit/app/driver/ts/vishay/ntcalug01a103g/polynomial/test_vishay_ntcalug01a103g_polynomial.c index d9cc7e51..5d38bd47 100644 --- a/tests/unit/app/driver/ts/vishay/ntcalug01a103g/polynomial/test_vishay_ntcalug01a103g_polynomial.c +++ b/tests/unit/app/driver/ts/vishay/ntcalug01a103g/polynomial/test_vishay_ntcalug01a103g_polynomial.c @@ -43,8 +43,8 @@ * @file test_vishay_ntcalug01a103g_polynomial.c * @author foxBMS Team * @date 2020-08-25 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/vishay/ntcalug01a103g/test_vishay_ntcalug01a103g.c b/tests/unit/app/driver/ts/vishay/ntcalug01a103g/test_vishay_ntcalug01a103g.c index 0fed8d46..27e49406 100644 --- a/tests/unit/app/driver/ts/vishay/ntcalug01a103g/test_vishay_ntcalug01a103g.c +++ b/tests/unit/app/driver/ts/vishay/ntcalug01a103g/test_vishay_ntcalug01a103g.c @@ -43,8 +43,8 @@ * @file test_vishay_ntcalug01a103g.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/test_vishay_ntcle317e4103sba_lookup-table.c b/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/test_vishay_ntcle317e4103sba_lookup-table.c index 333cde07..f101b0be 100644 --- a/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/test_vishay_ntcle317e4103sba_lookup-table.c +++ b/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/lookup-table/test_vishay_ntcle317e4103sba_lookup-table.c @@ -43,8 +43,8 @@ * @file test_vishay_ntcle317e4103sba_lookup-table.c * @author foxBMS Team * @date 2021-11-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/test_vishay_ntcle317e4103sba.c b/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/test_vishay_ntcle317e4103sba.c index 0fbf8223..14e91701 100644 --- a/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/test_vishay_ntcle317e4103sba.c +++ b/tests/unit/app/driver/ts/vishay/ntcle317e4103sba/test_vishay_ntcle317e4103sba.c @@ -43,8 +43,8 @@ * @file test_vishay_ntcle317e4103sba.c * @author foxBMS Team * @date 2021-11-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/config/test_database_cfg.c b/tests/unit/app/engine/config/test_database_cfg.c index 9dd14a87..037c5720 100644 --- a/tests/unit/app/engine/config/test_database_cfg.c +++ b/tests/unit/app/engine/config/test_database_cfg.c @@ -43,8 +43,8 @@ * @file test_database_cfg.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/config/test_diag_cfg.c b/tests/unit/app/engine/config/test_diag_cfg.c index d4b7dbdc..816b7c77 100644 --- a/tests/unit/app/engine/config/test_diag_cfg.c +++ b/tests/unit/app/engine/config/test_diag_cfg.c @@ -43,8 +43,8 @@ * @file test_diag_cfg.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/config/test_sys_cfg.c b/tests/unit/app/engine/config/test_sys_cfg.c index bde37f00..0e1682d2 100644 --- a/tests/unit/app/engine/config/test_sys_cfg.c +++ b/tests/unit/app/engine/config/test_sys_cfg.c @@ -43,8 +43,8 @@ * @file test_sys_cfg.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -55,6 +55,7 @@ /*========== Includes =======================================================*/ #include "unity.h" #include "Mockcan.h" +#include "Mockcan_cfg_tx_boot-message.h" #include "sys_cfg.h" @@ -69,7 +70,7 @@ void tearDown(void) { /*========== Test Cases =====================================================*/ void testSysSendBootMessageExists(void) { - CAN_TransmitBootMessage_IgnoreAndReturn(STD_OK); - CAN_TransmitDieId_IgnoreAndReturn(STD_OK); + CANTX_TransmitBootMessage_IgnoreAndReturn(STD_OK); + CANTX_TransmitDieId_IgnoreAndReturn(STD_OK); SYS_SendBootMessage(); } diff --git a/tests/unit/app/engine/config/test_sys_mon_cfg.c b/tests/unit/app/engine/config/test_sys_mon_cfg.c index 2e95816f..33e7ab6d 100644 --- a/tests/unit/app/engine/config/test_sys_mon_cfg.c +++ b/tests/unit/app/engine/config/test_sys_mon_cfg.c @@ -43,8 +43,8 @@ * @file test_sys_mon_cfg.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/database/test_database.c b/tests/unit/app/engine/database/test_database.c index 825857c0..6c95e236 100644 --- a/tests/unit/app/engine/database/test_database.c +++ b/tests/unit/app/engine/database/test_database.c @@ -43,8 +43,8 @@ * @file test_database.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/database/test_database_helper.c b/tests/unit/app/engine/database/test_database_helper.c index f81f1183..0e27f30d 100644 --- a/tests/unit/app/engine/database/test_database_helper.c +++ b/tests/unit/app/engine/database/test_database_helper.c @@ -43,8 +43,8 @@ * @file test_database_helper.c * @author foxBMS Team * @date 2021-05-05 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_afe.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_afe.c index 33a7a85d..648bfbaf 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_afe.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_afe.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_afe.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_bms.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_bms.c new file mode 100644 index 00000000..0a28cd9c --- /dev/null +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_bms.c @@ -0,0 +1,118 @@ +/** + * + * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * We kindly request you to use one or more of the following phrases to refer to + * foxBMS in your hardware, software, documentation or advertising materials: + * + * - ″This product uses parts of foxBMS®″ + * - ″This product includes parts of foxBMS®″ + * - ″This product is derived from foxBMS®″ + * + */ + +/** + * @file test_diag_cbs_bms.c + * @author foxBMS Team + * @date 2022-07-27 (date of creation) + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 + * @ingroup UNIT_TEST_IMPLEMENTATION + * @prefix TEST + * + * @brief Test of the BMS diag handler implementation. + * + */ + +/*========== Includes =======================================================*/ +#include "unity.h" +#include "Mockdiag_cfg.h" + +#include "diag_cbs.h" +#include "test_assert_helper.h" + +TEST_FILE("diag_cbs_bms.c") + +/*========== Definitions and Implementations for Unit Test ==================*/ +/** local copy of the #DATA_BLOCK_ERRORSTATE_s table */ +static DATA_BLOCK_ERRORSTATE_s test_tableErrorFlags = {.header.uniqueId = DATA_BLOCK_ID_ERRORSTATE}; + +/** local copy of the #DATA_BLOCK_MOL_FLAG_s table */ +static DATA_BLOCK_MOL_FLAG_s test_tableMolFlags = {.header.uniqueId = DATA_BLOCK_ID_MOL_FLAG}; + +/** local copy of the #DATA_BLOCK_RSL_FLAG_s table */ +static DATA_BLOCK_RSL_FLAG_s test_tableRslFlags = {.header.uniqueId = DATA_BLOCK_ID_RSL_FLAG}; + +/** local copy of the #DATA_BLOCK_MSL_FLAG_s table */ +static DATA_BLOCK_MSL_FLAG_s test_tableMslFlags = {.header.uniqueId = DATA_BLOCK_ID_MSL_FLAG}; + +const DIAG_DATABASE_SHIM_s diag_kpkDatabaseShim = { + .pTableError = &test_tableErrorFlags, + .pTableMol = &test_tableMolFlags, + .pTableRsl = &test_tableRslFlags, + .pTableMsl = &test_tableMslFlags, +}; + +/*========== Setup and Teardown =============================================*/ +void setUp(void) { + diag_kpkDatabaseShim.pTableError->alertFlag = false; +} + +void tearDown(void) { +} + +/*========== Test Cases =====================================================*/ +void testDIAG_AlertFlag(void) { + /* reset event sets the interlock back in ok mode */ + DIAG_AlertFlag(DIAG_ID_ALERT_MODE, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, 0u); + TEST_ASSERT_EQUAL(false, diag_kpkDatabaseShim.pTableError->alertFlag); + /* ok event must not change the interlock state */ + DIAG_AlertFlag(DIAG_ID_ALERT_MODE, DIAG_EVENT_OK, &diag_kpkDatabaseShim, 0u); + TEST_ASSERT_EQUAL(false, diag_kpkDatabaseShim.pTableError->alertFlag); + + /* not ok event sets the alert mode back in not ok mode */ + DIAG_AlertFlag(DIAG_ID_ALERT_MODE, DIAG_EVENT_NOT_OK, &diag_kpkDatabaseShim, 0u); + TEST_ASSERT_EQUAL(true, diag_kpkDatabaseShim.pTableError->alertFlag); + /* Alert mode can not be reset via ok event, therefore the alert mode is still activated */ + DIAG_AlertFlag(DIAG_ID_ALERT_MODE, DIAG_EVENT_OK, &diag_kpkDatabaseShim, 0u); + TEST_ASSERT_EQUAL(true, diag_kpkDatabaseShim.pTableError->alertFlag); + + /* reset event sets the interlock back in ok mode */ + DIAG_AlertFlag(DIAG_ID_ALERT_MODE, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, 0u); + TEST_ASSERT_EQUAL(false, diag_kpkDatabaseShim.pTableError->alertFlag); +} + +/** tests invalid input values */ +void testDIAG_AlertFlagInvalidInput(void) { + TEST_ASSERT_FAIL_ASSERT(DIAG_AlertFlag(DIAG_ID_MAX, DIAG_EVENT_OK, &diag_kpkDatabaseShim, 0u)); + TEST_ASSERT_FAIL_ASSERT(DIAG_AlertFlag(DIAG_ID_ALERT_MODE, 42, &diag_kpkDatabaseShim, 0u)); + TEST_ASSERT_FAIL_ASSERT(DIAG_AlertFlag(DIAG_ID_ALERT_MODE, DIAG_EVENT_OK, NULL_PTR, 0u)); +} diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_can.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_can.c index 9fb8121c..7422192a 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_can.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_can.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_can.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_contactor.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_contactor.c index 7290c84d..4920755d 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_contactor.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_contactor.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_contactor.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -84,8 +84,9 @@ const DIAG_DATABASE_SHIM_s diag_kpkDatabaseShim = { /*========== Setup and Teardown =============================================*/ void setUp(void) { for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - diag_kpkDatabaseShim.pTableError->stringContactor[s] = 0u; - diag_kpkDatabaseShim.pTableError->prechargeContactor[s] = 0u; + diag_kpkDatabaseShim.pTableError->stringMinusContactor[s] = 0u; + diag_kpkDatabaseShim.pTableError->stringPlusContactor[s] = 0u; + diag_kpkDatabaseShim.pTableError->prechargeContactor[s] = 0u; } } @@ -97,47 +98,50 @@ void tearDown(void) { void testDiagContactorStringContactorFeedback(void) { for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { /* reset event sets the string contactor feedback back in ok mode */ - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s); + DIAG_StringContactorFeedback( + DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s); } for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { /* reset event sets the string contactor feedback back in ok mode */ - TEST_ASSERT_EQUAL(0, diag_kpkDatabaseShim.pTableError->stringContactor[s]); + TEST_ASSERT_EQUAL(0, diag_kpkDatabaseShim.pTableError->stringMinusContactor[s]); } for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { /* reset event sets the string contactor feedback back in ok mode */ - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, &diag_kpkDatabaseShim, s); + DIAG_StringContactorFeedback(DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, &diag_kpkDatabaseShim, s); } for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { /* reset event sets the string contactor feedback back in ok mode */ - TEST_ASSERT_EQUAL(0, diag_kpkDatabaseShim.pTableError->stringContactor[s]); + TEST_ASSERT_EQUAL(0, diag_kpkDatabaseShim.pTableError->stringMinusContactor[s]); } /* not ok event sets the string contactor feedback back in not ok mode */ for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { /* reset event sets the string contactor feedback back in ok mode */ - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_NOT_OK, &diag_kpkDatabaseShim, s); + DIAG_StringContactorFeedback( + DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_NOT_OK, &diag_kpkDatabaseShim, s); } for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { /* reset event sets the string contactor feedback back in ok mode */ - TEST_ASSERT_EQUAL(1, diag_kpkDatabaseShim.pTableError->stringContactor[s]); + TEST_ASSERT_EQUAL(1, diag_kpkDatabaseShim.pTableError->stringMinusContactor[s]); } /* string contactor feedback can be resetted via ok event (instead a reset is required), therefore the * string contactor feedback must stay in not ok mode */ for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, &diag_kpkDatabaseShim, s); + DIAG_StringContactorFeedback(DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, &diag_kpkDatabaseShim, s); } for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - TEST_ASSERT_EQUAL(1, diag_kpkDatabaseShim.pTableError->stringContactor[s]); + TEST_ASSERT_EQUAL(1, diag_kpkDatabaseShim.pTableError->stringMinusContactor[s]); } /* reset event sets the string contactor feedback back in ok mode */ for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s); + DIAG_StringContactorFeedback( + DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s); } for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - TEST_ASSERT_EQUAL(0, diag_kpkDatabaseShim.pTableError->stringContactor[s]); + TEST_ASSERT_EQUAL(0, diag_kpkDatabaseShim.pTableError->stringMinusContactor[s]); } } @@ -191,23 +195,13 @@ void testDiagContactorPrechargeContactorFeedback(void) { } } -void testDIAG_DoNothingOnWrongIdContactorModule(void) { - uint8_t testValue = 42; - for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - diag_kpkDatabaseShim.pTableError->stringContactor[s] = testValue; - diag_kpkDatabaseShim.pTableError->prechargeContactor[s] = testValue; - testValue++; - } - +void testDIAG_AssertOnWrongIdContactorModule(void) { /* Use a wrong ID to make sure, that this does not alter the CAN entry */ for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - DIAG_PrechargeContactorFeedback( - DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_RSL, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s); - DIAG_StringContactorFeedback(DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_RSL, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s); - } - for (uint8_t s = 0; s < BS_NR_OF_STRINGS; s++) { - TEST_ASSERT_EQUAL(testValue - BS_NR_OF_STRINGS + s, diag_kpkDatabaseShim.pTableError->prechargeContactor[s]); - TEST_ASSERT_EQUAL(testValue - BS_NR_OF_STRINGS + s, diag_kpkDatabaseShim.pTableError->stringContactor[s]); + TEST_ASSERT_FAIL_ASSERT(DIAG_PrechargeContactorFeedback( + DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_RSL, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s)); + TEST_ASSERT_FAIL_ASSERT(DIAG_StringContactorFeedback( + DIAG_ID_CELL_VOLTAGE_OVERVOLTAGE_RSL, DIAG_EVENT_RESET, &diag_kpkDatabaseShim, s)); } } @@ -215,11 +209,11 @@ void testDIAG_DoNothingOnWrongIdContactorModule(void) { void testDIAG_StringContactorFeedbackInvalidInput(void) { TEST_ASSERT_FAIL_ASSERT(DIAG_StringContactorFeedback(DIAG_ID_MAX, DIAG_EVENT_OK, &diag_kpkDatabaseShim, 0u)); TEST_ASSERT_FAIL_ASSERT( - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, 42, &diag_kpkDatabaseShim, 0u)); + DIAG_StringContactorFeedback(DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, 42, &diag_kpkDatabaseShim, 0u)); TEST_ASSERT_FAIL_ASSERT( - DIAG_StringContactorFeedback(DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, NULL_PTR, 0u)); + DIAG_StringContactorFeedback(DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, NULL_PTR, 0u)); TEST_ASSERT_FAIL_ASSERT(DIAG_StringContactorFeedback( - DIAG_ID_STRING_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, &diag_kpkDatabaseShim, BS_NR_OF_STRINGS)); + DIAG_ID_STRING_MINUS_CONTACTOR_FEEDBACK, DIAG_EVENT_OK, &diag_kpkDatabaseShim, BS_NR_OF_STRINGS)); } /** tests invalid input values */ diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_current-sensor.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_current-sensor.c index f4ae107e..766dc4be 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_current-sensor.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_current-sensor.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_current-sensor.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_current.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_current.c index 31c39614..1d1aa7d2 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_current.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_current.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_current.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_deep-discharge.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_deep-discharge.c index 767046ab..ead4238b 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_deep-discharge.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_deep-discharge.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_deep-discharge.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_dummy.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_dummy.c index 7e30d76c..87e09789 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_dummy.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_dummy.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_dummy.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_fram.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_fram.c index 117a67f6..13d25ea7 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_fram.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_fram.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_fram.c * @author foxBMS Team * @date 2022-02-24 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_i2c.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_i2c.c index ff07359b..75d9c430 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_i2c.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_i2c.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_i2c.c * @author foxBMS Team * @date 2021-09-29 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_insulation.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_insulation.c index 5f04e291..ce695330 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_insulation.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_insulation.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_insulation.c * @author foxBMS Team * @date 2021-02-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_interlock.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_interlock.c index 54385746..037f0579 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_interlock.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_interlock.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_interlock.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_plausibility.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_plausibility.c index 51556a08..980a4880 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_plausibility.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_plausibility.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_plausibility.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_power-measurement.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_power-measurement.c index ecd013db..2c983d47 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_power-measurement.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_power-measurement.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_power-measurement.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_sbc.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_sbc.c index 9d6b4d40..1d2a5730 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_sbc.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_sbc.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_sbc.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_sys-mon.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_sys-mon.c index 1c41e697..2567a449 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_sys-mon.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_sys-mon.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_sys-mon.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_temperature.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_temperature.c index 9cfb610a..f4bb7fcd 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_temperature.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_temperature.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_temperature.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/cbs/test_diag_cbs_voltage.c b/tests/unit/app/engine/diag/cbs/test_diag_cbs_voltage.c index 3edaaf64..b160ac35 100644 --- a/tests/unit/app/engine/diag/cbs/test_diag_cbs_voltage.c +++ b/tests/unit/app/engine/diag/cbs/test_diag_cbs_voltage.c @@ -43,8 +43,8 @@ * @file test_diag_cbs_voltage.c * @author foxBMS Team * @date 2021-02-17 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/diag/test_diag.c b/tests/unit/app/engine/diag/test_diag.c index f7ec5c86..aa4708c3 100644 --- a/tests/unit/app/engine/diag/test_diag.c +++ b/tests/unit/app/engine/diag/test_diag.c @@ -43,8 +43,8 @@ * @file test_diag.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/hwinfo/test_masterinfo.c b/tests/unit/app/engine/hwinfo/test_masterinfo.c index 67bfd7e6..da62e08b 100644 --- a/tests/unit/app/engine/hwinfo/test_masterinfo.c +++ b/tests/unit/app/engine/hwinfo/test_masterinfo.c @@ -43,8 +43,8 @@ * @file test_masterinfo.c * @author foxBMS Team * @date 2020-07-09 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/sys/test_sys.c b/tests/unit/app/engine/sys/test_sys.c index 68d2f693..3e9f27a1 100644 --- a/tests/unit/app/engine/sys/test_sys.c +++ b/tests/unit/app/engine/sys/test_sys.c @@ -43,8 +43,8 @@ * @file test_sys.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/engine/sys_mon/test_sys_mon.c b/tests/unit/app/engine/sys_mon/test_sys_mon.c index f123a083..092e8a21 100644 --- a/tests/unit/app/engine/sys_mon/test_sys_mon.c +++ b/tests/unit/app/engine/sys_mon/test_sys_mon.c @@ -43,8 +43,8 @@ * @file test_sys_mon.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/main/test_fassert.c b/tests/unit/app/main/test_fassert.c index d05ace33..e0944a70 100644 --- a/tests/unit/app/main/test_fassert.c +++ b/tests/unit/app/main/test_fassert.c @@ -43,8 +43,8 @@ * @file test_fassert.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/main/test_fstartup.c b/tests/unit/app/main/test_fstartup.c index 5d7ef7f7..ff15269f 100644 --- a/tests/unit/app/main/test_fstartup.c +++ b/tests/unit/app/main/test_fstartup.c @@ -43,8 +43,8 @@ * @file test_fstartup.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/main/test_main.c b/tests/unit/app/main/test_main.c index c4d06a4c..55403b21 100644 --- a/tests/unit/app/main/test_main.c +++ b/tests/unit/app/main/test_main.c @@ -43,8 +43,8 @@ * @file test_main.c * @author foxBMS Team * @date 2020-04-01 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/task/config/test_ftask_cfg.c b/tests/unit/app/task/config/test_ftask_cfg.c index 887f98ff..49115f80 100644 --- a/tests/unit/app/task/config/test_ftask_cfg.c +++ b/tests/unit/app/task/config/test_ftask_cfg.c @@ -43,8 +43,8 @@ * @file test_ftask_cfg.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -98,9 +98,9 @@ TaskHandle_t ftsk_taskHandleAfe; #define FTSK_DATA_QUEUE_LENGTH (1u) #define FTSK_DATA_QUEUE_ITEM_SIZE (sizeof(DATA_QUEUE_MESSAGE_s)) #define FTSK_IMD_QUEUE_LENGTH (5u) -#define FTSK_IMD_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFERELEMENT_s)) +#define FTSK_IMD_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFER_ELEMENT_s)) #define FTSK_CAN_RX_QUEUE_LENGTH (50u) -#define FTSK_CAN_RX_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFERELEMENT_s)) +#define FTSK_CAN_RX_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFER_ELEMENT_s)) volatile OS_BOOT_STATE_e os_boot = OS_OFF; volatile OS_TIMER_s os_timer = {0, 0, 0, 0, 0, 0, 0}; diff --git a/tests/unit/app/task/ftask/freertos/test_ftask_freertos.c b/tests/unit/app/task/ftask/freertos/test_ftask_freertos.c index 3678e262..8878df5f 100644 --- a/tests/unit/app/task/ftask/freertos/test_ftask_freertos.c +++ b/tests/unit/app/task/ftask/freertos/test_ftask_freertos.c @@ -43,8 +43,8 @@ * @file test_ftask_freertos.c * @author foxBMS Team * @date 2021-11-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/task/ftask/test_ftask.c b/tests/unit/app/task/ftask/test_ftask.c index 82947e85..662ad5d2 100644 --- a/tests/unit/app/task/ftask/test_ftask.c +++ b/tests/unit/app/task/ftask/test_ftask.c @@ -43,8 +43,8 @@ * @file test_ftask.c * @author foxBMS Team * @date 2020-04-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * @@ -97,9 +97,9 @@ TaskHandle_t ftsk_taskHandleAfe; #define FTSK_DATA_QUEUE_LENGTH (1u) #define FTSK_DATA_QUEUE_ITEM_SIZE (sizeof(DATA_QUEUE_MESSAGE_s)) #define FTSK_IMD_QUEUE_LENGTH (5u) -#define FTSK_IMD_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFERELEMENT_s)) +#define FTSK_IMD_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFER_ELEMENT_s)) #define FTSK_CAN_RX_QUEUE_LENGTH (50u) -#define FTSK_CAN_RX_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFERELEMENT_s)) +#define FTSK_CAN_RX_QUEUE_ITEM_SIZE (sizeof(CAN_BUFFER_ELEMENT_s)) volatile OS_BOOT_STATE_e os_boot = OS_OFF; volatile OS_TIMER_s os_timer = {0, 0, 0, 0, 0, 0, 0}; diff --git a/tests/unit/app/task/os/freertos/test_os_freertos.c b/tests/unit/app/task/os/freertos/test_os_freertos.c index ec48f5ea..76775c8f 100644 --- a/tests/unit/app/task/os/freertos/test_os_freertos.c +++ b/tests/unit/app/task/os/freertos/test_os_freertos.c @@ -43,8 +43,8 @@ * @file test_os_freertos.c * @author foxBMS Team * @date 2021-11-26 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/app/task/os/test_os.c b/tests/unit/app/task/os/test_os.c index aac4afb4..b902ec17 100644 --- a/tests/unit/app/task/os/test_os.c +++ b/tests/unit/app/task/os/test_os.c @@ -43,8 +43,8 @@ * @file test_os.c * @author foxBMS Team * @date 2020-03-13 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix OS * diff --git a/tests/unit/doxygen_tests.h b/tests/unit/doxygen_tests.h index 53169d60..04861c8d 100644 --- a/tests/unit/doxygen_tests.h +++ b/tests/unit/doxygen_tests.h @@ -43,8 +43,8 @@ * @file doxygen_tests.h * @author foxBMS Team * @date 2019-06-02 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix DX * diff --git a/tests/unit/opt/cells/config/test_lg_inr18650mj1.c b/tests/unit/opt/cells/config/test_lg_inr18650mj1.c index 5bcf90f4..35d31408 100644 --- a/tests/unit/opt/cells/config/test_lg_inr18650mj1.c +++ b/tests/unit/opt/cells/config/test_lg_inr18650mj1.c @@ -43,8 +43,8 @@ * @file test_lg_inr18650mj1.c * @author foxBMS Team * @date 2020-07-31 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/support/test_algorithm_stubs.h b/tests/unit/support/test_algorithm_stubs.h index 3e17b0c6..bc73859e 100644 --- a/tests/unit/support/test_algorithm_stubs.h +++ b/tests/unit/support/test_algorithm_stubs.h @@ -43,8 +43,8 @@ * @file test_algorithm_stubs.h * @author foxBMS Team * @date 2020-12-09 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/support/test_assert_helper.h b/tests/unit/support/test_assert_helper.h index 43a42bbd..57d98bd2 100644 --- a/tests/unit/support/test_assert_helper.h +++ b/tests/unit/support/test_assert_helper.h @@ -43,8 +43,8 @@ * @file test_assert_helper.h * @author foxBMS Team * @date 2020-07-22 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/support/test_can_mpu_prototype_queue_create_stub.h b/tests/unit/support/test_can_mpu_prototype_queue_create_stub.h index d36744f5..5c020a53 100644 --- a/tests/unit/support/test_can_mpu_prototype_queue_create_stub.h +++ b/tests/unit/support/test_can_mpu_prototype_queue_create_stub.h @@ -43,8 +43,8 @@ * @file test_can_mpu_prototype_queue_create_stub.h * @author foxBMS Team * @date 2021-06-09 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/unit/support/test_pec_helper.h b/tests/unit/support/test_pec_helper.h index ec90f63f..9651e09d 100644 --- a/tests/unit/support/test_pec_helper.h +++ b/tests/unit/support/test_pec_helper.h @@ -43,8 +43,8 @@ * @file test_pec_helper.h * @author foxBMS Team * @date 2020-12-16 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup UNIT_TEST_IMPLEMENTATION * @prefix TEST * diff --git a/tests/variants/lib-build/lib-build_main.c b/tests/variants/lib-build/lib-build_main.c index 72895abe..fee45ba6 100644 --- a/tests/variants/lib-build/lib-build_main.c +++ b/tests/variants/lib-build/lib-build_main.c @@ -43,8 +43,8 @@ * @file lib-build_main.c * @author foxBMS Team * @date 2020-10-06 (date of creation) - * @updated 2022-07-28 (date of last update) - * @version v1.4.0 + * @updated 2022-10-27 (date of last update) + * @version v1.4.1 * @ingroup GENERAL * @prefix TODO * diff --git a/tools/dbc/foxbms.dbc b/tools/dbc/foxbms.dbc index 1c92c6b3..7b37af41 100644 --- a/tools/dbc/foxbms.dbc +++ b/tools/dbc/foxbms.dbc @@ -32,24 +32,16 @@ SG_ foxBMS_inletTemperature : 39|8@0- (1,0) [-128|127] "degC" Vector__XXX SG_ foxBMS_outletTemperature : 47|8@0- (1,0) [-128|127] "degC" Vector__XXX -BO_ 640 foxBMS_StringValues: 8 Vector__XXX -SG_ foxBMS_StringValues_Mux M : 7|3@0+ (1,0) [0|0] "" Vector__XXX -SG_ foxBMS_String0_current m0 : 19|18@0- (0.01,0) [-1310.72|1310.71] "A" Vector__XXX -SG_ foxBMS_String0_voltage m0 : 4|17@0+ (0.01,0) [0|1310.71] "V" Vector__XXX -SG_ foxBMS_String0_power m0 : 33|18@0- (0.01,0) [-1310.72|1310.71] "kW" Vector__XXX -SG_ foxBMS_String1_current m1 : 19|18@0- (0.01,0) [-1310.72|1310.71] "A" Vector__XXX -SG_ foxBMS_String1_voltage m1 : 4|17@0+ (0.01,0) [0|1310.71] "V" Vector__XXX -SG_ foxBMS_String1_power m1 : 33|18@0- (0.01,0) [-1310.72|1310.71] "kW" Vector__XXX -SG_ foxBMS_String2_current m2 : 19|18@0- (0.01,0) [-1310.72|1310.71] "A" Vector__XXX -SG_ foxBMS_String2_voltage m2 : 4|17@0+ (0.01,0) [0|1310.71] "V" Vector__XXX -SG_ foxBMS_String2_power m2 : 33|18@0- (0.01,0) [-1310.72|1310.71] "kW" Vector__XXX +BO_ 640 foxBMS_StringValuesP0: 8 Vector__XXX +SG_ foxBMS_StringValuesP0_Mux M : 7|3@0+ (1,0) [0|0] "" Vector__XXX +SG_ foxBMS_String0Current : 19|18@0- (0.01,0) [-1310.72|1310.71] "A" Vector__XXX +SG_ foxBMS_String0Voltage : 4|17@0+ (0.01,0) [0|1310.71] "V" Vector__XXX +SG_ foxBMS_String0Power : 33|18@0- (0.01,0) [-1310.72|1310.71] "kW" Vector__XXX -BO_ 643 foxBMS_StringValues2: 8 Vector__XXX -SG_ foxBMS_StringValues2_Mux M : 7|4@0+ (1,0) [0|0] "" Vector__XXX -SG_ String0_energyCount m0 : 15|32@0- (1,0) [-2147483648|2147483647] "Wh" Vector__XXX -SG_ String1_energyCount m1 : 15|32@0- (1,0) [-2147483648|2147483647] "Wh" Vector__XXX -SG_ String2_energyCount m2 : 15|32@0- (1,0) [-2147483648|2147483647] "Wh" Vector__XXX +BO_ 643 foxBMS_StringValuesP1: 8 Vector__XXX +SG_ foxBMS_StringValuesP1_Mux M : 7|4@0+ (1,0) [0|0] "" Vector__XXX +SG_ foxBMS_String0EnergyCount : 15|32@0- (1,0) [-2147483648|2147483647] "Wh" Vector__XXX BO_ 549 foxBMS_PackStateEstimation: 8 Vector__XXX @@ -59,8 +51,8 @@ SG_ foxBMS_packEnergy : 47|24@0+ (0.01,0) [0|167772.15] "kWh" Vector__XXX SG_ foxBMS_packSoh : 27|12@0+ (0.025,0) [0|102.375] "%" Vector__XXX -BO_ 576 foxBMS_CellVoltage: 8 Vector__XXX -SG_ foxBMS_CellVoltage_Mux M : 7|8@0+ (1,0) [0|0] "" Vector__XXX +BO_ 576 foxBMS_CellVoltages: 8 Vector__XXX +SG_ foxBMS_CellVoltages_Mux M : 7|8@0+ (1,0) [0|0] "" Vector__XXX SG_ cellVoltage_000_invalidFlag m0 : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ cellVoltage_001_invalidFlag m0 : 13|1@0+ (1,0) [0|1] "" Vector__XXX SG_ cellVoltage_002_invalidFlag m0 : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -495,8 +487,8 @@ SG_ cellVoltage_214 m53 : 33|13@0+ (1,0) [0|8191] "mV" Vector__XXX SG_ cellVoltage_215 m53 : 52|13@0+ (1,0) [0|8191] "mV" Vector__XXX -BO_ 592 foxBMS_CellTemperature: 8 Vector__XXX -SG_ foxBMS_CellTemperature_Mux M : 7|8@0+ (1,0) [0|0] "" Vector__XXX +BO_ 592 foxBMS_CellTemperatures: 8 Vector__XXX +SG_ foxBMS_CellTemperatures_Mux M : 7|8@0+ (1,0) [0|0] "" Vector__XXX SG_ cellTemperature_000_invalidFlag m0 : 8|1@0+ (1,0) [0|1] "" Vector__XXX SG_ cellTemperature_001_invalidFlag m0 : 9|1@0+ (1,0) [0|1] "" Vector__XXX SG_ cellTemperature_002_invalidFlag m0 : 10|1@0+ (1,0) [0|1] "" Vector__XXX @@ -859,19 +851,19 @@ SG_ cellTemperature_178 m29 : 55|8@0- (1,0) [-128|127] "degC" Vector__XXX SG_ cellTemperature_179 m29 : 63|8@0- (1,0) [-128|127] "degC" Vector__XXX -BO_ 560 foxBMS_Command: 8 Vector__XXX +BO_ 560 foxBMS_BmsStateRequest: 8 Vector__XXX SG_ foxBMS_modeRequest : 1|2@0+ (1,0) [0|3] "" Vector__XXX SG_ foxBMS_activateBalancing : 8|1@0+ (1,0) [0|1] "" Vector__XXX SG_ foxBMS_balancingThreshold : 23|8@0+ (1,0) [0|255] "mV" Vector__XXX SG_ foxBMS_externallyPrecharged : 3|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_resetFlags : 2|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_chargerConnected : 4|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_disableInsulationMon : 5|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_heaterOverride_ON : 6|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_heaterOverride_OFF : 7|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_resetFlags : 2|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_chargerConnected : 4|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_disableInsulationMon : 5|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_heaterOverride_ON : 6|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_heaterOverride_OFF : 7|1@0+ (1,0) [0|1] "" Vector__XXX -BO_ 544 foxBMS_State: 8 Vector__XXX +BO_ 544 foxBMS_BmsState: 8 Vector__XXX SG_ foxBMS_State : 3|4@0+ (1,0) [0|15] "" Vector__XXX SG_ BMS_nrOfConnectedStrings : 7|4@0+ (1,0) [0|15] "" Vector__XXX SG_ foxBMS_generalError : 10|1@0+ (1,0) [0|1] "" Vector__XXX @@ -894,211 +886,88 @@ SG_ foxBMS_Error_Insulation : 23|1@0+ (1,0) [0|1] "" Vector__XXX SG_ foxBMS_Error_Cantiming : 24|1@0+ (1,0) [0|1] "" Vector__XXX SG_ foxBMS_Error_PackOvercurr_Charge : 25|1@0+ (1,0) [0|1] "" Vector__XXX SG_ foxBMS_Error_PackOvercur_Dischrg : 26|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_SysMonError : 12|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_SysMonError : 12|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_alertFlag : 27|1@0+ (1,0) [0|1] "" Vector__XXX BO_ 545 foxBMS_StringState: 8 Vector__XXX SG_ foxBMS_StringState_Mux M : 3|4@0+ (1,0) [0|0] "" Vector__XXX -SG_ String0_stringConnected m0 : 4|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_balancing_active m0 : 5|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_overtemp_charge m0 : 8|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_undertemp_charge m0 : 9|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_overtemp_discharge m0 : 10|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_undertemp_discharge m0 : 11|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_Overcurrent_charge m0 : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_Overcurre_discharge m0 : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_Overvoltage m0 : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_Undervoltage m0 : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_deep_discharge m0 : 7|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_CS_currentMeas m0 : 43|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_positiveContactor m0 : 32|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_openWire m0 : 49|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_openWireNumber m0 : 63|8@0+ (1,0) [0|255] "" Vector__XXX -SG_ String0_Err_plaus_cell_volt m0 : 52|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_plaus_cell_temp m0 : 51|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_plaus_string_volt m0 : 53|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_slave_hardware m0 : 34|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyChainBase_Comm m0 : 35|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyChainPrim_CRC m0 : 37|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyChainRedun_Comm m0 : 36|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyChainRedun_CRC m0 : 38|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyPrim_voltMeasOor m0 : 39|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyRedun_voltMeasOor m0 : 40|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyPrim_tempMeasOor m0 : 41|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_dsyRedun_tempMeasOor m0 : 42|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_CS_coulombCountMeas m0 : 44|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_CS_energyCountMeas m0 : 45|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_plaus_volt_spread m0 : 55|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_plaus_temp_spread m0 : 54|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String0_fuseBlown m0 : 6|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Warning_overvoltage_MOL m0 : 22|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Warning_undervoltage_MOL m0 : 23|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_chargeOverTemp_MOL m0 : 16|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_dischrgOverTemp_MOL m0 : 18|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_chargeUnderTemp_MOL m0 : 17|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_dischrgUnderTmp_MOL m0 : 19|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_chargeOverCur_MOL m0 : 20|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_dischargOverCur_MOL m0 : 21|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_chargeOverTemp_RSL m0 : 24|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_chargeUnderTemp_RSL m0 : 25|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_dischrgOverTemp_RSL m0 : 26|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_dischrgUnderTmp_RSL m0 : 27|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_chargeOverCur_RSL m0 : 28|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_dischargOverCur_RSL m0 : 29|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_overvoltage_RSL m0 : 30|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Wrng_undervoltage_RSL m0 : 31|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_negativeContactor m0 : 33|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_CS_voltage1Meas m0 : 46|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_CS_voltage2Meas m0 : 47|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String0_Err_CS_voltage3Meas m0 : 48|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_stringConnected m1 : 4|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_balancing_active m1 : 5|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_overtemp_charge m1 : 8|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_undertemp_charge m1 : 9|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_overtemp_discharge m1 : 10|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_undertemp_discharge m1 : 11|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_Overcurrent_charge m1 : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_Overcurre_discharge m1 : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_Overvoltage m1 : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_Undervoltage m1 : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_deep_discharge m1 : 7|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_CS_currentMeas m1 : 43|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_positiveContactor m1 : 32|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_openWire m1 : 49|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_openWireNumber m1 : 63|8@0+ (1,0) [0|255] "" Vector__XXX -SG_ String1_Err_plaus_cell_volt m1 : 52|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_plaus_cell_temp m1 : 51|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_plaus_string_volt m1 : 53|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_slave_hardware m1 : 34|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyChainPrim_Comm m1 : 35|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyChainPrim_CRC m1 : 37|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyChainRedun_Comm m1 : 36|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyChainRedun_CRC m1 : 38|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyPrim_voltMeasOor m1 : 39|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyRedun_voltMeasOor m1 : 40|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyPrim_tempMeasOor m1 : 41|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_dsyRedun_tempMeasOor m1 : 42|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_CS_coulombCountMeas m1 : 44|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_CS_energyCountMeas m1 : 45|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_plaus_volt_spread m1 : 55|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_plaus_temp_spread m1 : 54|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String1_fuseBlown m1 : 6|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Warning_overvoltage_MOL m1 : 22|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Warning_undervoltage_MOL m1 : 23|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_chargeOverTemp_MOL m1 : 16|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_dischrgOverTemp_MOL m1 : 18|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_chargeUnderTemp_MOL m1 : 17|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_dischrgUnderTmp_MOL m1 : 19|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_chargeOverCur_MOL m1 : 20|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_dischargOverCur_MOL m1 : 21|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_chargeOverTemp_RSL m1 : 24|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_chargeUnderTemp_RSL m1 : 25|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_dischrgOverTemp_RSL m1 : 26|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_dischrgUnderTmp_RSL m1 : 27|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_chargeOverCur_RSL m1 : 28|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_dischargOverCur_RSL m1 : 29|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_overvoltage_RSL m1 : 30|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Wrng_undervoltage_RSL m1 : 31|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_negativeContactor m1 : 33|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_CS_voltage1Meas m1 : 46|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_CS_voltage2Meas m1 : 47|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String1_Err_CS_voltage3Meas m1 : 48|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_stringConnected m2 : 4|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_balancing_active m2 : 5|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_overtemp_charge m2 : 8|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_undertemp_charge m2 : 9|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_overtemp_discharge m2 : 10|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_undertemp_discharge m2 : 11|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_Overcurrent_charge m2 : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_Overcurre_discharge m2 : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_Overvoltage m2 : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_Undervoltage m2 : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_deep_discharge m2 : 7|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_CS_currentMeas m2 : 43|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_positiveContactor m2 : 32|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_openWire m2 : 49|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_openWireNumber m2 : 63|8@0+ (1,0) [0|255] "" Vector__XXX -SG_ String2_Err_plaus_cell_volt m2 : 52|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_plaus_cell_temp m2 : 51|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_plaus_string_volt m2 : 53|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_slave_hardware m2 : 34|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyChainPrim_Comm m2 : 35|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyChainPrim_CRC m2 : 37|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyChainRedun_Comm m2 : 36|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyChainRedun_CRC m2 : 38|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyPrim_voltMeasOor m2 : 39|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyRedun_voltMeasOor m2 : 40|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyPrim_tempMeasOor m2 : 41|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_dsyRedun_tempMeasOor m2 : 42|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_CS_coulombCountMeas m2 : 44|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_CS_energyCountMeas m2 : 45|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_plaus_volt_spread m2 : 55|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_plaus_temp_spread m2 : 54|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ String2_fuseBlown m2 : 6|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Warning_overvoltage_MOL m2 : 22|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Warning_undervoltage_MOL m2 : 23|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_chargeOverTemp_MOL m2 : 16|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_dischrgOverTemp_MOL m2 : 18|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_chargeUnderTemp_MOL m2 : 17|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_dischrgUnderTmp_MOL m2 : 19|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_chargeOverCur_MOL m2 : 20|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_dischargOverCur_MOL m2 : 21|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_chargeOverTemp_RSL m2 : 24|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_chargeUnderTemp_RSL m2 : 25|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_dischrgOverTemp_RSL m2 : 26|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_dischrgUnderTmp_RSL m2 : 27|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_chargeOverCur_RSL m2 : 28|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_dischargOverCur_RSL m2 : 29|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_overvoltage_RSL m2 : 30|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Wrng_undervoltage_RSL m2 : 31|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_negativeContactor m2 : 33|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_CS_voltage1Meas m2 : 46|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_CS_voltage2Meas m2 : 47|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ String2_Err_CS_voltage3Meas m2 : 48|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ String0_stringConnected : 4|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_balancing_active : 5|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_overtemp_charge : 8|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_undertemp_charge : 9|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_overtemp_discharge : 10|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_undertemp_discharge : 11|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_Overcurrent_charge : 12|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_Overcurre_discharge : 13|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_Overvoltage : 14|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_Undervoltage : 15|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_deep_discharge : 7|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_CS_currentMeas : 43|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_positiveContactor : 32|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_openWire : 49|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_openWireNumber : 63|8@0+ (1,0) [0|255] "" Vector__XXX +SG_ String0_Err_plaus_cell_volt : 52|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_plaus_cell_temp : 51|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_plaus_string_volt : 53|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_slave_hardware : 34|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyChainBase_Comm : 35|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyChainPrim_CRC : 37|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyChainRedun_Comm : 36|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyChainRedun_CRC : 38|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyPrim_voltMeasOor : 39|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyRedun_voltMeasOor : 40|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyPrim_tempMeasOor : 41|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_dsyRedun_tempMeasOor : 42|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_CS_coulombCountMeas : 44|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_CS_energyCountMeas : 45|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_plaus_volt_spread : 55|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_plaus_temp_spread : 54|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_fuseBlown : 6|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Warning_overvoltage_MOL : 22|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Warning_undervoltage_MOL : 23|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_chargeOverTemp_MOL : 16|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_dischrgOverTemp_MOL : 18|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_chargeUnderTemp_MOL : 17|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_dischrgUnderTmp_MOL : 19|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_chargeOverCur_MOL : 20|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_dischargOverCur_MOL : 21|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_chargeOverTemp_RSL : 24|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_chargeUnderTemp_RSL : 25|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_dischrgOverTemp_RSL : 26|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_dischrgUnderTmp_RSL : 27|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_chargeOverCur_RSL : 28|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_dischargOverCur_RSL : 29|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_overvoltage_RSL : 30|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Wrng_undervoltage_RSL : 31|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_negativeContactor : 33|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_CS_voltage1Meas : 46|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_CS_voltage2Meas : 47|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ String0_Err_CS_voltage3Meas : 48|1@0+ (1,0) [0|1] "" Vector__XXX BO_ 641 foxBMS_StringMinMaxValues: 8 Vector__XXX SG_ foxBMS_StringMinMaxValues_Mux M : 3|4@0+ (1,0) [0|0] "" Vector__XXX -SG_ String0_minimumCellVoltage m0 : 18|13@0+ (1,0) [0|8191] "mV" Vector__XXX -SG_ String0_maximumCellVoltage m0 : 15|13@0+ (1,0) [0|8191] "mV" Vector__XXX -SG_ String0_maximumCellTemperature m0 : 37|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX -SG_ String0_minimumCellTemperature m0 : 44|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX -SG_ String1_minimumCellVoltage m1 : 18|13@0+ (1,0) [0|8191] "mV" Vector__XXX -SG_ String1_maximumCellVoltage m1 : 15|13@0+ (1,0) [0|8191] "mV" Vector__XXX -SG_ String1_maximumCellTemperature m1 : 37|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX -SG_ String1_minimumCellTemperature m1 : 44|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX -SG_ String2_minimumCellVoltage m2 : 18|13@0+ (1,0) [0|8191] "mV" Vector__XXX -SG_ String2_maximumCellVoltage m2 : 15|13@0+ (1,0) [0|8191] "mV" Vector__XXX -SG_ String2_maximumCellTemperature m2 : 37|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX -SG_ String2_minimumCellTemperature m2 : 44|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX +SG_ String0_minimumCellVoltage : 18|13@0+ (1,0) [0|8191] "mV" Vector__XXX +SG_ String0_maximumCellVoltage : 15|13@0+ (1,0) [0|8191] "mV" Vector__XXX +SG_ String0_maximumCellTemperature : 37|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX +SG_ String0_minimumCellTemperature : 44|9@0- (0.5,0) [-128|127.5] "degC" Vector__XXX BO_ 642 foxBMS_StringStateEstimation: 8 Vector__XXX SG_ foxBMS_StringStateEstimation_Mux M : 7|4@0+ (1,0) [0|0] "" Vector__XXX -SG_ String0_minimumSOC m0 : 3|9@0+ (0.25,0) [0|127.75] "%" Vector__XXX -SG_ String0_averageSOC m0 : 10|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String0_maximumSOC m0 : 17|9@0+ (0.25,0) [0|63.75] "%" Vector__XXX -SG_ String0_SOE m0 : 24|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String0_Energy_kWh m0 : 54|15@0+ (0.01,0) [0|327.67] "kWh" Vector__XXX -SG_ String0_SOH m0 : 47|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String1_minimumSOC m1 : 3|9@0+ (0.25,0) [0|127.75] "%" Vector__XXX -SG_ String1_averageSOC m1 : 10|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String1_maximumSOC m1 : 17|9@0+ (0.25,0) [0|63.75] "%" Vector__XXX -SG_ String1_SOE m1 : 24|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String1_Energy_kWh m1 : 54|15@0+ (0.01,0) [0|327.67] "kWh" Vector__XXX -SG_ String1_SOH m1 : 47|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String2_minimumSOC m2 : 3|9@0+ (0.25,0) [0|127.75] "%" Vector__XXX -SG_ String2_averageSOC m2 : 10|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String2_maximumSOC m2 : 17|9@0+ (0.25,0) [0|63.75] "%" Vector__XXX -SG_ String2_SOE m2 : 24|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX -SG_ String2_Energy_kWh m2 : 54|15@0+ (0.01,0) [0|327.67] "kWh" Vector__XXX -SG_ String2_SOH m2 : 47|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX +SG_ String0_minimumSOC : 3|9@0+ (0.25,0) [0|127.75] "%" Vector__XXX +SG_ String0_averageSOC : 10|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX +SG_ String0_maximumSOC : 17|9@0+ (0.25,0) [0|63.75] "%" Vector__XXX +SG_ String0_SOE : 24|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX +SG_ String0_Energy_kWh : 54|15@0+ (0.01,0) [0|327.67] "kWh" Vector__XXX +SG_ String0_SOH : 47|9@0+ (0.25,0) [0|127.5] "%" Vector__XXX BO_ 512 foxBMS_Debug: 8 Vector__XXX -BO_ 1313 IVT0_Msg_Result_I: 6 Vector__XXX +BO_ 1313 foxBMS_String0Current: 6 Vector__XXX SG_ IVT0_Result_I_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_I_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_I_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1108,7 +977,7 @@ SG_ IVT0_MsgCount_Result_I : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_Result_I_mA : 23|32@0- (1,0) [-2147483648|2147483647] "mA" Vector__XXX -BO_ 1314 IVT0_Msg_Result_U1: 6 Vector__XXX +BO_ 1314 foxBMS_String0Voltage1: 6 Vector__XXX SG_ IVT0_Result_U1_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_U1_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_U1_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1118,7 +987,7 @@ SG_ IVT0_MsgCount_Result_U1 : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_Result_U1_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX -BO_ 1315 IVT0_Msg_Result_U2: 6 Vector__XXX +BO_ 1315 foxBMS_String0Voltage2: 6 Vector__XXX SG_ IVT0_Result_U2_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_U2_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_U2_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1128,7 +997,7 @@ SG_ IVT0_MsgCount_Result_U2 : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_Result_U2_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX -BO_ 1316 IVT0_Msg_Result_U3: 6 Vector__XXX +BO_ 1316 foxBMS_String0Voltage3: 6 Vector__XXX SG_ IVT0_Result_U3_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_U3_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_U3_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1138,7 +1007,7 @@ SG_ IVT0_MsgCount_Result_U3 : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_Result_U3_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX -BO_ 1317 IVT0_Msg_Result_T: 6 Vector__XXX +BO_ 1317 foxBMS_String0Temperature: 6 Vector__XXX SG_ IVT0_Result_T_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_T_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_T_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1148,7 +1017,7 @@ SG_ IVT0_MsgCount_Result_T : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_Result_T_ddegC : 23|32@0- (0.1,0) [-214748364.8|214748364.7] "ddegC" Vector__XXX -BO_ 1318 IVT0_Msg_Result_W: 6 Vector__XXX +BO_ 1318 foxBMS_String0Power: 6 Vector__XXX SG_ IVT0_Result_W_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_W_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_W_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1158,7 +1027,7 @@ SG_ IVT0_MsgCount_Result_W : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_ID_Result_W : 7|8@0+ (1,0) [5|5] "" Vector__XXX -BO_ 1319 IVT0_Msg_Result_As: 6 Vector__XXX +BO_ 1319 foxBMS_String0CurrentCounter: 6 Vector__XXX SG_ IVT0_Result_As_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_As_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_As_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1168,7 +1037,7 @@ SG_ IVT0_MsgCount_Result_As : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_ID_Result_As : 7|8@0+ (1,0) [6|6] "" Vector__XXX -BO_ 1320 IVT0_Msg_Result_Wh: 6 Vector__XXX +BO_ 1320 foxBMS_String0EnergyCounter: 6 Vector__XXX SG_ IVT0_Result_Wh_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_Wh_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX SG_ IVT0_Result_Wh_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX @@ -1178,188 +1047,28 @@ SG_ IVT0_MsgCount_Result_Wh : 11|4@0+ (1,0) [0|15] "" Vector__XXX SG_ IVT0_ID_Result_Wh : 7|8@0+ (1,0) [7|7] "" Vector__XXX -BO_ 1569 IVT1_Msg_Result_I: 6 Vector__XXX -SG_ IVT1_Result_I_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_I_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_I_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_I_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_ID_Result_I : 7|8@0+ (1,0) [0|255] "" Vector__XXX -SG_ IVT1_MsgCount_Result_I : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_Result_I_mA : 23|32@0- (1,0) [-2147483648|2147483647] "mA" Vector__XXX - - -BO_ 1570 IVT1_Msg_Result_U1: 6 Vector__XXX -SG_ IVT1_Result_U1_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U1_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U1_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U1_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_ID_Result_U1 : 7|8@0+ (1,0) [1|1] "" Vector__XXX -SG_ IVT1_MsgCount_Result_U1 : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_Result_U1_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX - - -BO_ 1571 IVT1_Msg_Result_U2: 6 Vector__XXX -SG_ IVT1_Result_U2_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U2_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U2_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U2_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_ID_Result_U2 : 7|8@0+ (1,0) [2|2] "" Vector__XXX -SG_ IVT1_MsgCount_Result_U2 : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_Result_U2_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX - - -BO_ 1572 IVT1_Msg_Result_U3: 6 Vector__XXX -SG_ IVT1_Result_U3_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U3_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U3_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_U3_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_ID_Result_U3 : 7|8@0+ (1,0) [3|3] "" Vector__XXX -SG_ IVT1_MsgCount_Result_U3 : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_Result_U3_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX - - -BO_ 1573 IVT1_Msg_Result_T: 6 Vector__XXX -SG_ IVT1_Result_T_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_T_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_T_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_T_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_ID_Result_T : 7|8@0+ (1,0) [4|4] "" Vector__XXX -SG_ IVT1_MsgCount_Result_T : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_Result_T_ddegC : 23|32@0- (0.1,0) [-214748364.8|214748364.7] "ddegC" Vector__XXX - - -BO_ 1574 IVT1_Msg_Result_W: 6 Vector__XXX -SG_ IVT1_Result_W_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_W_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_W_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_W_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_W : 23|32@0- (1,0) [-2147483648|2147483647] "W" Vector__XXX -SG_ IVT1_MsgCount_Result_W : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_ID_Result_W : 7|8@0+ (1,0) [5|5] "" Vector__XXX - - -BO_ 1575 IVT1_Msg_Result_As: 6 Vector__XXX -SG_ IVT1_Result_As_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_As_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_As_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_As_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_As : 23|32@0- (1,0) [-2147483648|2147483647] "As" Vector__XXX -SG_ IVT1_MsgCount_Result_As : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_ID_Result_As : 7|8@0+ (1,0) [6|6] "" Vector__XXX - - -BO_ 1576 IVT1_Msg_Result_Wh: 6 Vector__XXX -SG_ IVT1_Result_Wh_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_Wh_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_Wh_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_Wh_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT1_Result_Wh : 23|32@0- (1,0) [-2147483648|2147483647] "Wh" Vector__XXX -SG_ IVT1_MsgCount_Result_Wh : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT1_ID_Result_Wh : 7|8@0+ (1,0) [7|7] "" Vector__XXX - - -BO_ 1825 IVT2_Msg_Result_I: 6 Vector__XXX -SG_ IVT2_Result_I_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_I_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_I_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_I_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_ID_Result_I : 7|8@0+ (1,0) [0|255] "" Vector__XXX -SG_ IVT2_MsgCount_Result_I : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_Result_I_mA : 23|32@0- (1,0) [-2147483648|2147483647] "mA" Vector__XXX - - -BO_ 1826 IVT2_Msg_Result_U1: 6 Vector__XXX -SG_ IVT2_Result_U1_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U1_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U1_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U1_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_ID_Result_U1 : 7|8@0+ (1,0) [1|1] "" Vector__XXX -SG_ IVT2_MsgCount_Result_U1 : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_Result_U1_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX - - -BO_ 1827 IVT2_Msg_Result_U2: 6 Vector__XXX -SG_ IVT2_Result_U2_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U2_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U2_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U2_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_ID_Result_U2 : 7|8@0+ (1,0) [2|2] "" Vector__XXX -SG_ IVT2_MsgCount_Result_U2 : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_Result_U2_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX - - -BO_ 1828 IVT2_Msg_Result_U3: 6 Vector__XXX -SG_ IVT2_Result_U3_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U3_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U3_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_U3_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_ID_Result_U3 : 7|8@0+ (1,0) [3|3] "" Vector__XXX -SG_ IVT2_MsgCount_Result_U3 : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_Result_U3_mV : 23|32@0- (1,0) [-2147483648|2147483647] "mV" Vector__XXX - - -BO_ 1829 IVT2_Msg_Result_T: 6 Vector__XXX -SG_ IVT2_Result_T_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_T_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_T_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_T_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_ID_Result_T : 7|8@0+ (1,0) [4|4] "" Vector__XXX -SG_ IVT2_MsgCount_Result_T : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_Result_T_ddegC : 23|32@0- (0.1,0) [-214748364.8|214748364.7] "ddegC" Vector__XXX - - -BO_ 1830 IVT2_Msg_Result_W: 6 Vector__XXX -SG_ IVT2_Result_W_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_W_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_W_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_W_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_W : 23|32@0- (1,0) [-2147483648|2147483647] "W" Vector__XXX -SG_ IVT2_MsgCount_Result_W : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_ID_Result_W : 7|8@0+ (1,0) [5|5] "" Vector__XXX - - -BO_ 1831 IVT2_Msg_Result_As: 6 Vector__XXX -SG_ IVT2_Result_As_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_As_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_As_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_As_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_As : 23|32@0- (1,0) [-2147483648|2147483647] "As" Vector__XXX -SG_ IVT2_MsgCount_Result_As : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_ID_Result_As : 7|8@0+ (1,0) [6|6] "" Vector__XXX - - -BO_ 1832 IVT2_Msg_Result_Wh: 6 Vector__XXX -SG_ IVT2_Result_Wh_systemError : 15|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_Wh_OCS : 12|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_Wh_overallMeasError : 14|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_Wh_channelMeasError : 13|1@0+ (1,0) [0|1] "" Vector__XXX -SG_ IVT2_Result_Wh : 23|32@0- (1,0) [-2147483648|2147483647] "Wh" Vector__XXX -SG_ IVT2_MsgCount_Result_Wh : 11|4@0+ (1,0) [0|15] "" Vector__XXX -SG_ IVT2_ID_Result_Wh : 7|8@0+ (1,0) [7|7] "" Vector__XXX - - -BO_ 409 foxBMS_Startup: 8 Vector__XXX +BO_ 409 foxBMS_Boot: 8 Vector__XXX SG_ foxBMS_majorVersionNumber : 7|8@0+ (1,0) [0|255] "" Vector__XXX SG_ foxBMS_minorVersionNumber : 15|8@0+ (1,0) [0|255] "" Vector__XXX SG_ foxBMS_patchVersionNumber : 23|8@0+ (1,0) [0|255] "" Vector__XXX SG_ foxBMS_uniqueId : 39|32@0+ (1,0) [0|4294967295] "" Vector__XXX -SG_ foxBMS_underVersionControl : 24|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_dirtyFlag : 25|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_underVersionControl : 24|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_dirtyFlag : 25|1@0+ (1,0) [0|1] "" Vector__XXX SG_ foxBMS_releaseDistance : 31|5@0+ (1,0) [0|31] "" Vector__XXX -SG_ foxBMS_releaseDistanceOverflow : 26|1@1+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_releaseDistanceOverflow : 26|1@0+ (1,0) [0|1] "" Vector__XXX -BO_ 550 foxBMS_DetailState: 8 Vector__XXX -SG_ foxBMS_TimingViolationEngine : 0|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation1ms : 1|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation10ms : 2|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation100ms : 3|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation100msAlgo : 4|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation10msRec : 10|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation100msRec : 11|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation100msAlgoR : 12|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolationEngineRec : 8|1@1+ (1,0) [0|1] "" Vector__XXX -SG_ foxBMS_TimingViolation1msRec : 9|1@1+ (1,0) [0|1] "" Vector__XXX +BO_ 550 foxBMS_BmsStateDetails: 8 Vector__XXX +SG_ foxBMS_TimingViolationEngine : 0|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation1ms : 1|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation10ms : 2|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation100ms : 3|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation100msAlgo : 4|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation10msRec : 10|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation100msRec : 11|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation100msAlgoR : 12|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolationEngineRec : 8|1@0+ (1,0) [0|1] "" Vector__XXX +SG_ foxBMS_TimingViolation1msRec : 9|1@0+ (1,0) [0|1] "" Vector__XXX BO_ 551 foxBMS_DieId: 8 Vector__XXX @@ -1369,31 +1078,29 @@ SG_ MCU_xWaferCoordinate : 51|12@0+ (1,0) [0|1] "" Vector__XXX SG_ MCU_yWaferCoordinate : 47|12@0+ (1,0) [0|1] "" Vector__XXX -CM_ BO_ 546 "(in:can_cbs_tx_system_values.c:CAN_TxPackValues)"; +CM_ BO_ 546 "(in:can_cbs_tx_system-values.c:CANTX_PackValues, fv:tx)"; CM_ SG_ 546 foxBMS_packCurrent "Battery pack current"; CM_ SG_ 546 foxBMS_batteryVoltage "Battery voltage between negative and positive pole of the battery"; CM_ SG_ 546 foxBMS_busVoltage "Battery voltage between negative pole and after main positive contactor"; CM_ SG_ 546 foxBMS_packPower "Battery power"; -CM_ BO_ 548 "(in:can_cbs_tx_limits.c:CAN_TxLimitValues)"; +CM_ BO_ 548 "(in:can_cbs_tx_limit-values.c:CANTX_LimitValues, fv:tx)"; CM_ SG_ 548 foxBMS_maxChargeCurrent "Maximum battery pack charge current"; CM_ SG_ 548 foxBMS_maxDischargeCurrent "Maximum battery pack discharge current"; -CM_ BO_ 547 "(in:can_cbs_tx_minmax.c:CAN_TxMinimumMaximumValues)"; +CM_ BO_ 547 "(in:can_cbs_tx_minimum-maximum-values.c:CANTX_MinimumMaximumValues, fv:tx)"; CM_ SG_ 547 foxBMS_minimumCellVoltage "Minimum cell voltage of all connected strings, if no string connected maximum value of whole system is transmitted"; CM_ SG_ 547 foxBMS_maximumCellVoltage "Maximum cell voltage of all connected strings, if no string connected maximum value of whole system is transmitted"; CM_ SG_ 547 foxBMS_maximumCellTemp "Maximum cell temperature of all connected strings, if no string connected maximum value of whole system is transmitted"; CM_ SG_ 547 foxBMS_minimumCellTemp "Minium cell temperature of all connected string, if no string connected maximum value of whole system is transmitted"; -CM_ BO_ 640 "Message contains string voltage, current and power (in:can_cbs_tx_system_values.c:CAN_TxStringValues)"; -CM_ BO_ 643 "Message contains energy counting value (in:can_cbs_tx_system_values.c:CAN_TxStringValues2)"; -CM_ SG_ 643 String0_energyCount "Current sensor string 0 energy counting value"; -CM_ SG_ 643 String1_energyCount "Current sensor string 1 energy counting value"; -CM_ SG_ 643 String2_energyCount "Current sensor string 2 energy counting value"; -CM_ BO_ 549 "(in:can_cbs_tx_state_estimation.c:CAN_TxStateEstimation)"; +CM_ BO_ 640 "Message contains string voltage, current and power (in:can_cbs_tx_system-values.c:CANTX_StringValuesP0, fv:tx)"; +CM_ BO_ 643 "Message contains energy counting value (in:can_cbs_tx_system-values.c:CANTX_StringValuesP1, fv:tx)"; +CM_ SG_ 643 foxBMS_String0EnergyCount "Current sensor string 0 energy counting value"; +CM_ BO_ 549 "(in:can_cbs_tx_pack-state-estimation.c:CANTX_PackStateEstimation, fv:tx)"; CM_ SG_ 549 foxBMS_packSoc "SOC currently connected to HV bus (100% if all strings connected and all strings at 100%)"; CM_ SG_ 549 foxBMS_packSoe "SOE currently connected to HV bus (100% if all strings connected and all strings at 100%)"; CM_ SG_ 549 foxBMS_packEnergy "Energy left in Wh that is currently connected to HV bus"; -CM_ BO_ 576 "(in:can_cbs_tx_voltage.c:CAN_TxVoltage)"; -CM_ BO_ 592 "(in:can_cbs_tx_temperature.c:CAN_TxCellTemperature)"; -CM_ BO_ 560 "(in:can_cbs_rx_command.c:CAN_RxRequest)"; +CM_ BO_ 576 "(in:can_cbs_tx_cell-voltages.c:CANTX_CellVoltages, fv:tx)"; +CM_ BO_ 592 "(in:can_cbs_tx_cell-temperatures.c:CANTX_CellTemperatures, fv:tx)"; +CM_ BO_ 560 "(in:can_cbs_rx_state-request.c:CANRX_BmsStateRequest, fv:rx)"; CM_ SG_ 560 foxBMS_modeRequest "0x0: Disconnect strings from HV bus, 0x01: Connect strings to HV bus to start discharge, 0x02: Connect strings to HV bus to start charging"; CM_ SG_ 560 foxBMS_activateBalancing "0: Deactivate balancing, 1: Activate balancing"; CM_ SG_ 560 foxBMS_balancingThreshold "Required voltage difference to minimum cell voltage to activate balancing"; @@ -1403,7 +1110,7 @@ CM_ SG_ 560 foxBMS_chargerConnected "0x00: charger not connected, 0x01: charger CM_ SG_ 560 foxBMS_disableInsulationMon "0x00: Check battery system insulation, 0x01: Do not check insulation of battery system"; CM_ SG_ 560 foxBMS_heaterOverride_ON "0: no override active, 1: override active -> force heater on"; CM_ SG_ 560 foxBMS_heaterOverride_OFF "0: no override active, 1: override active -> force heater off"; -CM_ BO_ 544 "Message contains foxBMS state (in:can_cbs_tx_state.c:CAN_TxState)"; +CM_ BO_ 544 "Message contains foxBMS state (in:can_cbs_tx_state.c:CANTX_BmsState, fv:tx)"; CM_ SG_ 544 foxBMS_generalError "0x00: No error detected, 0x01: Error detected"; CM_ SG_ 544 foxBMS_generalWarning "0x00: No warning detected, 0x01: Warning detected"; CM_ SG_ 544 foxBMS_Error_dieTemperatureMCU "0x00: No error, 0x01: Error detected"; @@ -1423,7 +1130,8 @@ CM_ SG_ 544 foxBMS_Error_Cantiming "0x00: No error, 0x01: Error detected"; CM_ SG_ 544 foxBMS_Error_PackOvercurr_Charge "0x00: No error, 0x01: Error detected"; CM_ SG_ 544 foxBMS_Error_PackOvercur_Dischrg "0x00: No error, 0x01: Error detected"; CM_ SG_ 544 foxBMS_SysMonError "If this bit is set, it indicates that a task has violated its timing requirements."; -CM_ BO_ 545 "Message contains string related error and warning flags (in:can_cbs_tx_state.c:CAN_TxStringState)"; +CM_ SG_ 544 foxBMS_alertFlag "foxBMS Alter flag: 0x00: No error, 0x01: Alert flag set"; +CM_ BO_ 545 "Message contains string related error and warning flags (in:can_cbs_tx_state.c:CANTX_StringState, fv:tx)"; CM_ SG_ 545 String0_stringConnected "0x00: String not connected, 0x01: String connected to HV bus"; CM_ SG_ 545 String0_balancing_active "0x00: No balancing active, 0x01: Balancing in this string active"; CM_ SG_ 545 String0_Err_overtemp_charge "0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius."; @@ -1455,116 +1163,26 @@ CM_ SG_ 545 String0_Err_CS_coulombCountMeas "0x00: No error, 0x01: Error"; CM_ SG_ 545 String0_Err_CS_energyCountMeas "0x00: No error, 0x01: Error"; CM_ SG_ 545 String0_Err_plaus_volt_spread "0x00: No error, 0x01: Error"; CM_ SG_ 545 String0_Err_plaus_temp_spread "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_stringConnected "0x00: String not connected, 0x01: String connected to HV bus"; -CM_ SG_ 545 String1_balancing_active "0x00: No balancing active, 0x01: Balancing in this string active"; -CM_ SG_ 545 String1_Err_overtemp_charge "0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius."; -CM_ SG_ 545 String1_Err_undertemp_charge "0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below 0 degree celsius."; -CM_ SG_ 545 String1_Err_overtemp_discharge "0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 60 degree celsius."; -CM_ SG_ 545 String1_Err_undertemp_discharge "0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below -20 degree celsius."; -CM_ SG_ 545 String1_Err_Overcurrent_charge "0x00: No error, 0x01: Error: Flag will be set if string charge current is above 30400mA."; -CM_ SG_ 545 String1_Err_Overcurre_discharge "0x00: No error, 0x01: Error: Flag will be set if discharge current is above maximum string current."; -CM_ SG_ 545 String1_Err_Overvoltage "0x00: No error, 0x01: Error: Flag will be set if maximum cell voltage is above 4200mV."; -CM_ SG_ 545 String1_Err_Undervoltage "0x00: No error, 0x01: Error: Flag will be set if minimum cell voltage is below 3000mV. This equals roughly 4% remaining SOC. Minimum data sheet values if 2500mV."; -CM_ SG_ 545 String1_Err_deep_discharge "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_CS_currentMeas "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_positiveContactor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_openWire "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_openWireNumber "Number of first open wire that has been detected in this string"; -CM_ SG_ 545 String1_Err_plaus_cell_volt "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_plaus_cell_temp "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_plaus_string_volt "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_slave_hardware "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyChainPrim_Comm "0x00: No error, 0x01: Error (i.e. SPI)"; -CM_ SG_ 545 String1_Err_dsyChainPrim_CRC "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyChainRedun_Comm "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyChainRedun_CRC "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyPrim_voltMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyRedun_voltMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyPrim_tempMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_dsyRedun_tempMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_CS_coulombCountMeas "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_CS_energyCountMeas "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_plaus_volt_spread "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String1_Err_plaus_temp_spread "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_stringConnected "0x00: String not connected, 0x01: String connected to HV bus"; -CM_ SG_ 545 String2_balancing_active "0x00: No balancing active, 0x01: Balancing in this string active"; -CM_ SG_ 545 String2_Err_overtemp_charge "0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius."; -CM_ SG_ 545 String2_Err_undertemp_charge "0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below 0 degree celsius."; -CM_ SG_ 545 String2_Err_overtemp_discharge "0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 60 degree celsius."; -CM_ SG_ 545 String2_Err_undertemp_discharge "0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below -20 degree celsius."; -CM_ SG_ 545 String2_Err_Overcurrent_charge "0x00: No error, 0x01: Error: Flag will be set if string charge current is above 30400mA."; -CM_ SG_ 545 String2_Err_Overcurre_discharge "0x00: No error, 0x01: Error: Flag will be set if discharge current is above maximum string current."; -CM_ SG_ 545 String2_Err_Overvoltage "0x00: No error, 0x01: Error: Flag will be set if maximum cell voltage is above 4200mV."; -CM_ SG_ 545 String2_Err_Undervoltage "0x00: No error, 0x01: Error: Flag will be set if minimum cell voltage is below 3000mV. This equals roughly 4% remaining SOC. Minimum data sheet values if 2500mV."; -CM_ SG_ 545 String2_Err_deep_discharge "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_CS_currentMeas "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_positiveContactor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_openWire "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_openWireNumber "Number of first open wire that has been detected in this string"; -CM_ SG_ 545 String2_Err_plaus_cell_volt "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_plaus_cell_temp "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_plaus_string_volt "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_slave_hardware "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyChainPrim_Comm "0x00: No error, 0x01: Error (i.e. SPI)"; -CM_ SG_ 545 String2_Err_dsyChainPrim_CRC "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyChainRedun_Comm "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyChainRedun_CRC "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyPrim_voltMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyRedun_voltMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyPrim_tempMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_dsyRedun_tempMeasOor "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_CS_coulombCountMeas "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_CS_energyCountMeas "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_plaus_volt_spread "0x00: No error, 0x01: Error"; -CM_ SG_ 545 String2_Err_plaus_temp_spread "0x00: No error, 0x01: Error"; -CM_ BO_ 641 "Message contains minimum and maximum cell temperature and cell voltage values of respective string (in:can_cbs_tx_minmax.c:CAN_TxStringMinimumMaximumValues)"; +CM_ BO_ 641 "Message contains minimum and maximum cell temperature and cell voltage values of respective string (in:can_cbs_tx_minimum-maximum-values.c:CANTX_StringMinimumMaximumValues, fv:tx)"; CM_ SG_ 641 String0_minimumCellVoltage "Minimum cell voltage in this string"; CM_ SG_ 641 String0_maximumCellVoltage "Maximum cell voltage in this string"; CM_ SG_ 641 String0_maximumCellTemperature "Maximum cell temperature in this string"; CM_ SG_ 641 String0_minimumCellTemperature "Minium cell temperature in this string"; -CM_ SG_ 641 String1_minimumCellVoltage "Minimum cell voltage in this string"; -CM_ SG_ 641 String1_maximumCellVoltage "Maximum cell voltage in this string"; -CM_ SG_ 641 String1_maximumCellTemperature "Maximum cell temperature in this string"; -CM_ SG_ 641 String1_minimumCellTemperature "Minium cell temperature in this string"; -CM_ SG_ 641 String2_minimumCellVoltage "Minimum cell voltage in this string"; -CM_ SG_ 641 String2_maximumCellVoltage "Maximum cell voltage in this string"; -CM_ SG_ 641 String2_maximumCellTemperature "Maximum cell temperature in this string"; -CM_ SG_ 641 String2_minimumCellTemperature "Minium cell temperature in this string"; -CM_ BO_ 642 "Message contains SOC, SOE and SOH state estimations (in:can_cbs_tx_state_estimation.c:CAN_TxStringStateEstimation)"; +CM_ BO_ 642 "Message contains SOC, SOE and SOH state estimations (in:can_cbs_tx_string-state-estimation.c:CANTX_StringStateEstimation, fv:tx)"; CM_ SG_ 642 String0_SOE "SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min"; CM_ SG_ 642 String0_Energy_kWh "Remaining energy left in this string"; -CM_ SG_ 642 String1_SOE "SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min"; -CM_ SG_ 642 String1_Energy_kWh "Remaining energy left in this string"; -CM_ SG_ 642 String2_SOE "SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min"; -CM_ SG_ 642 String2_Energy_kWh "Remaining energy left in this string"; -CM_ BO_ 512 "Reserved - for debug/development purpose only (in:can_cbs_rx_misc.c:CAN_RxDebug)"; -CM_ BO_ 1313 "Current sensor string 0: current (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1314 "Current sensor string 0: voltage 1 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1315 "Current sensor string 0: voltage 2 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1316 "Current sensor string 0: voltage 3 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1317 "Current sensor string 0: temperature (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1318 "Current sensor string 0: power (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1319 "Current sensor string 0: coulomb counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1320 "Current sensor string 0: energy counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1569 "Current sensor string 1: current (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1570 "Current sensor string 1: voltage 1 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1571 "Current sensor string 1: voltage 2 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1572 "Current sensor string 1: voltage 3 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1573 "Current sensor string 1: temperature (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1574 "Current sensor string 1: power (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1575 "Current sensor string 1: coulomb counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1576 "Current sensor string 1: energy counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1825 "Current sensor string 2: current (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1826 "Current sensor string 2: voltage 1 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1827 "Current sensor string 2: voltage 2 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1828 "Current sensor string 2: voltage 3 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1829 "Current sensor string 2: temperature (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1830 "Current sensor string 2: power (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1831 "Current sensor string 2: coulomb counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 1832 "Current sensor string 2: energy counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor)"; -CM_ BO_ 409 "(in:can.c:CAN_TransmitBootMessage)"; +CM_ BO_ 512 "Reserved - for debug/development purpose only (in:can_cbs_rx_misc.c:CANRX_Debug, fv:rx)"; +CM_ BO_ 1313 "Current sensor string 0: current (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_I"; +CM_ BO_ 1314 "Current sensor string 0: voltage 1 (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_U1"; +CM_ BO_ 1315 "Current sensor string 0: voltage 2 (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_U2"; +CM_ BO_ 1316 "Current sensor string 0: voltage 3 (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_U3"; +CM_ BO_ 1317 "Current sensor string 0: temperature (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_T"; +CM_ BO_ 1318 "Current sensor string 0: power (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_W"; +CM_ BO_ 1319 "Current sensor string 0: coulomb counting (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_As"; +CM_ BO_ 1320 "Current sensor string 0: energy counting (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_Wh"; +CM_ BO_ 409 "(in:can_cfg_tx_boot-message.c:CANTX_TransmitBootMessage, fv:tx)"; CM_ SG_ 409 foxBMS_uniqueId "Content of Device Identification Register (DEVID)"; -CM_ BO_ 550 "Transmits details on flags transmitted by foxBMS_State (in:can_cbs_tx_state.c:CAN_TxDetailState)"; +CM_ BO_ 550 "Transmits details on flags transmitted by foxBMS_State (in:can_cbs_tx_state.c:CANTX_BmsStateDetails, fv:tx)"; CM_ SG_ 550 foxBMS_TimingViolationEngine "Indicates whether the timing of the engine task has been violated."; CM_ SG_ 550 foxBMS_TimingViolation1ms "Indicates whether the timing of the 1ms task has been violated."; CM_ SG_ 550 foxBMS_TimingViolation10ms "Indicates whether the timing of the 10ms task has been violated."; @@ -1575,20 +1193,36 @@ CM_ SG_ 550 foxBMS_TimingViolation100msRec "Indicates whether a violation of the CM_ SG_ 550 foxBMS_TimingViolation100msAlgoR "Indicates whether a violation of the timing of the 100ms algorithm task has been recorded."; CM_ SG_ 550 foxBMS_TimingViolationEngineRec "Indicates whether a violation of the timing of the engine task has been recorded."; CM_ SG_ 550 foxBMS_TimingViolation1msRec "Indicates whether a violation of the timing of the 1ms task has been recorded."; -CM_ BO_ 551 "Transmits the unique die id of the MCU on which foxBMS is currently running (in:can.c:CAN_TransmitDieId)"; +CM_ BO_ 551 "Transmits the unique die id of the MCU on which foxBMS is currently running (in:can_cfg_tx_boot-message.c:CANTX_TransmitDieId, fv:tx)"; CM_ SG_ 551 MCU_lotNumber "lot number of the MCU (read from DIEIDH register)"; CM_ SG_ 551 MCU_waferNumber "wafer number of the MCU (read from DIEDL register)"; CM_ SG_ 551 MCU_xWaferCoordinate "x coordinate of the MCU die on the wafer (read from DIEIDL register)"; CM_ SG_ 551 MCU_yWaferCoordinate "y coordinate of the MCU die on the wafer (read from DIEIDL register)"; BA_DEF_ "BusType" STRING ; +BA_DEF_ BO_ "GenMsgCycleTime" INT 0 65535; BA_DEF_ SG_ "GenSigStartValue" FLOAT -3.4E+038 3.4E+038; BA_DEF_DEF_ "BusType" "CAN"; +BA_DEF_DEF_ "GenMsgCycleTime" 0; BA_DEF_DEF_ "GenSigStartValue" 0; BA_ "BusType" "CAN"; +BA_ "GenMsgCycleTime" BO_ 546 100; +BA_ "GenMsgCycleTime" BO_ 548 100; +BA_ "GenMsgCycleTime" BO_ 547 100; +BA_ "GenMsgCycleTime" BO_ 640 100; +BA_ "GenMsgCycleTime" BO_ 643 100; +BA_ "GenMsgCycleTime" BO_ 549 1000; +BA_ "GenMsgCycleTime" BO_ 576 5400; +BA_ "GenMsgCycleTime" BO_ 592 4500; +BA_ "GenMsgCycleTime" BO_ 544 100; +BA_ "GenMsgCycleTime" BO_ 545 100; +BA_ "GenMsgCycleTime" BO_ 641 100; +BA_ "GenMsgCycleTime" BO_ 642 1000; +BA_ "GenMsgCycleTime" BO_ 550 1000; + BA_ "GenSigStartValue" SG_ 546 foxBMS_packCurrent 0; BA_ "GenSigStartValue" SG_ 546 foxBMS_batteryVoltage 0; BA_ "GenSigStartValue" SG_ 546 foxBMS_busVoltage 0; @@ -1605,18 +1239,10 @@ BA_ "GenSigStartValue" SG_ 547 foxBMS_maximumCellTemp 0; BA_ "GenSigStartValue" SG_ 547 foxBMS_minimumCellTemp 0; BA_ "GenSigStartValue" SG_ 547 foxBMS_inletTemperature 0; BA_ "GenSigStartValue" SG_ 547 foxBMS_outletTemperature 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String0_current 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String0_voltage 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String0_power 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String1_current 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String1_voltage 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String1_power 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String2_current 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String2_voltage 0; -BA_ "GenSigStartValue" SG_ 640 foxBMS_String2_power 0; -BA_ "GenSigStartValue" SG_ 643 String0_energyCount 0; -BA_ "GenSigStartValue" SG_ 643 String1_energyCount 0; -BA_ "GenSigStartValue" SG_ 643 String2_energyCount 0; +BA_ "GenSigStartValue" SG_ 640 foxBMS_String0Current 0; +BA_ "GenSigStartValue" SG_ 640 foxBMS_String0Voltage 0; +BA_ "GenSigStartValue" SG_ 640 foxBMS_String0Power 0; +BA_ "GenSigStartValue" SG_ 643 foxBMS_String0EnergyCount 0; BA_ "GenSigStartValue" SG_ 549 foxBMS_packSoc 0; BA_ "GenSigStartValue" SG_ 549 foxBMS_packSoe 0; BA_ "GenSigStartValue" SG_ 549 foxBMS_packEnergy 0; @@ -2445,6 +2071,7 @@ BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_Cantiming 0; BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_PackOvercurr_Charge 0; BA_ "GenSigStartValue" SG_ 544 foxBMS_Error_PackOvercur_Dischrg 0; BA_ "GenSigStartValue" SG_ 544 foxBMS_SysMonError 0; +BA_ "GenSigStartValue" SG_ 544 foxBMS_alertFlag 0; BA_ "GenSigStartValue" SG_ 545 String0_stringConnected 0; BA_ "GenSigStartValue" SG_ 545 String0_balancing_active 0; BA_ "GenSigStartValue" SG_ 545 String0_Err_overtemp_charge 0; @@ -2497,140 +2124,16 @@ BA_ "GenSigStartValue" SG_ 545 String0_Err_negativeContactor 0; BA_ "GenSigStartValue" SG_ 545 String0_Err_CS_voltage1Meas 0; BA_ "GenSigStartValue" SG_ 545 String0_Err_CS_voltage2Meas 0; BA_ "GenSigStartValue" SG_ 545 String0_Err_CS_voltage3Meas 0; -BA_ "GenSigStartValue" SG_ 545 String1_stringConnected 0; -BA_ "GenSigStartValue" SG_ 545 String1_balancing_active 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_overtemp_charge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_undertemp_charge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_overtemp_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_undertemp_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_Overcurrent_charge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_Overcurre_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_Overvoltage 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_Undervoltage 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_deep_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_CS_currentMeas 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_positiveContactor 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_openWire 0; -BA_ "GenSigStartValue" SG_ 545 String1_openWireNumber 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_plaus_cell_volt 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_plaus_cell_temp 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_plaus_string_volt 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_slave_hardware 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyChainPrim_Comm 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyChainPrim_CRC 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyChainRedun_Comm 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyChainRedun_CRC 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyPrim_voltMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyRedun_voltMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyPrim_tempMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_dsyRedun_tempMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_CS_coulombCountMeas 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_CS_energyCountMeas 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_plaus_volt_spread 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_plaus_temp_spread 0; -BA_ "GenSigStartValue" SG_ 545 String1_fuseBlown 0; -BA_ "GenSigStartValue" SG_ 545 String1_Warning_overvoltage_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Warning_undervoltage_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_chargeOverTemp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_dischrgOverTemp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_chargeUnderTemp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_dischrgUnderTmp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_chargeOverCur_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_dischargOverCur_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_chargeOverTemp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_chargeUnderTemp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_dischrgOverTemp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_dischrgUnderTmp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_chargeOverCur_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_dischargOverCur_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_overvoltage_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Wrng_undervoltage_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_negativeContactor 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_CS_voltage1Meas 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_CS_voltage2Meas 0; -BA_ "GenSigStartValue" SG_ 545 String1_Err_CS_voltage3Meas 0; -BA_ "GenSigStartValue" SG_ 545 String2_stringConnected 0; -BA_ "GenSigStartValue" SG_ 545 String2_balancing_active 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_overtemp_charge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_undertemp_charge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_overtemp_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_undertemp_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_Overcurrent_charge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_Overcurre_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_Overvoltage 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_Undervoltage 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_deep_discharge 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_CS_currentMeas 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_positiveContactor 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_openWire 0; -BA_ "GenSigStartValue" SG_ 545 String2_openWireNumber 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_plaus_cell_volt 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_plaus_cell_temp 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_plaus_string_volt 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_slave_hardware 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyChainPrim_Comm 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyChainPrim_CRC 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyChainRedun_Comm 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyChainRedun_CRC 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyPrim_voltMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyRedun_voltMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyPrim_tempMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_dsyRedun_tempMeasOor 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_CS_coulombCountMeas 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_CS_energyCountMeas 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_plaus_volt_spread 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_plaus_temp_spread 0; -BA_ "GenSigStartValue" SG_ 545 String2_fuseBlown 0; -BA_ "GenSigStartValue" SG_ 545 String2_Warning_overvoltage_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Warning_undervoltage_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_chargeOverTemp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_dischrgOverTemp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_chargeUnderTemp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_dischrgUnderTmp_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_chargeOverCur_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_dischargOverCur_MOL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_chargeOverTemp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_chargeUnderTemp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_dischrgOverTemp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_dischrgUnderTmp_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_chargeOverCur_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_dischargOverCur_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_overvoltage_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Wrng_undervoltage_RSL 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_negativeContactor 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_CS_voltage1Meas 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_CS_voltage2Meas 0; -BA_ "GenSigStartValue" SG_ 545 String2_Err_CS_voltage3Meas 0; BA_ "GenSigStartValue" SG_ 641 String0_minimumCellVoltage 0; BA_ "GenSigStartValue" SG_ 641 String0_maximumCellVoltage 0; BA_ "GenSigStartValue" SG_ 641 String0_maximumCellTemperature 0; BA_ "GenSigStartValue" SG_ 641 String0_minimumCellTemperature 0; -BA_ "GenSigStartValue" SG_ 641 String1_minimumCellVoltage 0; -BA_ "GenSigStartValue" SG_ 641 String1_maximumCellVoltage 0; -BA_ "GenSigStartValue" SG_ 641 String1_maximumCellTemperature 0; -BA_ "GenSigStartValue" SG_ 641 String1_minimumCellTemperature 0; -BA_ "GenSigStartValue" SG_ 641 String2_minimumCellVoltage 0; -BA_ "GenSigStartValue" SG_ 641 String2_maximumCellVoltage 0; -BA_ "GenSigStartValue" SG_ 641 String2_maximumCellTemperature 0; -BA_ "GenSigStartValue" SG_ 641 String2_minimumCellTemperature 0; BA_ "GenSigStartValue" SG_ 642 String0_minimumSOC 0; BA_ "GenSigStartValue" SG_ 642 String0_averageSOC 0; BA_ "GenSigStartValue" SG_ 642 String0_maximumSOC 0; BA_ "GenSigStartValue" SG_ 642 String0_SOE 0; BA_ "GenSigStartValue" SG_ 642 String0_Energy_kWh 0; BA_ "GenSigStartValue" SG_ 642 String0_SOH 0; -BA_ "GenSigStartValue" SG_ 642 String1_minimumSOC 0; -BA_ "GenSigStartValue" SG_ 642 String1_averageSOC 0; -BA_ "GenSigStartValue" SG_ 642 String1_maximumSOC 0; -BA_ "GenSigStartValue" SG_ 642 String1_SOE 0; -BA_ "GenSigStartValue" SG_ 642 String1_Energy_kWh 0; -BA_ "GenSigStartValue" SG_ 642 String1_SOH 0; -BA_ "GenSigStartValue" SG_ 642 String2_minimumSOC 0; -BA_ "GenSigStartValue" SG_ 642 String2_averageSOC 0; -BA_ "GenSigStartValue" SG_ 642 String2_maximumSOC 0; -BA_ "GenSigStartValue" SG_ 642 String2_SOE 0; -BA_ "GenSigStartValue" SG_ 642 String2_Energy_kWh 0; -BA_ "GenSigStartValue" SG_ 642 String2_SOH 0; BA_ "GenSigStartValue" SG_ 1313 IVT0_Result_I_systemError 0; BA_ "GenSigStartValue" SG_ 1313 IVT0_Result_I_OCS 0; BA_ "GenSigStartValue" SG_ 1313 IVT0_Result_I_overallMeasError 0; @@ -2687,118 +2190,6 @@ BA_ "GenSigStartValue" SG_ 1320 IVT0_Result_Wh_channelMeasError 0; BA_ "GenSigStartValue" SG_ 1320 IVT0_Result_Wh 0; BA_ "GenSigStartValue" SG_ 1320 IVT0_MsgCount_Result_Wh 0; BA_ "GenSigStartValue" SG_ 1320 IVT0_ID_Result_Wh 7; -BA_ "GenSigStartValue" SG_ 1569 IVT1_Result_I_systemError 0; -BA_ "GenSigStartValue" SG_ 1569 IVT1_Result_I_OCS 0; -BA_ "GenSigStartValue" SG_ 1569 IVT1_Result_I_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1569 IVT1_Result_I_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1569 IVT1_ID_Result_I 0; -BA_ "GenSigStartValue" SG_ 1569 IVT1_MsgCount_Result_I 0; -BA_ "GenSigStartValue" SG_ 1569 IVT1_Result_I_mA 0; -BA_ "GenSigStartValue" SG_ 1570 IVT1_Result_U1_systemError 0; -BA_ "GenSigStartValue" SG_ 1570 IVT1_Result_U1_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1570 IVT1_Result_U1_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1570 IVT1_Result_U1_OCS 0; -BA_ "GenSigStartValue" SG_ 1570 IVT1_ID_Result_U1 1; -BA_ "GenSigStartValue" SG_ 1570 IVT1_MsgCount_Result_U1 0; -BA_ "GenSigStartValue" SG_ 1570 IVT1_Result_U1_mV 0; -BA_ "GenSigStartValue" SG_ 1571 IVT1_Result_U2_systemError 0; -BA_ "GenSigStartValue" SG_ 1571 IVT1_Result_U2_OCS 0; -BA_ "GenSigStartValue" SG_ 1571 IVT1_Result_U2_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1571 IVT1_Result_U2_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1571 IVT1_ID_Result_U2 2; -BA_ "GenSigStartValue" SG_ 1571 IVT1_MsgCount_Result_U2 0; -BA_ "GenSigStartValue" SG_ 1571 IVT1_Result_U2_mV 0; -BA_ "GenSigStartValue" SG_ 1572 IVT1_Result_U3_systemError 0; -BA_ "GenSigStartValue" SG_ 1572 IVT1_Result_U3_OCS 0; -BA_ "GenSigStartValue" SG_ 1572 IVT1_Result_U3_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1572 IVT1_Result_U3_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1572 IVT1_ID_Result_U3 3; -BA_ "GenSigStartValue" SG_ 1572 IVT1_MsgCount_Result_U3 0; -BA_ "GenSigStartValue" SG_ 1572 IVT1_Result_U3_mV 0; -BA_ "GenSigStartValue" SG_ 1573 IVT1_Result_T_systemError 0; -BA_ "GenSigStartValue" SG_ 1573 IVT1_Result_T_OCS 0; -BA_ "GenSigStartValue" SG_ 1573 IVT1_Result_T_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1573 IVT1_Result_T_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1573 IVT1_ID_Result_T 4; -BA_ "GenSigStartValue" SG_ 1573 IVT1_MsgCount_Result_T 0; -BA_ "GenSigStartValue" SG_ 1573 IVT1_Result_T_ddegC 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_Result_W_systemError 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_Result_W_OCS 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_Result_W_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_Result_W_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_Result_W 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_MsgCount_Result_W 0; -BA_ "GenSigStartValue" SG_ 1574 IVT1_ID_Result_W 5; -BA_ "GenSigStartValue" SG_ 1575 IVT1_Result_As_systemError 0; -BA_ "GenSigStartValue" SG_ 1575 IVT1_Result_As_OCS 0; -BA_ "GenSigStartValue" SG_ 1575 IVT1_Result_As_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1575 IVT1_Result_As_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1575 IVT1_Result_As 0; -BA_ "GenSigStartValue" SG_ 1575 IVT1_MsgCount_Result_As 0; -BA_ "GenSigStartValue" SG_ 1575 IVT1_ID_Result_As 6; -BA_ "GenSigStartValue" SG_ 1576 IVT1_Result_Wh_systemError 0; -BA_ "GenSigStartValue" SG_ 1576 IVT1_Result_Wh_OCS 0; -BA_ "GenSigStartValue" SG_ 1576 IVT1_Result_Wh_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1576 IVT1_Result_Wh_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1576 IVT1_Result_Wh 0; -BA_ "GenSigStartValue" SG_ 1576 IVT1_MsgCount_Result_Wh 0; -BA_ "GenSigStartValue" SG_ 1576 IVT1_ID_Result_Wh 7; -BA_ "GenSigStartValue" SG_ 1825 IVT2_Result_I_systemError 0; -BA_ "GenSigStartValue" SG_ 1825 IVT2_Result_I_OCS 0; -BA_ "GenSigStartValue" SG_ 1825 IVT2_Result_I_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1825 IVT2_Result_I_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1825 IVT2_ID_Result_I 0; -BA_ "GenSigStartValue" SG_ 1825 IVT2_MsgCount_Result_I 0; -BA_ "GenSigStartValue" SG_ 1825 IVT2_Result_I_mA 0; -BA_ "GenSigStartValue" SG_ 1826 IVT2_Result_U1_systemError 0; -BA_ "GenSigStartValue" SG_ 1826 IVT2_Result_U1_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1826 IVT2_Result_U1_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1826 IVT2_Result_U1_OCS 0; -BA_ "GenSigStartValue" SG_ 1826 IVT2_ID_Result_U1 1; -BA_ "GenSigStartValue" SG_ 1826 IVT2_MsgCount_Result_U1 0; -BA_ "GenSigStartValue" SG_ 1826 IVT2_Result_U1_mV 0; -BA_ "GenSigStartValue" SG_ 1827 IVT2_Result_U2_systemError 0; -BA_ "GenSigStartValue" SG_ 1827 IVT2_Result_U2_OCS 0; -BA_ "GenSigStartValue" SG_ 1827 IVT2_Result_U2_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1827 IVT2_Result_U2_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1827 IVT2_ID_Result_U2 2; -BA_ "GenSigStartValue" SG_ 1827 IVT2_MsgCount_Result_U2 0; -BA_ "GenSigStartValue" SG_ 1827 IVT2_Result_U2_mV 0; -BA_ "GenSigStartValue" SG_ 1828 IVT2_Result_U3_systemError 0; -BA_ "GenSigStartValue" SG_ 1828 IVT2_Result_U3_OCS 0; -BA_ "GenSigStartValue" SG_ 1828 IVT2_Result_U3_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1828 IVT2_Result_U3_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1828 IVT2_ID_Result_U3 3; -BA_ "GenSigStartValue" SG_ 1828 IVT2_MsgCount_Result_U3 0; -BA_ "GenSigStartValue" SG_ 1828 IVT2_Result_U3_mV 0; -BA_ "GenSigStartValue" SG_ 1829 IVT2_Result_T_systemError 0; -BA_ "GenSigStartValue" SG_ 1829 IVT2_Result_T_OCS 0; -BA_ "GenSigStartValue" SG_ 1829 IVT2_Result_T_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1829 IVT2_Result_T_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1829 IVT2_ID_Result_T 4; -BA_ "GenSigStartValue" SG_ 1829 IVT2_MsgCount_Result_T 0; -BA_ "GenSigStartValue" SG_ 1829 IVT2_Result_T_ddegC 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_Result_W_systemError 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_Result_W_OCS 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_Result_W_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_Result_W_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_Result_W 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_MsgCount_Result_W 0; -BA_ "GenSigStartValue" SG_ 1830 IVT2_ID_Result_W 5; -BA_ "GenSigStartValue" SG_ 1831 IVT2_Result_As_systemError 0; -BA_ "GenSigStartValue" SG_ 1831 IVT2_Result_As_OCS 0; -BA_ "GenSigStartValue" SG_ 1831 IVT2_Result_As_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1831 IVT2_Result_As_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1831 IVT2_Result_As 0; -BA_ "GenSigStartValue" SG_ 1831 IVT2_MsgCount_Result_As 0; -BA_ "GenSigStartValue" SG_ 1831 IVT2_ID_Result_As 6; -BA_ "GenSigStartValue" SG_ 1832 IVT2_Result_Wh_systemError 0; -BA_ "GenSigStartValue" SG_ 1832 IVT2_Result_Wh_OCS 0; -BA_ "GenSigStartValue" SG_ 1832 IVT2_Result_Wh_overallMeasError 0; -BA_ "GenSigStartValue" SG_ 1832 IVT2_Result_Wh_channelMeasError 0; -BA_ "GenSigStartValue" SG_ 1832 IVT2_Result_Wh 0; -BA_ "GenSigStartValue" SG_ 1832 IVT2_MsgCount_Result_Wh 0; -BA_ "GenSigStartValue" SG_ 1832 IVT2_ID_Result_Wh 7; BA_ "GenSigStartValue" SG_ 409 foxBMS_majorVersionNumber 0; BA_ "GenSigStartValue" SG_ 409 foxBMS_minorVersionNumber 0; BA_ "GenSigStartValue" SG_ 409 foxBMS_patchVersionNumber 0; @@ -2822,13 +2213,14 @@ BA_ "GenSigStartValue" SG_ 551 MCU_waferNumber 0; BA_ "GenSigStartValue" SG_ 551 MCU_xWaferCoordinate 0; BA_ "GenSigStartValue" SG_ 551 MCU_yWaferCoordinate 0; -VAL_ 640 foxBMS_StringValues_Mux 0 "mux_valuesString_0" 1 "mux_valuesString_1" 2 "mux_valuesString_2" ; -VAL_ 643 foxBMS_StringValues2_Mux 0 "mux_values2String_0" 1 "mux_values2String_1" 2 "mux_values2String_2" ; -VAL_ 576 foxBMS_CellVoltage_Mux 0 "mux_cellVoltage_000_003" 1 "mux_cellVoltage_004_007" 2 "mux_cellVoltage_008_011" 3 "mux_cellVoltage_012_015" 4 "mux_cellVoltage_016_019" 5 "mux_cellVoltage_020_023" 6 "mux_cellVoltage_024_027" 7 "mux_cellVoltage_028_031" 8 "mux_cellVoltage_032_035" 9 "mux_cellVoltage_036_039" 10 "mux_cellVoltage_040_043" 11 "mux_cellVoltage_044_047" 12 "mux_cellVoltage_048_051" 13 "mux_cellVoltage_052_055" 14 "mux_cellVoltage_056_059" 15 "mux_cellVoltage_060_063" 16 "mux_cellVoltage_064_067" 17 "mux_cellVoltage_068_071" 18 "mux_cellVoltage_072_075" 19 "mux_cellVoltage_076_079" 20 "mux_cellVoltage_080_083" 21 "mux_cellVoltage_084_087" 22 "mux_cellVoltage_088_091" 23 "mux_cellVoltage_092_095" 24 "mux_cellVoltage_096_099" 25 "mux_cellVoltage_100_103" 26 "mux_cellVoltage_104_107" 27 "mux_cellVoltage_108_111" 28 "mux_cellVoltage_112_115" 29 "mux_cellVoltage_116_119" 30 "mux_cellVoltage_120_123" 31 "mux_cellVoltage_124_127" 32 "mux_cellVoltage_128_131" 33 "mux_cellVoltage_132_135" 34 "mux_cellVoltage_136_139" 35 "mux_cellVoltage_140_143" +VAL_ 640 foxBMS_StringValuesP0_Mux 0 "mux_valuesP0String_0" ; +VAL_ 643 foxBMS_StringValuesP1_Mux 0 "mux_valuesP1String_0" ; +VAL_ 576 foxBMS_CellVoltages_Mux 0 "mux_cellVoltage_000_003" 1 "mux_cellVoltage_004_007" 2 "mux_cellVoltage_008_011" 3 "mux_cellVoltage_012_015" 4 "mux_cellVoltage_016_019" 5 "mux_cellVoltage_020_023" 6 "mux_cellVoltage_024_027" 7 "mux_cellVoltage_028_031" 8 "mux_cellVoltage_032_035" 9 "mux_cellVoltage_036_039" 10 "mux_cellVoltage_040_043" 11 "mux_cellVoltage_044_047" 12 "mux_cellVoltage_048_051" 13 "mux_cellVoltage_052_055" 14 "mux_cellVoltage_056_059" 15 "mux_cellVoltage_060_063" 16 "mux_cellVoltage_064_067" 17 "mux_cellVoltage_068_071" 18 "mux_cellVoltage_072_075" 19 "mux_cellVoltage_076_079" 20 "mux_cellVoltage_080_083" 21 "mux_cellVoltage_084_087" 22 "mux_cellVoltage_088_091" 23 "mux_cellVoltage_092_095" 24 "mux_cellVoltage_096_099" 25 "mux_cellVoltage_100_103" 26 "mux_cellVoltage_104_107" 27 "mux_cellVoltage_108_111" 28 "mux_cellVoltage_112_115" 29 "mux_cellVoltage_116_119" 30 "mux_cellVoltage_120_123" 31 "mux_cellVoltage_124_127" 32 "mux_cellVoltage_128_131" 33 "mux_cellVoltage_132_135" 34 "mux_cellVoltage_136_139" 35 "mux_cellVoltage_140_143" 36 "mux_cellVoltage_144_147" 37 "mux_cellVoltage_148_151" 38 "mux_cellVoltage_152_155" 39 "mux_cellVoltage_156_159" 40 "mux_cellVoltage_160_163" 41 "mux_cellVoltage_164_167" 42 "mux_cellVoltage_168_171" 43 "mux_cellVoltage_172_175" 44 "mux_cellVoltage_176_179" 45 "mux_cellVoltage_180_183" 46 "mux_cellVoltage_184_187" 47 "mux_cellVoltage_188_191" 48 "mux_cellVoltage_192_195" 49 "mux_cellVoltage_196_199" 50 "mux_cellVoltage_200_203" 51 "mux_cellVoltage_204_207" 52 "mux_cellVoltage_208_211" 53 "mux_cellVoltage_212_215" ; -VAL_ 592 foxBMS_CellTemperature_Mux 0 "mux_cellTemperature_000_005" 1 "mux_cellTemperature_006_011" 2 "mux_cellTemperature_012_017" 3 "mux_cellTemperature_018_023" 4 "mux_cellTemperature_024_029" 5 "mux_cellTemperature_030_035" 6 "mux_cellTemperature_036_041" 7 "mux_cellTemperature_042_047" 8 "mux_cellTemperature_048_053" 9 "mux_cellTemperature_054_059" 10 "mux_cellTemperature_060_065" 11 "mux_cellTemperature_066_071" 12 "mux_cellTemperature_072_077" 13 "mux_cellTemperature_078_083" 14 "mux_cellTemperature_084_089" 15 "mux_cellTemperature_090_095" 16 "mux_cellTemperature_096_101" 17 "mux_cellTemperature_102_107" 18 "mux_cellTemperature_108_113" 19 "mux_cellTemperature_114_119" 20 "mux_cellTemperature_120_125" 21 "mux_cellTemperature_126_131" 22 "mux_cellTemperature_132_137" 23 "mux_cellTemperature_138_143" 24 "mux_cellTemperature_144_149" 25 "mux_cellTemperature_150_155" 26 "mux_cellTemperature_156_161" 27 "mux_cellTemperature_162_167" 28 "mux_cellTemperature_168_173" 29 "mux_cellTemperature_174_179" ; -VAL_ 545 foxBMS_StringState_Mux 0 "mux_stateString0" 1 "mux_stateString1" 2 "mux_stateString2" ; -VAL_ 641 foxBMS_StringMinMaxValues_Mux 0 "mux_minMaxValuesString0" 1 "mux_minMaxValuesString1" 2 "mux_minMaxValuesString2" ; -VAL_ 642 foxBMS_StringStateEstimation_Mux 0 "mux_String0_SOC_SOE" 1 "mux_String1_SOC_SOE" 2 "mux_String2_SOC_SOE" ; +VAL_ 592 foxBMS_CellTemperatures_Mux 0 "mux_cellTemperature_000_005" 1 "mux_cellTemperature_006_011" 2 "mux_cellTemperature_012_017" 3 "mux_cellTemperature_018_023" 4 "mux_cellTemperature_024_029" 5 "mux_cellTemperature_030_035" 6 "mux_cellTemperature_036_041" 7 "mux_cellTemperature_042_047" 8 "mux_cellTemperature_048_053" 9 "mux_cellTemperature_054_059" 10 "mux_cellTemperature_060_065" 11 "mux_cellTemperature_066_071" 12 "mux_cellTemperature_072_077" 13 "mux_cellTemperature_078_083" 14 "mux_cellTemperature_084_089" 15 "mux_cellTemperature_090_095" 16 "mux_cellTemperature_096_101" 17 "mux_cellTemperature_102_107" 18 "mux_cellTemperature_108_113" 19 "mux_cellTemperature_114_119" 20 "mux_cellTemperature_120_125" 21 "mux_cellTemperature_126_131" 22 "mux_cellTemperature_132_137" 23 "mux_cellTemperature_138_143" 24 "mux_cellTemperature_144_149" 25 "mux_cellTemperature_150_155" 26 "mux_cellTemperature_156_161" 27 "mux_cellTemperature_162_167" 28 "mux_cellTemperature_168_173" 29 "mux_cellTemperature_174_179" ; +VAL_ 545 foxBMS_StringState_Mux 0 "mux_stateString0" ; +VAL_ 641 foxBMS_StringMinMaxValues_Mux 0 "mux_minMaxValuesString0" ; +VAL_ 642 foxBMS_StringStateEstimation_Mux 0 "mux_String0_SOC_SOE" ; VAL_ 560 foxBMS_modeRequest 0 "mode_Standby" 1 "mode_Discharge" 2 "mode_Charge" ; VAL_ 544 foxBMS_State 0 "BMS_UNINITIALIZED" 1 "BMS_INITIALIZATION" 2 "BMS_INITIALIZED" 3 "BMS_IDLE" 4 "BMS_OPEN_CONTACTORS" 5 "BMS_STANDBY" 6 "BMS_PRECHARGE" 7 "BMS_NORMAL" 8 "BMS_DISCHARGE" 9 "BMS_CHARGE" 10 "BMS_ERROR" 11 "BMS_UNDEFINED" ; +VAL_ 545 String0_fuseBlown 0 "Fuse okay" 1 "Fuse blown" ; diff --git a/tools/dbc/foxbms.sym b/tools/dbc/foxbms.sym index 3d8b40bb..d2ee5333 100644 --- a/tools/dbc/foxbms.sym +++ b/tools/dbc/foxbms.sym @@ -1,753 +1,792 @@ -FormatVersion=5.0 // Do not edit this line! +FormatVersion=6.0 // Do not edit this line! +UniqueVariables=True Title="foxBMS" {ENUMS} -enum modeRequest_e(0="mode_Standby", // Disconnect strings from HV bus - 1="mode_Discharge", // Connect strings to HV bus to start discharge +Enum=foxBMS_ModeRequest(0="mode_Standby", // Disconnect strings from HV bus + 1="mode_Discharge", // Connect strings to HV bus to start discharge 2="mode_Charge") // Connect strings to HV bus to start charging // Possible states (i.e., values) the BMS state machine can have -enum state_e(0="BMS_UNINITIALIZED", // BMS state machine is uninitialized - 1="BMS_INITIALIZATION", // BMS state machine is currently trying to initialize - 2="BMS_INITIALIZED", // BMS state machine is initialized - 3="BMS_IDLE", // BMS state machine is idling - 4="BMS_OPEN_CONTACTORS", 5="BMS_STANDBY", 6="BMS_PRECHARGE", 7="BMS_NORMAL", - 8="BMS_DISCHARGE", 9="BMS_CHARGE", 10="BMS_ERROR", 11="BMS_UNDEFINED") +Enum=foxBMS_State(0="BMS_UNINITIALIZED", // BMS state machine is uninitialized + 1="BMS_INITIALIZATION", // BMS state machine is currently trying to initialize + 2="BMS_INITIALIZED", // BMS state machine is initialized + 3="BMS_IDLE", // BMS state machine is idling + 4="BMS_OPEN_CONTACTORS", 5="BMS_STANDBY", 6="BMS_PRECHARGE", 7="BMS_NORMAL", 8="BMS_DISCHARGE", 9="BMS_CHARGE", + 10="BMS_ERROR", 11="BMS_UNDEFINED") +Enum=foxBMS_FuseState(0="Fuse okay", 1="Fuse blown") {SENDRECEIVE} [foxBMS_PackValues] -ID=222h // (in:can_cbs_tx_system_values.c:CAN_TxPackValues) -DLC=8 -Var=foxBMS_packCurrent signed 46,18 -m /u:A /f:0.01 // Battery pack current -Var=foxBMS_batteryVoltage unsigned 0,14 -m /u:V /f:0.1 // Battery voltage between negative and positive pole of the battery -Var=foxBMS_busVoltage unsigned 14,14 -m /u:V /f:0.1 // Battery voltage between negative pole and after main positive contactor -Var=foxBMS_packPower signed 28,18 -m /u:kW /f:0.01 // Battery power +ID=222h // (in:can_cbs_tx_system-values.c:CANTX_PackValues, fv:tx) +Len=8 +CycleTime=100 -p +Var=foxBMS_packCurrent signed 46,18 -m /u:A /f:0.01 // Battery pack current +Var=foxBMS_batteryVoltage unsigned 0,14 -m /u:V /f:0.1 // Battery voltage between negative and positive pole of the battery +Var=foxBMS_busVoltage unsigned 14,14 -m /u:V /f:0.1 // Battery voltage between negative pole and after main positive contactor +Var=foxBMS_packPower signed 28,18 -m /u:kW /f:0.01 // Battery power [foxBMS_LimitValues] -ID=224h // (in:can_cbs_tx_limits.c:CAN_TxLimitValues) -DLC=8 -Var=foxBMS_maxChargeCurrent unsigned 12,12 -m /u:A /f:0.25 // Maximum battery pack charge current -Var=foxBMS_maxDischargeCurrent unsigned 0,12 -m /u:A /f:0.25 // Maximum battery pack discharge current +ID=224h // (in:can_cbs_tx_limit-values.c:CANTX_LimitValues, fv:tx) +Len=8 +CycleTime=100 -p +Var=foxBMS_maxChargeCurrent unsigned 12,12 -m /u:A /f:0.25 // Maximum battery pack charge current +Var=foxBMS_maxDischargeCurrent unsigned 0,12 -m /u:A /f:0.25 // Maximum battery pack discharge current Var=foxBMS_maxChargePower unsigned 36,12 -m /u:kW /f:0.2 Var=foxBMS_maxDischargePower unsigned 24,12 -m /u:kW /f:0.1 Var=foxBMS_maxBatteryVoltage unsigned 48,8 -m /u:V /f:4 Var=foxBMS_minBatteryVoltage unsigned 56,8 -m /u:V /f:4 [foxBMS_MinimumMaximumValues] -ID=223h // (in:can_cbs_tx_minmax.c:CAN_TxMinimumMaximumValues) -DLC=8 -Var=foxBMS_minimumCellVoltage unsigned 13,13 -m /u:mV // Minimum cell voltage of all connected strings, if no string connected maximum value of whole system is transmitted -Var=foxBMS_maximumCellVoltage unsigned 0,13 -m /u:mV // Maximum cell voltage of all connected strings, if no string connected maximum value of whole system is transmitted -Var=foxBMS_maximumCellTemp signed 48,8 -m /u:degC // Maximum cell temperature of all connected strings, if no string connected maximum value of whole system is transmitted -Var=foxBMS_minimumCellTemp signed 56,8 -m /u:degC // Minium cell temperature of all connected string, if no string connected maximum value of whole system is transmitted +ID=223h // (in:can_cbs_tx_minimum-maximum-values.c:CANTX_MinimumMaximumValues, fv:tx) +Len=8 +CycleTime=100 -p +Var=foxBMS_minimumCellVoltage unsigned 13,13 -m /u:mV // Minimum cell voltage of all connected strings, if no string connected maximum value of whole system is transmitted +Var=foxBMS_maximumCellVoltage unsigned 0,13 -m /u:mV // Maximum cell voltage of all connected strings, if no string connected maximum value of whole system is transmitted +Var=foxBMS_maximumCellTemp signed 48,8 -m /u:degC // Maximum cell temperature of all connected strings, if no string connected maximum value of whole system is transmitted +Var=foxBMS_minimumCellTemp signed 56,8 -m /u:degC // Minium cell temperature of all connected string, if no string connected maximum value of whole system is transmitted Var=foxBMS_inletTemperature signed 32,8 -m /u:degC Var=foxBMS_outletTemperature signed 40,8 -m /u:degC -[foxBMS_StringValues] -ID=280h // Message contains string voltage, current and power (in:can_cbs_tx_system_values.c:CAN_TxStringValues) -DLC=8 -Mux=mux_valuesString_0 0,3 0 -m -Var=foxBMS_String0_current signed 20,18 -m /u:A /f:0.01 -Var=foxBMS_String0_voltage unsigned 3,17 -m /u:V /f:0.01 -Var=foxBMS_String0_power signed 38,18 -m /u:kW /f:0.01 - -[foxBMS_StringValues] -DLC=8 -Mux=mux_valuesString_1 0,3 1 -m -Var=foxBMS_String1_current signed 20,18 -m /u:A /f:0.01 -Var=foxBMS_String1_voltage unsigned 3,17 -m /u:V /f:0.01 -Var=foxBMS_String1_power signed 38,18 -m /u:kW /f:0.01 - -[foxBMS_StringValues] -DLC=8 -Mux=mux_valuesString_2 0,3 2 -m -Var=foxBMS_String2_current signed 20,18 -m /u:A /f:0.01 -Var=foxBMS_String2_voltage unsigned 3,17 -m /u:V /f:0.01 -Var=foxBMS_String2_power signed 38,18 -m /u:kW /f:0.01 - -[foxBMS_StringValues2] -ID=283h // Message contains energy counting value (in:can_cbs_tx_system_values.c:CAN_TxStringValues2) -DLC=8 -Mux=mux_values2String_0 0,4 0 -m -Var=String0_energyCount signed 8,32 -m /u:Wh // Current sensor string 0 energy counting value - -[foxBMS_StringValues2] -DLC=8 -Mux=mux_values2String_1 0,4 1 -m -Var=String1_energyCount signed 8,32 -m /u:Wh // Current sensor string 1 energy counting value - -[foxBMS_StringValues2] -DLC=8 -Mux=mux_values2String_2 0,4 2 -m -Var=String2_energyCount signed 8,32 -m /u:Wh // Current sensor string 2 energy counting value +[foxBMS_StringValuesP0] +ID=280h // Message contains string voltage, current and power (in:can_cbs_tx_system-values.c:CANTX_StringValuesP0, fv:tx) +Len=8 +CycleTime=100 -p +Mux=mux_valuesP0String_0 0,3 0 -m +Var=foxBMS_String0Current signed 20,18 -m /u:A /f:0.01 +Var=foxBMS_String0Voltage unsigned 3,17 -m /u:V /f:0.01 +Var=foxBMS_String0Power signed 38,18 -m /u:kW /f:0.01 + +[foxBMS_StringValuesP1] +ID=283h // Message contains energy counting value (in:can_cbs_tx_system-values.c:CANTX_StringValuesP1, fv:tx) +Len=8 +CycleTime=100 -p +Mux=mux_valuesP1String_0 0,4 0 -m +Var=foxBMS_String0EnergyCount signed 8,32 -m /u:Wh // Current sensor string 0 energy counting value [foxBMS_PackStateEstimation] -ID=225h // (in:can_cbs_tx_state_estimation.c:CAN_TxStateEstimation) -DLC=8 -Var=foxBMS_packSoc unsigned 0,14 -m /u:% /f:0.01 /d:0 // SOC currently connected to HV bus (100% if all strings connected and all strings at 100%) -Var=foxBMS_packSoe unsigned 14,14 -m /u:% /f:0.01 /d:0 // SOE currently connected to HV bus (100% if all strings connected and all strings at 100%) -Var=foxBMS_packEnergy unsigned 40,24 -m /u:kWh /f:0.01 // Energy left in Wh that is currently connected to HV bus +ID=225h // (in:can_cbs_tx_pack-state-estimation.c:CANTX_PackStateEstimation, fv:tx) +Len=8 +CycleTime=1000 -p +Var=foxBMS_packSoc unsigned 0,14 -m /u:% /f:0.01 // SOC currently connected to HV bus (100% if all strings connected and all strings at 100%) +Var=foxBMS_packSoe unsigned 14,14 -m /u:% /f:0.01 // SOE currently connected to HV bus (100% if all strings connected and all strings at 100%) +Var=foxBMS_packEnergy unsigned 40,24 -m /u:kWh /f:0.01 // Energy left in Wh that is currently connected to HV bus Var=foxBMS_packSoh unsigned 28,12 -m /u:% /f:0.025 -[foxBMS_CellVoltage] -ID=240h // (in:can_cbs_tx_voltage.c:CAN_TxVoltage) -DLC=8 -Mux=mux_cellVoltage_000_003 0,8 0 -m -Var=cellVoltage_000_invalidFlag unsigned 11,1 -m -Var=cellVoltage_001_invalidFlag unsigned 10,1 -m -Var=cellVoltage_002_invalidFlag unsigned 9,1 -m -Var=cellVoltage_003_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +ID=240h // (in:can_cbs_tx_cell-voltages.c:CANTX_CellVoltages, fv:tx) +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_000_003 0,8 0 -m +Var=cellVoltage_000_invalidFlag bit 11,1 -m +Var=cellVoltage_001_invalidFlag bit 10,1 -m +Var=cellVoltage_002_invalidFlag bit 9,1 -m +Var=cellVoltage_003_invalidFlag bit 8,1 -m Var=cellVoltage_000 unsigned 12,13 -m /u:mV Var=cellVoltage_001 unsigned 25,13 -m /u:mV Var=cellVoltage_002 unsigned 38,13 -m /u:mV Var=cellVoltage_003 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_004_007 0,8 1 -m -Var=cellVoltage_004_invalidFlag unsigned 11,1 -m -Var=cellVoltage_005_invalidFlag unsigned 10,1 -m -Var=cellVoltage_006_invalidFlag unsigned 9,1 -m -Var=cellVoltage_007_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_004_007 0,8 1 -m +Var=cellVoltage_004_invalidFlag bit 11,1 -m +Var=cellVoltage_005_invalidFlag bit 10,1 -m +Var=cellVoltage_006_invalidFlag bit 9,1 -m +Var=cellVoltage_007_invalidFlag bit 8,1 -m Var=cellVoltage_004 unsigned 12,13 -m /u:mV Var=cellVoltage_005 unsigned 25,13 -m /u:mV Var=cellVoltage_006 unsigned 38,13 -m /u:mV Var=cellVoltage_007 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_008_011 0,8 2 -m -Var=cellVoltage_008_invalidFlag unsigned 11,1 -m -Var=cellVoltage_009_invalidFlag unsigned 10,1 -m -Var=cellVoltage_010_invalidFlag unsigned 9,1 -m -Var=cellVoltage_011_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_008_011 0,8 2 -m +Var=cellVoltage_008_invalidFlag bit 11,1 -m +Var=cellVoltage_009_invalidFlag bit 10,1 -m +Var=cellVoltage_010_invalidFlag bit 9,1 -m +Var=cellVoltage_011_invalidFlag bit 8,1 -m Var=cellVoltage_008 unsigned 12,13 -m /u:mV Var=cellVoltage_009 unsigned 25,13 -m /u:mV Var=cellVoltage_010 unsigned 38,13 -m /u:mV Var=cellVoltage_011 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_012_015 0,8 3 -m -Var=cellVoltage_012_invalidFlag unsigned 11,1 -m -Var=cellVoltage_013_invalidFlag unsigned 10,1 -m -Var=cellVoltage_014_invalidFlag unsigned 9,1 -m -Var=cellVoltage_015_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_012_015 0,8 3 -m +Var=cellVoltage_012_invalidFlag bit 11,1 -m +Var=cellVoltage_013_invalidFlag bit 10,1 -m +Var=cellVoltage_014_invalidFlag bit 9,1 -m +Var=cellVoltage_015_invalidFlag bit 8,1 -m Var=cellVoltage_012 unsigned 12,13 -m /u:mV Var=cellVoltage_013 unsigned 25,13 -m /u:mV Var=cellVoltage_014 unsigned 38,13 -m /u:mV Var=cellVoltage_015 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_016_019 0,8 4 -m -Var=cellVoltage_016_invalidFlag unsigned 11,1 -m -Var=cellVoltage_017_invalidFlag unsigned 10,1 -m -Var=cellVoltage_018_invalidFlag unsigned 9,1 -m -Var=cellVoltage_019_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_016_019 0,8 4 -m +Var=cellVoltage_016_invalidFlag bit 11,1 -m +Var=cellVoltage_017_invalidFlag bit 10,1 -m +Var=cellVoltage_018_invalidFlag bit 9,1 -m +Var=cellVoltage_019_invalidFlag bit 8,1 -m Var=cellVoltage_016 unsigned 12,13 -m /u:mV Var=cellVoltage_017 unsigned 25,13 -m /u:mV Var=cellVoltage_018 unsigned 38,13 -m /u:mV Var=cellVoltage_019 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_020_023 0,8 5 -m -Var=cellVoltage_020_invalidFlag unsigned 11,1 -m -Var=cellVoltage_021_invalidFlag unsigned 10,1 -m -Var=cellVoltage_022_invalidFlag unsigned 9,1 -m -Var=cellVoltage_023_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_020_023 0,8 5 -m +Var=cellVoltage_020_invalidFlag bit 11,1 -m +Var=cellVoltage_021_invalidFlag bit 10,1 -m +Var=cellVoltage_022_invalidFlag bit 9,1 -m +Var=cellVoltage_023_invalidFlag bit 8,1 -m Var=cellVoltage_020 unsigned 12,13 -m /u:mV Var=cellVoltage_021 unsigned 25,13 -m /u:mV Var=cellVoltage_022 unsigned 38,13 -m /u:mV Var=cellVoltage_023 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_024_027 0,8 6 -m -Var=cellVoltage_024_invalidFlag unsigned 11,1 -m -Var=cellVoltage_025_invalidFlag unsigned 10,1 -m -Var=cellVoltage_026_invalidFlag unsigned 9,1 -m -Var=cellVoltage_027_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_024_027 0,8 6 -m +Var=cellVoltage_024_invalidFlag bit 11,1 -m +Var=cellVoltage_025_invalidFlag bit 10,1 -m +Var=cellVoltage_026_invalidFlag bit 9,1 -m +Var=cellVoltage_027_invalidFlag bit 8,1 -m Var=cellVoltage_024 unsigned 12,13 -m /u:mV Var=cellVoltage_025 unsigned 25,13 -m /u:mV Var=cellVoltage_026 unsigned 38,13 -m /u:mV Var=cellVoltage_027 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_028_031 0,8 7 -m -Var=cellVoltage_028_invalidFlag unsigned 11,1 -m -Var=cellVoltage_029_invalidFlag unsigned 10,1 -m -Var=cellVoltage_030_invalidFlag unsigned 9,1 -m -Var=cellVoltage_031_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_028_031 0,8 7 -m +Var=cellVoltage_028_invalidFlag bit 11,1 -m +Var=cellVoltage_029_invalidFlag bit 10,1 -m +Var=cellVoltage_030_invalidFlag bit 9,1 -m +Var=cellVoltage_031_invalidFlag bit 8,1 -m Var=cellVoltage_028 unsigned 12,13 -m /u:mV Var=cellVoltage_029 unsigned 25,13 -m /u:mV Var=cellVoltage_030 unsigned 38,13 -m /u:mV Var=cellVoltage_031 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_032_035 0,8 8 -m -Var=cellVoltage_032_invalidFlag unsigned 11,1 -m -Var=cellVoltage_033_invalidFlag unsigned 10,1 -m -Var=cellVoltage_034_invalidFlag unsigned 9,1 -m -Var=cellVoltage_035_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_032_035 0,8 8 -m +Var=cellVoltage_032_invalidFlag bit 11,1 -m +Var=cellVoltage_033_invalidFlag bit 10,1 -m +Var=cellVoltage_034_invalidFlag bit 9,1 -m +Var=cellVoltage_035_invalidFlag bit 8,1 -m Var=cellVoltage_032 unsigned 12,13 -m /u:mV Var=cellVoltage_033 unsigned 25,13 -m /u:mV Var=cellVoltage_034 unsigned 38,13 -m /u:mV Var=cellVoltage_035 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_036_039 0,8 9 -m -Var=cellVoltage_036_invalidFlag unsigned 11,1 -m -Var=cellVoltage_037_invalidFlag unsigned 10,1 -m -Var=cellVoltage_038_invalidFlag unsigned 9,1 -m -Var=cellVoltage_039_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_036_039 0,8 9 -m +Var=cellVoltage_036_invalidFlag bit 11,1 -m +Var=cellVoltage_037_invalidFlag bit 10,1 -m +Var=cellVoltage_038_invalidFlag bit 9,1 -m +Var=cellVoltage_039_invalidFlag bit 8,1 -m Var=cellVoltage_036 unsigned 12,13 -m /u:mV Var=cellVoltage_037 unsigned 25,13 -m /u:mV Var=cellVoltage_038 unsigned 38,13 -m /u:mV Var=cellVoltage_039 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_040_043 0,8 0Ah -m -Var=cellVoltage_040_invalidFlag unsigned 11,1 -m -Var=cellVoltage_041_invalidFlag unsigned 10,1 -m -Var=cellVoltage_042_invalidFlag unsigned 9,1 -m -Var=cellVoltage_043_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_040_043 0,8 0Ah -m +Var=cellVoltage_040_invalidFlag bit 11,1 -m +Var=cellVoltage_041_invalidFlag bit 10,1 -m +Var=cellVoltage_042_invalidFlag bit 9,1 -m +Var=cellVoltage_043_invalidFlag bit 8,1 -m Var=cellVoltage_040 unsigned 12,13 -m /u:mV Var=cellVoltage_041 unsigned 25,13 -m /u:mV Var=cellVoltage_042 unsigned 38,13 -m /u:mV Var=cellVoltage_043 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_044_047 0,8 0Bh -m -Var=cellVoltage_044_invalidFlag unsigned 11,1 -m -Var=cellVoltage_045_invalidFlag unsigned 10,1 -m -Var=cellVoltage_046_invalidFlag unsigned 9,1 -m -Var=cellVoltage_047_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_044_047 0,8 0Bh -m +Var=cellVoltage_044_invalidFlag bit 11,1 -m +Var=cellVoltage_045_invalidFlag bit 10,1 -m +Var=cellVoltage_046_invalidFlag bit 9,1 -m +Var=cellVoltage_047_invalidFlag bit 8,1 -m Var=cellVoltage_044 unsigned 12,13 -m /u:mV Var=cellVoltage_045 unsigned 25,13 -m /u:mV Var=cellVoltage_046 unsigned 38,13 -m /u:mV Var=cellVoltage_047 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_048_051 0,8 0Ch -m -Var=cellVoltage_048_invalidFlag unsigned 11,1 -m -Var=cellVoltage_049_invalidFlag unsigned 10,1 -m -Var=cellVoltage_050_invalidFlag unsigned 9,1 -m -Var=cellVoltage_051_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_048_051 0,8 0Ch -m +Var=cellVoltage_048_invalidFlag bit 11,1 -m +Var=cellVoltage_049_invalidFlag bit 10,1 -m +Var=cellVoltage_050_invalidFlag bit 9,1 -m +Var=cellVoltage_051_invalidFlag bit 8,1 -m Var=cellVoltage_048 unsigned 12,13 -m /u:mV Var=cellVoltage_049 unsigned 25,13 -m /u:mV Var=cellVoltage_050 unsigned 38,13 -m /u:mV Var=cellVoltage_051 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_052_055 0,8 0Dh -m -Var=cellVoltage_052_invalidFlag unsigned 11,1 -m -Var=cellVoltage_053_invalidFlag unsigned 10,1 -m -Var=cellVoltage_054_invalidFlag unsigned 9,1 -m -Var=cellVoltage_055_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_052_055 0,8 0Dh -m +Var=cellVoltage_052_invalidFlag bit 11,1 -m +Var=cellVoltage_053_invalidFlag bit 10,1 -m +Var=cellVoltage_054_invalidFlag bit 9,1 -m +Var=cellVoltage_055_invalidFlag bit 8,1 -m Var=cellVoltage_052 unsigned 12,13 -m /u:mV Var=cellVoltage_053 unsigned 25,13 -m /u:mV Var=cellVoltage_054 unsigned 38,13 -m /u:mV Var=cellVoltage_055 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_056_059 0,8 0Eh -m -Var=cellVoltage_056_invalidFlag unsigned 11,1 -m -Var=cellVoltage_057_invalidFlag unsigned 10,1 -m -Var=cellVoltage_058_invalidFlag unsigned 9,1 -m -Var=cellVoltage_059_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_056_059 0,8 0Eh -m +Var=cellVoltage_056_invalidFlag bit 11,1 -m +Var=cellVoltage_057_invalidFlag bit 10,1 -m +Var=cellVoltage_058_invalidFlag bit 9,1 -m +Var=cellVoltage_059_invalidFlag bit 8,1 -m Var=cellVoltage_056 unsigned 12,13 -m /u:mV Var=cellVoltage_057 unsigned 25,13 -m /u:mV Var=cellVoltage_058 unsigned 38,13 -m /u:mV Var=cellVoltage_059 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_060_063 0,8 0Fh -m -Var=cellVoltage_060_invalidFlag unsigned 11,1 -m -Var=cellVoltage_061_invalidFlag unsigned 10,1 -m -Var=cellVoltage_062_invalidFlag unsigned 9,1 -m -Var=cellVoltage_063_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_060_063 0,8 0Fh -m +Var=cellVoltage_060_invalidFlag bit 11,1 -m +Var=cellVoltage_061_invalidFlag bit 10,1 -m +Var=cellVoltage_062_invalidFlag bit 9,1 -m +Var=cellVoltage_063_invalidFlag bit 8,1 -m Var=cellVoltage_060 unsigned 12,13 -m /u:mV Var=cellVoltage_061 unsigned 25,13 -m /u:mV Var=cellVoltage_062 unsigned 38,13 -m /u:mV Var=cellVoltage_063 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_064_067 0,8 10h -m -Var=cellVoltage_064_invalidFlag unsigned 11,1 -m -Var=cellVoltage_065_invalidFlag unsigned 10,1 -m -Var=cellVoltage_066_invalidFlag unsigned 9,1 -m -Var=cellVoltage_067_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_064_067 0,8 10h -m +Var=cellVoltage_064_invalidFlag bit 11,1 -m +Var=cellVoltage_065_invalidFlag bit 10,1 -m +Var=cellVoltage_066_invalidFlag bit 9,1 -m +Var=cellVoltage_067_invalidFlag bit 8,1 -m Var=cellVoltage_064 unsigned 12,13 -m /u:mV Var=cellVoltage_065 unsigned 25,13 -m /u:mV Var=cellVoltage_066 unsigned 38,13 -m /u:mV Var=cellVoltage_067 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_068_071 0,8 11h -m -Var=cellVoltage_068_invalidFlag unsigned 11,1 -m -Var=cellVoltage_069_invalidFlag unsigned 10,1 -m -Var=cellVoltage_070_invalidFlag unsigned 9,1 -m -Var=cellVoltage_071_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_068_071 0,8 11h -m +Var=cellVoltage_068_invalidFlag bit 11,1 -m +Var=cellVoltage_069_invalidFlag bit 10,1 -m +Var=cellVoltage_070_invalidFlag bit 9,1 -m +Var=cellVoltage_071_invalidFlag bit 8,1 -m Var=cellVoltage_068 unsigned 12,13 -m /u:mV Var=cellVoltage_069 unsigned 25,13 -m /u:mV Var=cellVoltage_070 unsigned 38,13 -m /u:mV Var=cellVoltage_071 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_072_075 0,8 12h -m -Var=cellVoltage_072_invalidFlag unsigned 11,1 -m -Var=cellVoltage_073_invalidFlag unsigned 10,1 -m -Var=cellVoltage_074_invalidFlag unsigned 9,1 -m -Var=cellVoltage_075_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_072_075 0,8 12h -m +Var=cellVoltage_072_invalidFlag bit 11,1 -m +Var=cellVoltage_073_invalidFlag bit 10,1 -m +Var=cellVoltage_074_invalidFlag bit 9,1 -m +Var=cellVoltage_075_invalidFlag bit 8,1 -m Var=cellVoltage_072 unsigned 12,13 -m /u:mV Var=cellVoltage_073 unsigned 25,13 -m /u:mV Var=cellVoltage_074 unsigned 38,13 -m /u:mV Var=cellVoltage_075 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_076_079 0,8 13h -m -Var=cellVoltage_076_invalidFlag unsigned 11,1 -m -Var=cellVoltage_077_invalidFlag unsigned 10,1 -m -Var=cellVoltage_078_invalidFlag unsigned 9,1 -m -Var=cellVoltage_079_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_076_079 0,8 13h -m +Var=cellVoltage_076_invalidFlag bit 11,1 -m +Var=cellVoltage_077_invalidFlag bit 10,1 -m +Var=cellVoltage_078_invalidFlag bit 9,1 -m +Var=cellVoltage_079_invalidFlag bit 8,1 -m Var=cellVoltage_076 unsigned 12,13 -m /u:mV Var=cellVoltage_077 unsigned 25,13 -m /u:mV Var=cellVoltage_078 unsigned 38,13 -m /u:mV Var=cellVoltage_079 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_080_083 0,8 14h -m -Var=cellVoltage_080_invalidFlag unsigned 11,1 -m -Var=cellVoltage_081_invalidFlag unsigned 10,1 -m -Var=cellVoltage_082_invalidFlag unsigned 9,1 -m -Var=cellVoltage_083_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_080_083 0,8 14h -m +Var=cellVoltage_080_invalidFlag bit 11,1 -m +Var=cellVoltage_081_invalidFlag bit 10,1 -m +Var=cellVoltage_082_invalidFlag bit 9,1 -m +Var=cellVoltage_083_invalidFlag bit 8,1 -m Var=cellVoltage_080 unsigned 12,13 -m /u:mV Var=cellVoltage_081 unsigned 25,13 -m /u:mV Var=cellVoltage_082 unsigned 38,13 -m /u:mV Var=cellVoltage_083 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_084_087 0,8 15h -m -Var=cellVoltage_084_invalidFlag unsigned 11,1 -m -Var=cellVoltage_085_invalidFlag unsigned 10,1 -m -Var=cellVoltage_086_invalidFlag unsigned 9,1 -m -Var=cellVoltage_087_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_084_087 0,8 15h -m +Var=cellVoltage_084_invalidFlag bit 11,1 -m +Var=cellVoltage_085_invalidFlag bit 10,1 -m +Var=cellVoltage_086_invalidFlag bit 9,1 -m +Var=cellVoltage_087_invalidFlag bit 8,1 -m Var=cellVoltage_084 unsigned 12,13 -m /u:mV Var=cellVoltage_085 unsigned 25,13 -m /u:mV Var=cellVoltage_086 unsigned 38,13 -m /u:mV Var=cellVoltage_087 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_088_091 0,8 16h -m -Var=cellVoltage_088_invalidFlag unsigned 11,1 -m -Var=cellVoltage_089_invalidFlag unsigned 10,1 -m -Var=cellVoltage_090_invalidFlag unsigned 9,1 -m -Var=cellVoltage_091_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_088_091 0,8 16h -m +Var=cellVoltage_088_invalidFlag bit 11,1 -m +Var=cellVoltage_089_invalidFlag bit 10,1 -m +Var=cellVoltage_090_invalidFlag bit 9,1 -m +Var=cellVoltage_091_invalidFlag bit 8,1 -m Var=cellVoltage_088 unsigned 12,13 -m /u:mV Var=cellVoltage_089 unsigned 25,13 -m /u:mV Var=cellVoltage_090 unsigned 38,13 -m /u:mV Var=cellVoltage_091 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_092_095 0,8 17h -m -Var=cellVoltage_092_invalidFlag unsigned 11,1 -m -Var=cellVoltage_093_invalidFlag unsigned 10,1 -m -Var=cellVoltage_094_invalidFlag unsigned 9,1 -m -Var=cellVoltage_095_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_092_095 0,8 17h -m +Var=cellVoltage_092_invalidFlag bit 11,1 -m +Var=cellVoltage_093_invalidFlag bit 10,1 -m +Var=cellVoltage_094_invalidFlag bit 9,1 -m +Var=cellVoltage_095_invalidFlag bit 8,1 -m Var=cellVoltage_092 unsigned 12,13 -m /u:mV Var=cellVoltage_093 unsigned 25,13 -m /u:mV Var=cellVoltage_094 unsigned 38,13 -m /u:mV Var=cellVoltage_095 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_096_099 0,8 18h -m -Var=cellVoltage_096_invalidFlag unsigned 11,1 -m -Var=cellVoltage_097_invalidFlag unsigned 10,1 -m -Var=cellVoltage_098_invalidFlag unsigned 9,1 -m -Var=cellVoltage_099_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_096_099 0,8 18h -m +Var=cellVoltage_096_invalidFlag bit 11,1 -m +Var=cellVoltage_097_invalidFlag bit 10,1 -m +Var=cellVoltage_098_invalidFlag bit 9,1 -m +Var=cellVoltage_099_invalidFlag bit 8,1 -m Var=cellVoltage_096 unsigned 12,13 -m /u:mV Var=cellVoltage_097 unsigned 25,13 -m /u:mV Var=cellVoltage_098 unsigned 38,13 -m /u:mV Var=cellVoltage_099 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_100_103 0,8 19h -m -Var=cellVoltage_100_invalidFlag unsigned 11,1 -m -Var=cellVoltage_101_invalidFlag unsigned 10,1 -m -Var=cellVoltage_102_invalidFlag unsigned 9,1 -m -Var=cellVoltage_103_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_100_103 0,8 19h -m +Var=cellVoltage_100_invalidFlag bit 11,1 -m +Var=cellVoltage_101_invalidFlag bit 10,1 -m +Var=cellVoltage_102_invalidFlag bit 9,1 -m +Var=cellVoltage_103_invalidFlag bit 8,1 -m Var=cellVoltage_100 unsigned 12,13 -m /u:mV Var=cellVoltage_101 unsigned 25,13 -m /u:mV Var=cellVoltage_102 unsigned 38,13 -m /u:mV Var=cellVoltage_103 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_104_107 0,8 1Ah -m -Var=cellVoltage_104_invalidFlag unsigned 11,1 -m -Var=cellVoltage_105_invalidFlag unsigned 10,1 -m -Var=cellVoltage_106_invalidFlag unsigned 9,1 -m -Var=cellVoltage_107_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_104_107 0,8 1Ah -m +Var=cellVoltage_104_invalidFlag bit 11,1 -m +Var=cellVoltage_105_invalidFlag bit 10,1 -m +Var=cellVoltage_106_invalidFlag bit 9,1 -m +Var=cellVoltage_107_invalidFlag bit 8,1 -m Var=cellVoltage_104 unsigned 12,13 -m /u:mV Var=cellVoltage_105 unsigned 25,13 -m /u:mV Var=cellVoltage_106 unsigned 38,13 -m /u:mV Var=cellVoltage_107 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_108_111 0,8 1Bh -m -Var=cellVoltage_108_invalidFlag unsigned 11,1 -m -Var=cellVoltage_109_invalidFlag unsigned 10,1 -m -Var=cellVoltage_110_invalidFlag unsigned 9,1 -m -Var=cellVoltage_111_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_108_111 0,8 1Bh -m +Var=cellVoltage_108_invalidFlag bit 11,1 -m +Var=cellVoltage_109_invalidFlag bit 10,1 -m +Var=cellVoltage_110_invalidFlag bit 9,1 -m +Var=cellVoltage_111_invalidFlag bit 8,1 -m Var=cellVoltage_108 unsigned 12,13 -m /u:mV Var=cellVoltage_109 unsigned 25,13 -m /u:mV Var=cellVoltage_110 unsigned 38,13 -m /u:mV Var=cellVoltage_111 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_112_115 0,8 1Ch -m -Var=cellVoltage_112_invalidFlag unsigned 11,1 -m -Var=cellVoltage_113_invalidFlag unsigned 10,1 -m -Var=cellVoltage_114_invalidFlag unsigned 9,1 -m -Var=cellVoltage_115_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_112_115 0,8 1Ch -m +Var=cellVoltage_112_invalidFlag bit 11,1 -m +Var=cellVoltage_113_invalidFlag bit 10,1 -m +Var=cellVoltage_114_invalidFlag bit 9,1 -m +Var=cellVoltage_115_invalidFlag bit 8,1 -m Var=cellVoltage_112 unsigned 12,13 -m /u:mV Var=cellVoltage_113 unsigned 25,13 -m /u:mV Var=cellVoltage_114 unsigned 38,13 -m /u:mV Var=cellVoltage_115 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_116_119 0,8 1Dh -m -Var=cellVoltage_116_invalidFlag unsigned 11,1 -m -Var=cellVoltage_117_invalidFlag unsigned 10,1 -m -Var=cellVoltage_118_invalidFlag unsigned 9,1 -m -Var=cellVoltage_119_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_116_119 0,8 1Dh -m +Var=cellVoltage_116_invalidFlag bit 11,1 -m +Var=cellVoltage_117_invalidFlag bit 10,1 -m +Var=cellVoltage_118_invalidFlag bit 9,1 -m +Var=cellVoltage_119_invalidFlag bit 8,1 -m Var=cellVoltage_116 unsigned 12,13 -m /u:mV Var=cellVoltage_117 unsigned 25,13 -m /u:mV Var=cellVoltage_118 unsigned 38,13 -m /u:mV Var=cellVoltage_119 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_120_123 0,8 1Eh -m -Var=cellVoltage_120_invalidFlag unsigned 11,1 -m -Var=cellVoltage_121_invalidFlag unsigned 10,1 -m -Var=cellVoltage_122_invalidFlag unsigned 9,1 -m -Var=cellVoltage_123_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_120_123 0,8 1Eh -m +Var=cellVoltage_120_invalidFlag bit 11,1 -m +Var=cellVoltage_121_invalidFlag bit 10,1 -m +Var=cellVoltage_122_invalidFlag bit 9,1 -m +Var=cellVoltage_123_invalidFlag bit 8,1 -m Var=cellVoltage_120 unsigned 12,13 -m /u:mV Var=cellVoltage_121 unsigned 25,13 -m /u:mV Var=cellVoltage_122 unsigned 38,13 -m /u:mV Var=cellVoltage_123 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_124_127 0,8 1Fh -m -Var=cellVoltage_124_invalidFlag unsigned 11,1 -m -Var=cellVoltage_125_invalidFlag unsigned 10,1 -m -Var=cellVoltage_126_invalidFlag unsigned 9,1 -m -Var=cellVoltage_127_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_124_127 0,8 1Fh -m +Var=cellVoltage_124_invalidFlag bit 11,1 -m +Var=cellVoltage_125_invalidFlag bit 10,1 -m +Var=cellVoltage_126_invalidFlag bit 9,1 -m +Var=cellVoltage_127_invalidFlag bit 8,1 -m Var=cellVoltage_124 unsigned 12,13 -m /u:mV Var=cellVoltage_125 unsigned 25,13 -m /u:mV Var=cellVoltage_126 unsigned 38,13 -m /u:mV Var=cellVoltage_127 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_128_131 0,8 20h -m -Var=cellVoltage_128_invalidFlag unsigned 11,1 -m -Var=cellVoltage_129_invalidFlag unsigned 10,1 -m -Var=cellVoltage_130_invalidFlag unsigned 9,1 -m -Var=cellVoltage_131_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_128_131 0,8 20h -m +Var=cellVoltage_128_invalidFlag bit 11,1 -m +Var=cellVoltage_129_invalidFlag bit 10,1 -m +Var=cellVoltage_130_invalidFlag bit 9,1 -m +Var=cellVoltage_131_invalidFlag bit 8,1 -m Var=cellVoltage_128 unsigned 12,13 -m /u:mV Var=cellVoltage_129 unsigned 25,13 -m /u:mV Var=cellVoltage_130 unsigned 38,13 -m /u:mV Var=cellVoltage_131 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_132_135 0,8 21h -m -Var=cellVoltage_132_invalidFlag unsigned 11,1 -m -Var=cellVoltage_133_invalidFlag unsigned 10,1 -m -Var=cellVoltage_134_invalidFlag unsigned 9,1 -m -Var=cellVoltage_135_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_132_135 0,8 21h -m +Var=cellVoltage_132_invalidFlag bit 11,1 -m +Var=cellVoltage_133_invalidFlag bit 10,1 -m +Var=cellVoltage_134_invalidFlag bit 9,1 -m +Var=cellVoltage_135_invalidFlag bit 8,1 -m Var=cellVoltage_132 unsigned 12,13 -m /u:mV Var=cellVoltage_133 unsigned 25,13 -m /u:mV Var=cellVoltage_134 unsigned 38,13 -m /u:mV Var=cellVoltage_135 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_136_139 0,8 22h -m -Var=cellVoltage_136_invalidFlag unsigned 11,1 -m -Var=cellVoltage_137_invalidFlag unsigned 10,1 -m -Var=cellVoltage_138_invalidFlag unsigned 9,1 -m -Var=cellVoltage_139_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_136_139 0,8 22h -m +Var=cellVoltage_136_invalidFlag bit 11,1 -m +Var=cellVoltage_137_invalidFlag bit 10,1 -m +Var=cellVoltage_138_invalidFlag bit 9,1 -m +Var=cellVoltage_139_invalidFlag bit 8,1 -m Var=cellVoltage_136 unsigned 12,13 -m /u:mV Var=cellVoltage_137 unsigned 25,13 -m /u:mV Var=cellVoltage_138 unsigned 38,13 -m /u:mV Var=cellVoltage_139 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_140_143 0,8 23h -m -Var=cellVoltage_140_invalidFlag unsigned 11,1 -m -Var=cellVoltage_141_invalidFlag unsigned 10,1 -m -Var=cellVoltage_142_invalidFlag unsigned 9,1 -m -Var=cellVoltage_143_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_140_143 0,8 23h -m +Var=cellVoltage_140_invalidFlag bit 11,1 -m +Var=cellVoltage_141_invalidFlag bit 10,1 -m +Var=cellVoltage_142_invalidFlag bit 9,1 -m +Var=cellVoltage_143_invalidFlag bit 8,1 -m Var=cellVoltage_140 unsigned 12,13 -m /u:mV Var=cellVoltage_141 unsigned 25,13 -m /u:mV Var=cellVoltage_142 unsigned 38,13 -m /u:mV Var=cellVoltage_143 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_144_147 0,8 24h -m -Var=cellVoltage_144_invalidFlag unsigned 11,1 -m -Var=cellVoltage_145_invalidFlag unsigned 10,1 -m -Var=cellVoltage_146_invalidFlag unsigned 9,1 -m -Var=cellVoltage_147_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_144_147 0,8 24h -m +Var=cellVoltage_144_invalidFlag bit 11,1 -m +Var=cellVoltage_145_invalidFlag bit 10,1 -m +Var=cellVoltage_146_invalidFlag bit 9,1 -m +Var=cellVoltage_147_invalidFlag bit 8,1 -m Var=cellVoltage_144 unsigned 12,13 -m /u:mV Var=cellVoltage_145 unsigned 25,13 -m /u:mV Var=cellVoltage_146 unsigned 38,13 -m /u:mV Var=cellVoltage_147 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_148_151 0,8 25h -m -Var=cellVoltage_148_invalidFlag unsigned 11,1 -m -Var=cellVoltage_149_invalidFlag unsigned 10,1 -m -Var=cellVoltage_150_invalidFlag unsigned 9,1 -m -Var=cellVoltage_151_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_148_151 0,8 25h -m +Var=cellVoltage_148_invalidFlag bit 11,1 -m +Var=cellVoltage_149_invalidFlag bit 10,1 -m +Var=cellVoltage_150_invalidFlag bit 9,1 -m +Var=cellVoltage_151_invalidFlag bit 8,1 -m Var=cellVoltage_148 unsigned 12,13 -m /u:mV Var=cellVoltage_149 unsigned 25,13 -m /u:mV Var=cellVoltage_150 unsigned 38,13 -m /u:mV Var=cellVoltage_151 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_152_155 0,8 26h -m -Var=cellVoltage_152_invalidFlag unsigned 11,1 -m -Var=cellVoltage_153_invalidFlag unsigned 10,1 -m -Var=cellVoltage_154_invalidFlag unsigned 9,1 -m -Var=cellVoltage_155_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_152_155 0,8 26h -m +Var=cellVoltage_152_invalidFlag bit 11,1 -m +Var=cellVoltage_153_invalidFlag bit 10,1 -m +Var=cellVoltage_154_invalidFlag bit 9,1 -m +Var=cellVoltage_155_invalidFlag bit 8,1 -m Var=cellVoltage_152 unsigned 12,13 -m /u:mV Var=cellVoltage_153 unsigned 25,13 -m /u:mV Var=cellVoltage_154 unsigned 38,13 -m /u:mV Var=cellVoltage_155 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_156_159 0,8 27h -m -Var=cellVoltage_156_invalidFlag unsigned 11,1 -m -Var=cellVoltage_157_invalidFlag unsigned 10,1 -m -Var=cellVoltage_158_invalidFlag unsigned 9,1 -m -Var=cellVoltage_159_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_156_159 0,8 27h -m +Var=cellVoltage_156_invalidFlag bit 11,1 -m +Var=cellVoltage_157_invalidFlag bit 10,1 -m +Var=cellVoltage_158_invalidFlag bit 9,1 -m +Var=cellVoltage_159_invalidFlag bit 8,1 -m Var=cellVoltage_156 unsigned 12,13 -m /u:mV Var=cellVoltage_157 unsigned 25,13 -m /u:mV Var=cellVoltage_158 unsigned 38,13 -m /u:mV Var=cellVoltage_159 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_160_163 0,8 28h -m -Var=cellVoltage_160_invalidFlag unsigned 11,1 -m -Var=cellVoltage_161_invalidFlag unsigned 10,1 -m -Var=cellVoltage_162_invalidFlag unsigned 9,1 -m -Var=cellVoltage_163_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_160_163 0,8 28h -m +Var=cellVoltage_160_invalidFlag bit 11,1 -m +Var=cellVoltage_161_invalidFlag bit 10,1 -m +Var=cellVoltage_162_invalidFlag bit 9,1 -m +Var=cellVoltage_163_invalidFlag bit 8,1 -m Var=cellVoltage_160 unsigned 12,13 -m /u:mV Var=cellVoltage_161 unsigned 25,13 -m /u:mV Var=cellVoltage_162 unsigned 38,13 -m /u:mV Var=cellVoltage_163 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_164_167 0,8 29h -m -Var=cellVoltage_164_invalidFlag unsigned 11,1 -m -Var=cellVoltage_165_invalidFlag unsigned 10,1 -m -Var=cellVoltage_166_invalidFlag unsigned 9,1 -m -Var=cellVoltage_167_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_164_167 0,8 29h -m +Var=cellVoltage_164_invalidFlag bit 11,1 -m +Var=cellVoltage_165_invalidFlag bit 10,1 -m +Var=cellVoltage_166_invalidFlag bit 9,1 -m +Var=cellVoltage_167_invalidFlag bit 8,1 -m Var=cellVoltage_164 unsigned 12,13 -m /u:mV Var=cellVoltage_165 unsigned 25,13 -m /u:mV Var=cellVoltage_166 unsigned 38,13 -m /u:mV Var=cellVoltage_167 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_168_171 0,8 2Ah -m -Var=cellVoltage_168_invalidFlag unsigned 11,1 -m -Var=cellVoltage_169_invalidFlag unsigned 10,1 -m -Var=cellVoltage_170_invalidFlag unsigned 9,1 -m -Var=cellVoltage_171_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_168_171 0,8 2Ah -m +Var=cellVoltage_168_invalidFlag bit 11,1 -m +Var=cellVoltage_169_invalidFlag bit 10,1 -m +Var=cellVoltage_170_invalidFlag bit 9,1 -m +Var=cellVoltage_171_invalidFlag bit 8,1 -m Var=cellVoltage_168 unsigned 12,13 -m /u:mV Var=cellVoltage_169 unsigned 25,13 -m /u:mV Var=cellVoltage_170 unsigned 38,13 -m /u:mV Var=cellVoltage_171 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_172_175 0,8 2Bh -m -Var=cellVoltage_172_invalidFlag unsigned 11,1 -m -Var=cellVoltage_173_invalidFlag unsigned 10,1 -m -Var=cellVoltage_174_invalidFlag unsigned 9,1 -m -Var=cellVoltage_175_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_172_175 0,8 2Bh -m +Var=cellVoltage_172_invalidFlag bit 11,1 -m +Var=cellVoltage_173_invalidFlag bit 10,1 -m +Var=cellVoltage_174_invalidFlag bit 9,1 -m +Var=cellVoltage_175_invalidFlag bit 8,1 -m Var=cellVoltage_172 unsigned 12,13 -m /u:mV Var=cellVoltage_173 unsigned 25,13 -m /u:mV Var=cellVoltage_174 unsigned 38,13 -m /u:mV Var=cellVoltage_175 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_176_179 0,8 2Ch -m -Var=cellVoltage_176_invalidFlag unsigned 11,1 -m -Var=cellVoltage_177_invalidFlag unsigned 10,1 -m -Var=cellVoltage_178_invalidFlag unsigned 9,1 -m -Var=cellVoltage_179_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_176_179 0,8 2Ch -m +Var=cellVoltage_176_invalidFlag bit 11,1 -m +Var=cellVoltage_177_invalidFlag bit 10,1 -m +Var=cellVoltage_178_invalidFlag bit 9,1 -m +Var=cellVoltage_179_invalidFlag bit 8,1 -m Var=cellVoltage_176 unsigned 12,13 -m /u:mV Var=cellVoltage_177 unsigned 25,13 -m /u:mV Var=cellVoltage_178 unsigned 38,13 -m /u:mV Var=cellVoltage_179 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_180_183 0,8 2Dh -m -Var=cellVoltage_180_invalidFlag unsigned 11,1 -m -Var=cellVoltage_181_invalidFlag unsigned 10,1 -m -Var=cellVoltage_182_invalidFlag unsigned 9,1 -m -Var=cellVoltage_183_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_180_183 0,8 2Dh -m +Var=cellVoltage_180_invalidFlag bit 11,1 -m +Var=cellVoltage_181_invalidFlag bit 10,1 -m +Var=cellVoltage_182_invalidFlag bit 9,1 -m +Var=cellVoltage_183_invalidFlag bit 8,1 -m Var=cellVoltage_180 unsigned 12,13 -m /u:mV Var=cellVoltage_181 unsigned 25,13 -m /u:mV Var=cellVoltage_182 unsigned 38,13 -m /u:mV Var=cellVoltage_183 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_184_187 0,8 2Eh -m -Var=cellVoltage_184_invalidFlag unsigned 11,1 -m -Var=cellVoltage_185_invalidFlag unsigned 10,1 -m -Var=cellVoltage_186_invalidFlag unsigned 9,1 -m -Var=cellVoltage_187_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_184_187 0,8 2Eh -m +Var=cellVoltage_184_invalidFlag bit 11,1 -m +Var=cellVoltage_185_invalidFlag bit 10,1 -m +Var=cellVoltage_186_invalidFlag bit 9,1 -m +Var=cellVoltage_187_invalidFlag bit 8,1 -m Var=cellVoltage_184 unsigned 12,13 -m /u:mV Var=cellVoltage_185 unsigned 25,13 -m /u:mV Var=cellVoltage_186 unsigned 38,13 -m /u:mV Var=cellVoltage_187 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_188_191 0,8 2Fh -m -Var=cellVoltage_188_invalidFlag unsigned 11,1 -m -Var=cellVoltage_189_invalidFlag unsigned 10,1 -m -Var=cellVoltage_190_invalidFlag unsigned 9,1 -m -Var=cellVoltage_191_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_188_191 0,8 2Fh -m +Var=cellVoltage_188_invalidFlag bit 11,1 -m +Var=cellVoltage_189_invalidFlag bit 10,1 -m +Var=cellVoltage_190_invalidFlag bit 9,1 -m +Var=cellVoltage_191_invalidFlag bit 8,1 -m Var=cellVoltage_188 unsigned 12,13 -m /u:mV Var=cellVoltage_189 unsigned 25,13 -m /u:mV Var=cellVoltage_190 unsigned 38,13 -m /u:mV Var=cellVoltage_191 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_192_195 0,8 30h -m -Var=cellVoltage_192_invalidFlag unsigned 11,1 -m -Var=cellVoltage_193_invalidFlag unsigned 10,1 -m -Var=cellVoltage_194_invalidFlag unsigned 9,1 -m -Var=cellVoltage_195_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_192_195 0,8 30h -m +Var=cellVoltage_192_invalidFlag bit 11,1 -m +Var=cellVoltage_193_invalidFlag bit 10,1 -m +Var=cellVoltage_194_invalidFlag bit 9,1 -m +Var=cellVoltage_195_invalidFlag bit 8,1 -m Var=cellVoltage_192 unsigned 12,13 -m /u:mV Var=cellVoltage_193 unsigned 25,13 -m /u:mV Var=cellVoltage_194 unsigned 38,13 -m /u:mV Var=cellVoltage_195 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_196_199 0,8 31h -m -Var=cellVoltage_196_invalidFlag unsigned 11,1 -m -Var=cellVoltage_197_invalidFlag unsigned 10,1 -m -Var=cellVoltage_198_invalidFlag unsigned 9,1 -m -Var=cellVoltage_199_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_196_199 0,8 31h -m +Var=cellVoltage_196_invalidFlag bit 11,1 -m +Var=cellVoltage_197_invalidFlag bit 10,1 -m +Var=cellVoltage_198_invalidFlag bit 9,1 -m +Var=cellVoltage_199_invalidFlag bit 8,1 -m Var=cellVoltage_196 unsigned 12,13 -m /u:mV Var=cellVoltage_197 unsigned 25,13 -m /u:mV Var=cellVoltage_198 unsigned 38,13 -m /u:mV Var=cellVoltage_199 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_200_203 0,8 32h -m -Var=cellVoltage_200_invalidFlag unsigned 11,1 -m -Var=cellVoltage_201_invalidFlag unsigned 10,1 -m -Var=cellVoltage_202_invalidFlag unsigned 9,1 -m -Var=cellVoltage_203_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_200_203 0,8 32h -m +Var=cellVoltage_200_invalidFlag bit 11,1 -m +Var=cellVoltage_201_invalidFlag bit 10,1 -m +Var=cellVoltage_202_invalidFlag bit 9,1 -m +Var=cellVoltage_203_invalidFlag bit 8,1 -m Var=cellVoltage_200 unsigned 12,13 -m /u:mV Var=cellVoltage_201 unsigned 25,13 -m /u:mV Var=cellVoltage_202 unsigned 38,13 -m /u:mV Var=cellVoltage_203 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_204_207 0,8 33h -m -Var=cellVoltage_204_invalidFlag unsigned 11,1 -m -Var=cellVoltage_205_invalidFlag unsigned 10,1 -m -Var=cellVoltage_206_invalidFlag unsigned 9,1 -m -Var=cellVoltage_207_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_204_207 0,8 33h -m +Var=cellVoltage_204_invalidFlag bit 11,1 -m +Var=cellVoltage_205_invalidFlag bit 10,1 -m +Var=cellVoltage_206_invalidFlag bit 9,1 -m +Var=cellVoltage_207_invalidFlag bit 8,1 -m Var=cellVoltage_204 unsigned 12,13 -m /u:mV Var=cellVoltage_205 unsigned 25,13 -m /u:mV Var=cellVoltage_206 unsigned 38,13 -m /u:mV Var=cellVoltage_207 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_208_211 0,8 34h -m -Var=cellVoltage_208_invalidFlag unsigned 11,1 -m -Var=cellVoltage_209_invalidFlag unsigned 10,1 -m -Var=cellVoltage_210_invalidFlag unsigned 9,1 -m -Var=cellVoltage_211_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_208_211 0,8 34h -m +Var=cellVoltage_208_invalidFlag bit 11,1 -m +Var=cellVoltage_209_invalidFlag bit 10,1 -m +Var=cellVoltage_210_invalidFlag bit 9,1 -m +Var=cellVoltage_211_invalidFlag bit 8,1 -m Var=cellVoltage_208 unsigned 12,13 -m /u:mV Var=cellVoltage_209 unsigned 25,13 -m /u:mV Var=cellVoltage_210 unsigned 38,13 -m /u:mV Var=cellVoltage_211 unsigned 51,13 -m /u:mV -[foxBMS_CellVoltage] -DLC=8 -Mux=mux_cellVoltage_212_215 0,8 35h -m -Var=cellVoltage_212_invalidFlag unsigned 11,1 -m -Var=cellVoltage_213_invalidFlag unsigned 10,1 -m -Var=cellVoltage_214_invalidFlag unsigned 9,1 -m -Var=cellVoltage_215_invalidFlag unsigned 8,1 -m +[foxBMS_CellVoltages] +Len=8 +CycleTime=5400 -p +Mux=mux_cellVoltage_212_215 0,8 35h -m +Var=cellVoltage_212_invalidFlag bit 11,1 -m +Var=cellVoltage_213_invalidFlag bit 10,1 -m +Var=cellVoltage_214_invalidFlag bit 9,1 -m +Var=cellVoltage_215_invalidFlag bit 8,1 -m Var=cellVoltage_212 unsigned 12,13 -m /u:mV Var=cellVoltage_213 unsigned 25,13 -m /u:mV Var=cellVoltage_214 unsigned 38,13 -m /u:mV Var=cellVoltage_215 unsigned 51,13 -m /u:mV -[foxBMS_CellTemperature] -ID=250h // (in:can_cbs_tx_temperature.c:CAN_TxCellTemperature) -DLC=8 -Mux=mux_cellTemperature_000_005 0,8 0 -m -Var=cellTemperature_000_invalidFlag unsigned 15,1 -m -Var=cellTemperature_001_invalidFlag unsigned 14,1 -m -Var=cellTemperature_002_invalidFlag unsigned 13,1 -m -Var=cellTemperature_003_invalidFlag unsigned 12,1 -m -Var=cellTemperature_004_invalidFlag unsigned 11,1 -m -Var=cellTemperature_005_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +ID=250h // (in:can_cbs_tx_cell-temperatures.c:CANTX_CellTemperatures, fv:tx) +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_000_005 0,8 0 -m +Var=cellTemperature_000_invalidFlag bit 15,1 -m +Var=cellTemperature_001_invalidFlag bit 14,1 -m +Var=cellTemperature_002_invalidFlag bit 13,1 -m +Var=cellTemperature_003_invalidFlag bit 12,1 -m +Var=cellTemperature_004_invalidFlag bit 11,1 -m +Var=cellTemperature_005_invalidFlag bit 10,1 -m Var=cellTemperature_000 signed 16,8 -m /u:degC Var=cellTemperature_001 signed 24,8 -m /u:degC Var=cellTemperature_002 signed 32,8 -m /u:degC @@ -755,15 +794,16 @@ Var=cellTemperature_003 signed 40,8 -m /u:degC Var=cellTemperature_004 signed 48,8 -m /u:degC Var=cellTemperature_005 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_006_011 0,8 1 -m -Var=cellTemperature_006_invalidFlag unsigned 15,1 -m -Var=cellTemperature_007_invalidFlag unsigned 14,1 -m -Var=cellTemperature_008_invalidFlag unsigned 13,1 -m -Var=cellTemperature_009_invalidFlag unsigned 12,1 -m -Var=cellTemperature_010_invalidFlag unsigned 11,1 -m -Var=cellTemperature_011_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_006_011 0,8 1 -m +Var=cellTemperature_006_invalidFlag bit 15,1 -m +Var=cellTemperature_007_invalidFlag bit 14,1 -m +Var=cellTemperature_008_invalidFlag bit 13,1 -m +Var=cellTemperature_009_invalidFlag bit 12,1 -m +Var=cellTemperature_010_invalidFlag bit 11,1 -m +Var=cellTemperature_011_invalidFlag bit 10,1 -m Var=cellTemperature_006 signed 16,8 -m /u:degC Var=cellTemperature_007 signed 24,8 -m /u:degC Var=cellTemperature_008 signed 32,8 -m /u:degC @@ -771,15 +811,16 @@ Var=cellTemperature_009 signed 40,8 -m /u:degC Var=cellTemperature_010 signed 48,8 -m /u:degC Var=cellTemperature_011 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_012_017 0,8 2 -m -Var=cellTemperature_012_invalidFlag unsigned 15,1 -m -Var=cellTemperature_013_invalidFlag unsigned 14,1 -m -Var=cellTemperature_014_invalidFlag unsigned 13,1 -m -Var=cellTemperature_015_invalidFlag unsigned 12,1 -m -Var=cellTemperature_016_invalidFlag unsigned 11,1 -m -Var=cellTemperature_017_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_012_017 0,8 2 -m +Var=cellTemperature_012_invalidFlag bit 15,1 -m +Var=cellTemperature_013_invalidFlag bit 14,1 -m +Var=cellTemperature_014_invalidFlag bit 13,1 -m +Var=cellTemperature_015_invalidFlag bit 12,1 -m +Var=cellTemperature_016_invalidFlag bit 11,1 -m +Var=cellTemperature_017_invalidFlag bit 10,1 -m Var=cellTemperature_012 signed 16,8 -m /u:degC Var=cellTemperature_013 signed 24,8 -m /u:degC Var=cellTemperature_014 signed 32,8 -m /u:degC @@ -787,15 +828,16 @@ Var=cellTemperature_015 signed 40,8 -m /u:degC Var=cellTemperature_016 signed 48,8 -m /u:degC Var=cellTemperature_017 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_018_023 0,8 3 -m -Var=cellTemperature_018_invalidFlag unsigned 15,1 -m -Var=cellTemperature_019_invalidFlag unsigned 14,1 -m -Var=cellTemperature_020_invalidFlag unsigned 13,1 -m -Var=cellTemperature_021_invalidFlag unsigned 12,1 -m -Var=cellTemperature_022_invalidFlag unsigned 11,1 -m -Var=cellTemperature_023_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_018_023 0,8 3 -m +Var=cellTemperature_018_invalidFlag bit 15,1 -m +Var=cellTemperature_019_invalidFlag bit 14,1 -m +Var=cellTemperature_020_invalidFlag bit 13,1 -m +Var=cellTemperature_021_invalidFlag bit 12,1 -m +Var=cellTemperature_022_invalidFlag bit 11,1 -m +Var=cellTemperature_023_invalidFlag bit 10,1 -m Var=cellTemperature_018 signed 16,8 -m /u:degC Var=cellTemperature_019 signed 24,8 -m /u:degC Var=cellTemperature_020 signed 32,8 -m /u:degC @@ -803,15 +845,16 @@ Var=cellTemperature_021 signed 40,8 -m /u:degC Var=cellTemperature_022 signed 48,8 -m /u:degC Var=cellTemperature_023 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_024_029 0,8 4 -m -Var=cellTemperature_024_invalidFlag unsigned 15,1 -m -Var=cellTemperature_025_invalidFlag unsigned 14,1 -m -Var=cellTemperature_026_invalidFlag unsigned 13,1 -m -Var=cellTemperature_027_invalidFlag unsigned 12,1 -m -Var=cellTemperature_028_invalidFlag unsigned 11,1 -m -Var=cellTemperature_029_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_024_029 0,8 4 -m +Var=cellTemperature_024_invalidFlag bit 15,1 -m +Var=cellTemperature_025_invalidFlag bit 14,1 -m +Var=cellTemperature_026_invalidFlag bit 13,1 -m +Var=cellTemperature_027_invalidFlag bit 12,1 -m +Var=cellTemperature_028_invalidFlag bit 11,1 -m +Var=cellTemperature_029_invalidFlag bit 10,1 -m Var=cellTemperature_024 signed 16,8 -m /u:degC Var=cellTemperature_025 signed 24,8 -m /u:degC Var=cellTemperature_026 signed 32,8 -m /u:degC @@ -819,15 +862,16 @@ Var=cellTemperature_027 signed 40,8 -m /u:degC Var=cellTemperature_028 signed 48,8 -m /u:degC Var=cellTemperature_029 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_030_035 0,8 5 -m -Var=cellTemperature_030_invalidFlag unsigned 15,1 -m -Var=cellTemperature_031_invalidFlag unsigned 14,1 -m -Var=cellTemperature_032_invalidFlag unsigned 13,1 -m -Var=cellTemperature_033_invalidFlag unsigned 12,1 -m -Var=cellTemperature_034_invalidFlag unsigned 11,1 -m -Var=cellTemperature_035_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_030_035 0,8 5 -m +Var=cellTemperature_030_invalidFlag bit 15,1 -m +Var=cellTemperature_031_invalidFlag bit 14,1 -m +Var=cellTemperature_032_invalidFlag bit 13,1 -m +Var=cellTemperature_033_invalidFlag bit 12,1 -m +Var=cellTemperature_034_invalidFlag bit 11,1 -m +Var=cellTemperature_035_invalidFlag bit 10,1 -m Var=cellTemperature_030 signed 16,8 -m /u:degC Var=cellTemperature_031 signed 24,8 -m /u:degC Var=cellTemperature_032 signed 32,8 -m /u:degC @@ -835,15 +879,16 @@ Var=cellTemperature_033 signed 40,8 -m /u:degC Var=cellTemperature_034 signed 48,8 -m /u:degC Var=cellTemperature_035 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_036_041 0,8 6 -m -Var=cellTemperature_036_invalidFlag unsigned 15,1 -m -Var=cellTemperature_037_invalidFlag unsigned 14,1 -m -Var=cellTemperature_038_invalidFlag unsigned 13,1 -m -Var=cellTemperature_039_invalidFlag unsigned 12,1 -m -Var=cellTemperature_040_invalidFlag unsigned 11,1 -m -Var=cellTemperature_041_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_036_041 0,8 6 -m +Var=cellTemperature_036_invalidFlag bit 15,1 -m +Var=cellTemperature_037_invalidFlag bit 14,1 -m +Var=cellTemperature_038_invalidFlag bit 13,1 -m +Var=cellTemperature_039_invalidFlag bit 12,1 -m +Var=cellTemperature_040_invalidFlag bit 11,1 -m +Var=cellTemperature_041_invalidFlag bit 10,1 -m Var=cellTemperature_036 signed 16,8 -m /u:degC Var=cellTemperature_037 signed 24,8 -m /u:degC Var=cellTemperature_038 signed 32,8 -m /u:degC @@ -851,15 +896,16 @@ Var=cellTemperature_039 signed 40,8 -m /u:degC Var=cellTemperature_040 signed 48,8 -m /u:degC Var=cellTemperature_041 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_042_047 0,8 7 -m -Var=cellTemperature_042_invalidFlag unsigned 15,1 -m -Var=cellTemperature_043_invalidFlag unsigned 14,1 -m -Var=cellTemperature_044_invalidFlag unsigned 13,1 -m -Var=cellTemperature_045_invalidFlag unsigned 12,1 -m -Var=cellTemperature_046_invalidFlag unsigned 11,1 -m -Var=cellTemperature_047_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_042_047 0,8 7 -m +Var=cellTemperature_042_invalidFlag bit 15,1 -m +Var=cellTemperature_043_invalidFlag bit 14,1 -m +Var=cellTemperature_044_invalidFlag bit 13,1 -m +Var=cellTemperature_045_invalidFlag bit 12,1 -m +Var=cellTemperature_046_invalidFlag bit 11,1 -m +Var=cellTemperature_047_invalidFlag bit 10,1 -m Var=cellTemperature_042 signed 16,8 -m /u:degC Var=cellTemperature_043 signed 24,8 -m /u:degC Var=cellTemperature_044 signed 32,8 -m /u:degC @@ -867,15 +913,16 @@ Var=cellTemperature_045 signed 40,8 -m /u:degC Var=cellTemperature_046 signed 48,8 -m /u:degC Var=cellTemperature_047 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_048_053 0,8 8 -m -Var=cellTemperature_048_invalidFlag unsigned 15,1 -m -Var=cellTemperature_049_invalidFlag unsigned 14,1 -m -Var=cellTemperature_050_invalidFlag unsigned 13,1 -m -Var=cellTemperature_051_invalidFlag unsigned 12,1 -m -Var=cellTemperature_052_invalidFlag unsigned 11,1 -m -Var=cellTemperature_053_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_048_053 0,8 8 -m +Var=cellTemperature_048_invalidFlag bit 15,1 -m +Var=cellTemperature_049_invalidFlag bit 14,1 -m +Var=cellTemperature_050_invalidFlag bit 13,1 -m +Var=cellTemperature_051_invalidFlag bit 12,1 -m +Var=cellTemperature_052_invalidFlag bit 11,1 -m +Var=cellTemperature_053_invalidFlag bit 10,1 -m Var=cellTemperature_048 signed 16,8 -m /u:degC Var=cellTemperature_049 signed 24,8 -m /u:degC Var=cellTemperature_050 signed 32,8 -m /u:degC @@ -883,15 +930,16 @@ Var=cellTemperature_051 signed 40,8 -m /u:degC Var=cellTemperature_052 signed 48,8 -m /u:degC Var=cellTemperature_053 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_054_059 0,8 9 -m -Var=cellTemperature_054_invalidFlag unsigned 15,1 -m -Var=cellTemperature_055_invalidFlag unsigned 14,1 -m -Var=cellTemperature_056_invalidFlag unsigned 13,1 -m -Var=cellTemperature_057_invalidFlag unsigned 12,1 -m -Var=cellTemperature_058_invalidFlag unsigned 11,1 -m -Var=cellTemperature_059_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_054_059 0,8 9 -m +Var=cellTemperature_054_invalidFlag bit 15,1 -m +Var=cellTemperature_055_invalidFlag bit 14,1 -m +Var=cellTemperature_056_invalidFlag bit 13,1 -m +Var=cellTemperature_057_invalidFlag bit 12,1 -m +Var=cellTemperature_058_invalidFlag bit 11,1 -m +Var=cellTemperature_059_invalidFlag bit 10,1 -m Var=cellTemperature_054 signed 16,8 -m /u:degC Var=cellTemperature_055 signed 24,8 -m /u:degC Var=cellTemperature_056 signed 32,8 -m /u:degC @@ -899,15 +947,16 @@ Var=cellTemperature_057 signed 40,8 -m /u:degC Var=cellTemperature_058 signed 48,8 -m /u:degC Var=cellTemperature_059 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_060_065 0,8 0Ah -m -Var=cellTemperature_060_invalidFlag unsigned 15,1 -m -Var=cellTemperature_061_invalidFlag unsigned 14,1 -m -Var=cellTemperature_062_invalidFlag unsigned 13,1 -m -Var=cellTemperature_063_invalidFlag unsigned 12,1 -m -Var=cellTemperature_064_invalidFlag unsigned 11,1 -m -Var=cellTemperature_065_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_060_065 0,8 0Ah -m +Var=cellTemperature_060_invalidFlag bit 15,1 -m +Var=cellTemperature_061_invalidFlag bit 14,1 -m +Var=cellTemperature_062_invalidFlag bit 13,1 -m +Var=cellTemperature_063_invalidFlag bit 12,1 -m +Var=cellTemperature_064_invalidFlag bit 11,1 -m +Var=cellTemperature_065_invalidFlag bit 10,1 -m Var=cellTemperature_060 signed 16,8 -m /u:degC Var=cellTemperature_061 signed 24,8 -m /u:degC Var=cellTemperature_062 signed 32,8 -m /u:degC @@ -915,15 +964,16 @@ Var=cellTemperature_063 signed 40,8 -m /u:degC Var=cellTemperature_064 signed 48,8 -m /u:degC Var=cellTemperature_065 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_066_071 0,8 0Bh -m -Var=cellTemperature_066_invalidFlag unsigned 15,1 -m -Var=cellTemperature_067_invalidFlag unsigned 14,1 -m -Var=cellTemperature_068_invalidFlag unsigned 13,1 -m -Var=cellTemperature_069_invalidFlag unsigned 12,1 -m -Var=cellTemperature_070_invalidFlag unsigned 11,1 -m -Var=cellTemperature_071_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_066_071 0,8 0Bh -m +Var=cellTemperature_066_invalidFlag bit 15,1 -m +Var=cellTemperature_067_invalidFlag bit 14,1 -m +Var=cellTemperature_068_invalidFlag bit 13,1 -m +Var=cellTemperature_069_invalidFlag bit 12,1 -m +Var=cellTemperature_070_invalidFlag bit 11,1 -m +Var=cellTemperature_071_invalidFlag bit 10,1 -m Var=cellTemperature_066 signed 16,8 -m /u:degC Var=cellTemperature_067 signed 24,8 -m /u:degC Var=cellTemperature_068 signed 32,8 -m /u:degC @@ -931,15 +981,16 @@ Var=cellTemperature_069 signed 40,8 -m /u:degC Var=cellTemperature_070 signed 48,8 -m /u:degC Var=cellTemperature_071 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_072_077 0,8 0Ch -m -Var=cellTemperature_072_invalidFlag unsigned 15,1 -m -Var=cellTemperature_073_invalidFlag unsigned 14,1 -m -Var=cellTemperature_074_invalidFlag unsigned 13,1 -m -Var=cellTemperature_075_invalidFlag unsigned 12,1 -m -Var=cellTemperature_076_invalidFlag unsigned 11,1 -m -Var=cellTemperature_077_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_072_077 0,8 0Ch -m +Var=cellTemperature_072_invalidFlag bit 15,1 -m +Var=cellTemperature_073_invalidFlag bit 14,1 -m +Var=cellTemperature_074_invalidFlag bit 13,1 -m +Var=cellTemperature_075_invalidFlag bit 12,1 -m +Var=cellTemperature_076_invalidFlag bit 11,1 -m +Var=cellTemperature_077_invalidFlag bit 10,1 -m Var=cellTemperature_072 signed 16,8 -m /u:degC Var=cellTemperature_073 signed 24,8 -m /u:degC Var=cellTemperature_074 signed 32,8 -m /u:degC @@ -947,15 +998,16 @@ Var=cellTemperature_075 signed 40,8 -m /u:degC Var=cellTemperature_076 signed 48,8 -m /u:degC Var=cellTemperature_077 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_078_083 0,8 0Dh -m -Var=cellTemperature_078_invalidFlag unsigned 15,1 -m -Var=cellTemperature_079_invalidFlag unsigned 14,1 -m -Var=cellTemperature_080_invalidFlag unsigned 13,1 -m -Var=cellTemperature_081_invalidFlag unsigned 12,1 -m -Var=cellTemperature_082_invalidFlag unsigned 11,1 -m -Var=cellTemperature_083_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_078_083 0,8 0Dh -m +Var=cellTemperature_078_invalidFlag bit 15,1 -m +Var=cellTemperature_079_invalidFlag bit 14,1 -m +Var=cellTemperature_080_invalidFlag bit 13,1 -m +Var=cellTemperature_081_invalidFlag bit 12,1 -m +Var=cellTemperature_082_invalidFlag bit 11,1 -m +Var=cellTemperature_083_invalidFlag bit 10,1 -m Var=cellTemperature_078 signed 16,8 -m /u:degC Var=cellTemperature_079 signed 24,8 -m /u:degC Var=cellTemperature_080 signed 32,8 -m /u:degC @@ -963,15 +1015,16 @@ Var=cellTemperature_081 signed 40,8 -m /u:degC Var=cellTemperature_082 signed 48,8 -m /u:degC Var=cellTemperature_083 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_084_089 0,8 0Eh -m -Var=cellTemperature_084_invalidFlag unsigned 15,1 -m -Var=cellTemperature_085_invalidFlag unsigned 14,1 -m -Var=cellTemperature_086_invalidFlag unsigned 13,1 -m -Var=cellTemperature_087_invalidFlag unsigned 12,1 -m -Var=cellTemperature_088_invalidFlag unsigned 11,1 -m -Var=cellTemperature_089_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_084_089 0,8 0Eh -m +Var=cellTemperature_084_invalidFlag bit 15,1 -m +Var=cellTemperature_085_invalidFlag bit 14,1 -m +Var=cellTemperature_086_invalidFlag bit 13,1 -m +Var=cellTemperature_087_invalidFlag bit 12,1 -m +Var=cellTemperature_088_invalidFlag bit 11,1 -m +Var=cellTemperature_089_invalidFlag bit 10,1 -m Var=cellTemperature_084 signed 16,8 -m /u:degC Var=cellTemperature_085 signed 24,8 -m /u:degC Var=cellTemperature_086 signed 32,8 -m /u:degC @@ -979,15 +1032,16 @@ Var=cellTemperature_087 signed 40,8 -m /u:degC Var=cellTemperature_088 signed 48,8 -m /u:degC Var=cellTemperature_089 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_090_095 0,8 0Fh -m -Var=cellTemperature_090_invalidFlag unsigned 15,1 -m -Var=cellTemperature_091_invalidFlag unsigned 14,1 -m -Var=cellTemperature_092_invalidFlag unsigned 13,1 -m -Var=cellTemperature_093_invalidFlag unsigned 12,1 -m -Var=cellTemperature_094_invalidFlag unsigned 11,1 -m -Var=cellTemperature_095_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_090_095 0,8 0Fh -m +Var=cellTemperature_090_invalidFlag bit 15,1 -m +Var=cellTemperature_091_invalidFlag bit 14,1 -m +Var=cellTemperature_092_invalidFlag bit 13,1 -m +Var=cellTemperature_093_invalidFlag bit 12,1 -m +Var=cellTemperature_094_invalidFlag bit 11,1 -m +Var=cellTemperature_095_invalidFlag bit 10,1 -m Var=cellTemperature_090 signed 16,8 -m /u:degC Var=cellTemperature_091 signed 24,8 -m /u:degC Var=cellTemperature_092 signed 32,8 -m /u:degC @@ -995,15 +1049,16 @@ Var=cellTemperature_093 signed 40,8 -m /u:degC Var=cellTemperature_094 signed 48,8 -m /u:degC Var=cellTemperature_095 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_096_101 0,8 10h -m -Var=cellTemperature_096_invalidFlag unsigned 15,1 -m -Var=cellTemperature_097_invalidFlag unsigned 14,1 -m -Var=cellTemperature_098_invalidFlag unsigned 13,1 -m -Var=cellTemperature_099_invalidFlag unsigned 12,1 -m -Var=cellTemperature_100_invalidFlag unsigned 11,1 -m -Var=cellTemperature_101_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_096_101 0,8 10h -m +Var=cellTemperature_096_invalidFlag bit 15,1 -m +Var=cellTemperature_097_invalidFlag bit 14,1 -m +Var=cellTemperature_098_invalidFlag bit 13,1 -m +Var=cellTemperature_099_invalidFlag bit 12,1 -m +Var=cellTemperature_100_invalidFlag bit 11,1 -m +Var=cellTemperature_101_invalidFlag bit 10,1 -m Var=cellTemperature_096 signed 16,8 -m /u:degC Var=cellTemperature_097 signed 24,8 -m /u:degC Var=cellTemperature_098 signed 32,8 -m /u:degC @@ -1011,15 +1066,16 @@ Var=cellTemperature_099 signed 40,8 -m /u:degC Var=cellTemperature_100 signed 48,8 -m /u:degC Var=cellTemperature_101 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_102_107 0,8 11h -m -Var=cellTemperature_102_invalidFlag unsigned 15,1 -m -Var=cellTemperature_103_invalidFlag unsigned 14,1 -m -Var=cellTemperature_104_invalidFlag unsigned 13,1 -m -Var=cellTemperature_105_invalidFlag unsigned 12,1 -m -Var=cellTemperature_106_invalidFlag unsigned 11,1 -m -Var=cellTemperature_107_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_102_107 0,8 11h -m +Var=cellTemperature_102_invalidFlag bit 15,1 -m +Var=cellTemperature_103_invalidFlag bit 14,1 -m +Var=cellTemperature_104_invalidFlag bit 13,1 -m +Var=cellTemperature_105_invalidFlag bit 12,1 -m +Var=cellTemperature_106_invalidFlag bit 11,1 -m +Var=cellTemperature_107_invalidFlag bit 10,1 -m Var=cellTemperature_102 signed 16,8 -m /u:degC Var=cellTemperature_103 signed 24,8 -m /u:degC Var=cellTemperature_104 signed 32,8 -m /u:degC @@ -1027,15 +1083,16 @@ Var=cellTemperature_105 signed 40,8 -m /u:degC Var=cellTemperature_106 signed 48,8 -m /u:degC Var=cellTemperature_107 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_108_113 0,8 12h -m -Var=cellTemperature_108_invalidFlag unsigned 15,1 -m -Var=cellTemperature_109_invalidFlag unsigned 14,1 -m -Var=cellTemperature_110_invalidFlag unsigned 13,1 -m -Var=cellTemperature_111_invalidFlag unsigned 12,1 -m -Var=cellTemperature_112_invalidFlag unsigned 11,1 -m -Var=cellTemperature_113_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_108_113 0,8 12h -m +Var=cellTemperature_108_invalidFlag bit 15,1 -m +Var=cellTemperature_109_invalidFlag bit 14,1 -m +Var=cellTemperature_110_invalidFlag bit 13,1 -m +Var=cellTemperature_111_invalidFlag bit 12,1 -m +Var=cellTemperature_112_invalidFlag bit 11,1 -m +Var=cellTemperature_113_invalidFlag bit 10,1 -m Var=cellTemperature_108 signed 16,8 -m /u:degC Var=cellTemperature_109 signed 24,8 -m /u:degC Var=cellTemperature_110 signed 32,8 -m /u:degC @@ -1043,15 +1100,16 @@ Var=cellTemperature_111 signed 40,8 -m /u:degC Var=cellTemperature_112 signed 48,8 -m /u:degC Var=cellTemperature_113 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_114_119 0,8 13h -m -Var=cellTemperature_114_invalidFlag unsigned 15,1 -m -Var=cellTemperature_115_invalidFlag unsigned 14,1 -m -Var=cellTemperature_116_invalidFlag unsigned 13,1 -m -Var=cellTemperature_117_invalidFlag unsigned 12,1 -m -Var=cellTemperature_118_invalidFlag unsigned 11,1 -m -Var=cellTemperature_119_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_114_119 0,8 13h -m +Var=cellTemperature_114_invalidFlag bit 15,1 -m +Var=cellTemperature_115_invalidFlag bit 14,1 -m +Var=cellTemperature_116_invalidFlag bit 13,1 -m +Var=cellTemperature_117_invalidFlag bit 12,1 -m +Var=cellTemperature_118_invalidFlag bit 11,1 -m +Var=cellTemperature_119_invalidFlag bit 10,1 -m Var=cellTemperature_114 signed 16,8 -m /u:degC Var=cellTemperature_115 signed 24,8 -m /u:degC Var=cellTemperature_116 signed 32,8 -m /u:degC @@ -1059,15 +1117,16 @@ Var=cellTemperature_117 signed 40,8 -m /u:degC Var=cellTemperature_118 signed 48,8 -m /u:degC Var=cellTemperature_119 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_120_125 0,8 14h -m -Var=cellTemperature_120_invalidFlag unsigned 15,1 -m -Var=cellTemperature_121_invalidFlag unsigned 14,1 -m -Var=cellTemperature_122_invalidFlag unsigned 13,1 -m -Var=cellTemperature_123_invalidFlag unsigned 12,1 -m -Var=cellTemperature_124_invalidFlag unsigned 11,1 -m -Var=cellTemperature_125_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_120_125 0,8 14h -m +Var=cellTemperature_120_invalidFlag bit 15,1 -m +Var=cellTemperature_121_invalidFlag bit 14,1 -m +Var=cellTemperature_122_invalidFlag bit 13,1 -m +Var=cellTemperature_123_invalidFlag bit 12,1 -m +Var=cellTemperature_124_invalidFlag bit 11,1 -m +Var=cellTemperature_125_invalidFlag bit 10,1 -m Var=cellTemperature_120 signed 16,8 -m /u:degC Var=cellTemperature_121 signed 24,8 -m /u:degC Var=cellTemperature_122 signed 32,8 -m /u:degC @@ -1075,15 +1134,16 @@ Var=cellTemperature_123 signed 40,8 -m /u:degC Var=cellTemperature_124 signed 48,8 -m /u:degC Var=cellTemperature_125 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_126_131 0,8 15h -m -Var=cellTemperature_126_invalidFlag unsigned 15,1 -m -Var=cellTemperature_127_invalidFlag unsigned 14,1 -m -Var=cellTemperature_128_invalidFlag unsigned 13,1 -m -Var=cellTemperature_129_invalidFlag unsigned 12,1 -m -Var=cellTemperature_130_invalidFlag unsigned 11,1 -m -Var=cellTemperature_131_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_126_131 0,8 15h -m +Var=cellTemperature_126_invalidFlag bit 15,1 -m +Var=cellTemperature_127_invalidFlag bit 14,1 -m +Var=cellTemperature_128_invalidFlag bit 13,1 -m +Var=cellTemperature_129_invalidFlag bit 12,1 -m +Var=cellTemperature_130_invalidFlag bit 11,1 -m +Var=cellTemperature_131_invalidFlag bit 10,1 -m Var=cellTemperature_126 signed 16,8 -m /u:degC Var=cellTemperature_127 signed 24,8 -m /u:degC Var=cellTemperature_128 signed 32,8 -m /u:degC @@ -1091,15 +1151,16 @@ Var=cellTemperature_129 signed 40,8 -m /u:degC Var=cellTemperature_130 signed 48,8 -m /u:degC Var=cellTemperature_131 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_132_137 0,8 16h -m -Var=cellTemperature_132_invalidFlag unsigned 15,1 -m -Var=cellTemperature_133_invalidFlag unsigned 14,1 -m -Var=cellTemperature_134_invalidFlag unsigned 13,1 -m -Var=cellTemperature_135_invalidFlag unsigned 12,1 -m -Var=cellTemperature_136_invalidFlag unsigned 11,1 -m -Var=cellTemperature_137_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_132_137 0,8 16h -m +Var=cellTemperature_132_invalidFlag bit 15,1 -m +Var=cellTemperature_133_invalidFlag bit 14,1 -m +Var=cellTemperature_134_invalidFlag bit 13,1 -m +Var=cellTemperature_135_invalidFlag bit 12,1 -m +Var=cellTemperature_136_invalidFlag bit 11,1 -m +Var=cellTemperature_137_invalidFlag bit 10,1 -m Var=cellTemperature_132 signed 16,8 -m /u:degC Var=cellTemperature_133 signed 24,8 -m /u:degC Var=cellTemperature_134 signed 32,8 -m /u:degC @@ -1107,15 +1168,16 @@ Var=cellTemperature_135 signed 40,8 -m /u:degC Var=cellTemperature_136 signed 48,8 -m /u:degC Var=cellTemperature_137 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_138_143 0,8 17h -m -Var=cellTemperature_138_invalidFlag unsigned 15,1 -m -Var=cellTemperature_139_invalidFlag unsigned 14,1 -m -Var=cellTemperature_140_invalidFlag unsigned 13,1 -m -Var=cellTemperature_141_invalidFlag unsigned 12,1 -m -Var=cellTemperature_142_invalidFlag unsigned 11,1 -m -Var=cellTemperature_143_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_138_143 0,8 17h -m +Var=cellTemperature_138_invalidFlag bit 15,1 -m +Var=cellTemperature_139_invalidFlag bit 14,1 -m +Var=cellTemperature_140_invalidFlag bit 13,1 -m +Var=cellTemperature_141_invalidFlag bit 12,1 -m +Var=cellTemperature_142_invalidFlag bit 11,1 -m +Var=cellTemperature_143_invalidFlag bit 10,1 -m Var=cellTemperature_138 signed 16,8 -m /u:degC Var=cellTemperature_139 signed 24,8 -m /u:degC Var=cellTemperature_140 signed 32,8 -m /u:degC @@ -1123,15 +1185,16 @@ Var=cellTemperature_141 signed 40,8 -m /u:degC Var=cellTemperature_142 signed 48,8 -m /u:degC Var=cellTemperature_143 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_144_149 0,8 18h -m -Var=cellTemperature_144_invalidFlag unsigned 15,1 -m -Var=cellTemperature_145_invalidFlag unsigned 14,1 -m -Var=cellTemperature_146_invalidFlag unsigned 13,1 -m -Var=cellTemperature_147_invalidFlag unsigned 12,1 -m -Var=cellTemperature_148_invalidFlag unsigned 11,1 -m -Var=cellTemperature_149_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_144_149 0,8 18h -m +Var=cellTemperature_144_invalidFlag bit 15,1 -m +Var=cellTemperature_145_invalidFlag bit 14,1 -m +Var=cellTemperature_146_invalidFlag bit 13,1 -m +Var=cellTemperature_147_invalidFlag bit 12,1 -m +Var=cellTemperature_148_invalidFlag bit 11,1 -m +Var=cellTemperature_149_invalidFlag bit 10,1 -m Var=cellTemperature_144 signed 16,8 -m /u:degC Var=cellTemperature_145 signed 24,8 -m /u:degC Var=cellTemperature_146 signed 32,8 -m /u:degC @@ -1139,15 +1202,16 @@ Var=cellTemperature_147 signed 40,8 -m /u:degC Var=cellTemperature_148 signed 48,8 -m /u:degC Var=cellTemperature_149 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_150_155 0,8 19h -m -Var=cellTemperature_150_invalidFlag unsigned 15,1 -m -Var=cellTemperature_151_invalidFlag unsigned 14,1 -m -Var=cellTemperature_152_invalidFlag unsigned 13,1 -m -Var=cellTemperature_153_invalidFlag unsigned 12,1 -m -Var=cellTemperature_154_invalidFlag unsigned 11,1 -m -Var=cellTemperature_155_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_150_155 0,8 19h -m +Var=cellTemperature_150_invalidFlag bit 15,1 -m +Var=cellTemperature_151_invalidFlag bit 14,1 -m +Var=cellTemperature_152_invalidFlag bit 13,1 -m +Var=cellTemperature_153_invalidFlag bit 12,1 -m +Var=cellTemperature_154_invalidFlag bit 11,1 -m +Var=cellTemperature_155_invalidFlag bit 10,1 -m Var=cellTemperature_150 signed 16,8 -m /u:degC Var=cellTemperature_151 signed 24,8 -m /u:degC Var=cellTemperature_152 signed 32,8 -m /u:degC @@ -1155,15 +1219,16 @@ Var=cellTemperature_153 signed 40,8 -m /u:degC Var=cellTemperature_154 signed 48,8 -m /u:degC Var=cellTemperature_155 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_156_161 0,8 1Ah -m -Var=cellTemperature_156_invalidFlag unsigned 15,1 -m -Var=cellTemperature_157_invalidFlag unsigned 14,1 -m -Var=cellTemperature_158_invalidFlag unsigned 13,1 -m -Var=cellTemperature_159_invalidFlag unsigned 12,1 -m -Var=cellTemperature_160_invalidFlag unsigned 11,1 -m -Var=cellTemperature_161_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_156_161 0,8 1Ah -m +Var=cellTemperature_156_invalidFlag bit 15,1 -m +Var=cellTemperature_157_invalidFlag bit 14,1 -m +Var=cellTemperature_158_invalidFlag bit 13,1 -m +Var=cellTemperature_159_invalidFlag bit 12,1 -m +Var=cellTemperature_160_invalidFlag bit 11,1 -m +Var=cellTemperature_161_invalidFlag bit 10,1 -m Var=cellTemperature_156 signed 16,8 -m /u:degC Var=cellTemperature_157 signed 24,8 -m /u:degC Var=cellTemperature_158 signed 32,8 -m /u:degC @@ -1171,15 +1236,16 @@ Var=cellTemperature_159 signed 40,8 -m /u:degC Var=cellTemperature_160 signed 48,8 -m /u:degC Var=cellTemperature_161 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_162_167 0,8 1Bh -m -Var=cellTemperature_162_invalidFlag unsigned 15,1 -m -Var=cellTemperature_163_invalidFlag unsigned 14,1 -m -Var=cellTemperature_164_invalidFlag unsigned 13,1 -m -Var=cellTemperature_165_invalidFlag unsigned 12,1 -m -Var=cellTemperature_166_invalidFlag unsigned 11,1 -m -Var=cellTemperature_167_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_162_167 0,8 1Bh -m +Var=cellTemperature_162_invalidFlag bit 15,1 -m +Var=cellTemperature_163_invalidFlag bit 14,1 -m +Var=cellTemperature_164_invalidFlag bit 13,1 -m +Var=cellTemperature_165_invalidFlag bit 12,1 -m +Var=cellTemperature_166_invalidFlag bit 11,1 -m +Var=cellTemperature_167_invalidFlag bit 10,1 -m Var=cellTemperature_162 signed 16,8 -m /u:degC Var=cellTemperature_163 signed 24,8 -m /u:degC Var=cellTemperature_164 signed 32,8 -m /u:degC @@ -1187,15 +1253,16 @@ Var=cellTemperature_165 signed 40,8 -m /u:degC Var=cellTemperature_166 signed 48,8 -m /u:degC Var=cellTemperature_167 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_168_173 0,8 1Ch -m -Var=cellTemperature_168_invalidFlag unsigned 15,1 -m -Var=cellTemperature_169_invalidFlag unsigned 14,1 -m -Var=cellTemperature_170_invalidFlag unsigned 13,1 -m -Var=cellTemperature_171_invalidFlag unsigned 12,1 -m -Var=cellTemperature_172_invalidFlag unsigned 11,1 -m -Var=cellTemperature_173_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_168_173 0,8 1Ch -m +Var=cellTemperature_168_invalidFlag bit 15,1 -m +Var=cellTemperature_169_invalidFlag bit 14,1 -m +Var=cellTemperature_170_invalidFlag bit 13,1 -m +Var=cellTemperature_171_invalidFlag bit 12,1 -m +Var=cellTemperature_172_invalidFlag bit 11,1 -m +Var=cellTemperature_173_invalidFlag bit 10,1 -m Var=cellTemperature_168 signed 16,8 -m /u:degC Var=cellTemperature_169 signed 24,8 -m /u:degC Var=cellTemperature_170 signed 32,8 -m /u:degC @@ -1203,15 +1270,16 @@ Var=cellTemperature_171 signed 40,8 -m /u:degC Var=cellTemperature_172 signed 48,8 -m /u:degC Var=cellTemperature_173 signed 56,8 -m /u:degC -[foxBMS_CellTemperature] -DLC=8 -Mux=mux_cellTemperature_174_179 0,8 1Dh -m -Var=cellTemperature_174_invalidFlag unsigned 15,1 -m -Var=cellTemperature_175_invalidFlag unsigned 14,1 -m -Var=cellTemperature_176_invalidFlag unsigned 13,1 -m -Var=cellTemperature_177_invalidFlag unsigned 12,1 -m -Var=cellTemperature_178_invalidFlag unsigned 11,1 -m -Var=cellTemperature_179_invalidFlag unsigned 10,1 -m +[foxBMS_CellTemperatures] +Len=8 +CycleTime=4500 -p +Mux=mux_cellTemperature_174_179 0,8 1Dh -m +Var=cellTemperature_174_invalidFlag bit 15,1 -m +Var=cellTemperature_175_invalidFlag bit 14,1 -m +Var=cellTemperature_176_invalidFlag bit 13,1 -m +Var=cellTemperature_177_invalidFlag bit 12,1 -m +Var=cellTemperature_178_invalidFlag bit 11,1 -m +Var=cellTemperature_179_invalidFlag bit 10,1 -m Var=cellTemperature_174 signed 16,8 -m /u:degC Var=cellTemperature_175 signed 24,8 -m /u:degC Var=cellTemperature_176 signed 32,8 -m /u:degC @@ -1219,278 +1287,135 @@ Var=cellTemperature_177 signed 40,8 -m /u:degC Var=cellTemperature_178 signed 48,8 -m /u:degC Var=cellTemperature_179 signed 56,8 -m /u:degC -[foxBMS_Command] -ID=230h // (in:can_cbs_rx_command.c:CAN_RxRequest) -DLC=8 -Var=foxBMS_modeRequest unsigned 6,2 -m /e:modeRequest_e // 0x0: Disconnect strings from HV bus, 0x01: Connect strings to HV bus to start discharge, 0x02: Connect strings to HV bus to start charging -Var=foxBMS_activateBalancing bit 15,1 -m // 0: Deactivate balancing, 1: Activate balancing -Var=foxBMS_balancingThreshold unsigned 16,8 -m /u:mV // Required voltage difference to minimum cell voltage to activate balancing -Var=foxBMS_externallyPrecharged bit 4,1 -m // 0x0: HV bus not externally precharged, 0x01: HV bus externally precharged -Var=foxBMS_resetFlags bit 2,1 // 0x01: reset persistent flags -Var=foxBMS_chargerConnected bit 4,1 // 0x00: charger not connected, 0x01: charger connected -Var=foxBMS_disableInsulationMon bit 5,1 // 0x00: Check battery system insulation, 0x01: Do not check insulation of battery system -Var=foxBMS_heaterOverride_ON bit 6,1 // 0: no override active, 1: override active -> force heater on -Var=foxBMS_heaterOverride_OFF unsigned 7,1 // 0: no override active, 1: override active -> force heater off - -[foxBMS_State] -ID=220h // Message contains foxBMS state (in:can_cbs_tx_state.c:CAN_TxState) -DLC=8 -Var=foxBMS_State unsigned 4,4 -m /e:state_e +[foxBMS_BmsStateRequest] +ID=230h // (in:can_cbs_rx_state-request.c:CANRX_BmsStateRequest, fv:rx) +Len=8 +Var=foxBMS_modeRequest unsigned 6,2 -m /e:foxBMS_ModeRequest // 0x0: Disconnect strings from HV bus, 0x01: Connect strings to HV bus to start discharge, 0x02: Connect strings to HV bus to start charging +Var=foxBMS_activateBalancing bit 15,1 -m // 0: Deactivate balancing, 1: Activate balancing +Var=foxBMS_balancingThreshold unsigned 16,8 -m /u:mV // Required voltage difference to minimum cell voltage to activate balancing +Var=foxBMS_externallyPrecharged bit 4,1 -m // 0x0: HV bus not externally precharged, 0x01: HV bus externally precharged +Var=foxBMS_resetFlags bit 5,1 -m // 0x01: reset persistent flags +Var=foxBMS_chargerConnected bit 3,1 -m // 0x00: charger not connected, 0x01: charger connected +Var=foxBMS_disableInsulationMon bit 2,1 -m // 0x00: Check battery system insulation, 0x01: Do not check insulation of battery system +Var=foxBMS_heaterOverride_ON bit 1,1 -m // 0: no override active, 1: override active -> force heater on +Var=foxBMS_heaterOverride_OFF bit 0,1 -m // 0: no override active, 1: override active -> force heater off + +[foxBMS_BmsState] +ID=220h // Message contains foxBMS state (in:can_cbs_tx_state.c:CANTX_BmsState, fv:tx) +Len=8 +CycleTime=100 -p +Var=foxBMS_State unsigned 4,4 -m /e:foxBMS_State Var=BMS_nrOfConnectedStrings unsigned 0,4 -m -Var=foxBMS_generalError bit 13,1 -m // 0x00: No error detected, 0x01: Error detected -Var=foxBMS_generalWarning bit 14,1 -m // 0x00: No warning detected, 0x01: Warning detected -Var=foxBMS_Error_dieTemperatureMCU bit 21,1 -m // 0x00: No error, 0x01: Error detected -Var=foxBMS_Error_OvertempPCB bit 20,1 -m // foxBMS Master-PCB: 0x00: No error, 0x01: Error detected -Var=foxBMS_Error_UndertempPCB bit 19,1 -m // foxBMS Master-PCB: 0x00: No error, 0x01: Error detected -Var=foxBMS_Error_PrechargeVolt bit 23,1 -m // 0x00: precharging successful, 0x01: precharge aborted because of voltage difference -Var=foxBMS_Error_PrechargeCurrent bit 22,1 -m // 0x00: precharging successful, 0x01: precharge aborted because current limit violated -Var=foxBMS_heaterState bit 9,1 -m // 0x00: Heater not activated, 0x01: Heater activated -Var=foxBMS_coolingState bit 8,1 -m // 0x00: Cooling not activated, 0x01: Cooling activated -Var=foxBMS_insulationMonitoring bit 10,1 -m // 0x00: insulation monitoring active, 0x01: insulation monitoring not active -Var=foxBMS_chargingComplete bit 15,1 -m // 0x01: charging complete -Var=foxBMS_EmergencyShutoff bit 12,1 -m // The BMS is preparing to open the contactors soon due to detected error -Var=foxBMS_MainFuseBlown bit 18,1 -m // 0x00: fuse okay, 0x01: fuse blown +Var=foxBMS_generalError bit 13,1 -m // 0x00: No error detected, 0x01: Error detected +Var=foxBMS_generalWarning bit 14,1 -m // 0x00: No warning detected, 0x01: Warning detected +Var=foxBMS_Error_dieTemperatureMCU bit 21,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_OvertempPCB bit 20,1 -m // foxBMS Master-PCB: 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_UndertempPCB bit 19,1 -m // foxBMS Master-PCB: 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_PrechargeVolt bit 23,1 -m // 0x00: precharging successful, 0x01: precharge aborted because of voltage difference +Var=foxBMS_Error_PrechargeCurrent bit 22,1 -m // 0x00: precharging successful, 0x01: precharge aborted because current limit violated +Var=foxBMS_heaterState bit 9,1 -m // 0x00: Heater not activated, 0x01: Heater activated +Var=foxBMS_coolingState bit 8,1 -m // 0x00: Cooling not activated, 0x01: Cooling activated +Var=foxBMS_insulationMonitoring bit 10,1 -m // 0x00: insulation monitoring active, 0x01: insulation monitoring not active +Var=foxBMS_chargingComplete bit 15,1 -m // 0x01: charging complete +Var=foxBMS_EmergencyShutoff bit 12,1 -m // The BMS is preparing to open the contactors soon due to detected error +Var=foxBMS_MainFuseBlown bit 18,1 -m // 0x00: fuse okay, 0x01: fuse blown Var=foxBMS_insulationResistance unsigned 56,8 -m /u:kOhm /f:10 -Var=foxBMS_Error_Interlock bit 17,1 -m // 0x00: interlock okay, 0x01: interlock open +Var=foxBMS_Error_Interlock bit 17,1 -m // 0x00: interlock okay, 0x01: interlock open Var=foxBMS_NrDeactivatedStrings unsigned 52,4 -m -Var=foxBMS_Error_Insulation bit 16,1 -m // 0x00: No error, 0x01: Error detected -Var=foxBMS_Error_Cantiming bit 31,1 -m // 0x00: No error, 0x01: Error detected -Var=foxBMS_Error_PackOvercurr_Charge bit 30,1 -m // 0x00: No error, 0x01: Error detected -Var=foxBMS_Error_PackOvercur_Dischrg bit 29,1 -m // 0x00: No error, 0x01: Error detected -Var=foxBMS_SysMonError bit 12,1 /ln:"system monitoring error" // If this bit is set, it indicates that a task has violated its timing requirements. +Var=foxBMS_Error_Insulation bit 16,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_Cantiming bit 31,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_PackOvercurr_Charge bit 30,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_Error_PackOvercur_Dischrg bit 29,1 -m // 0x00: No error, 0x01: Error detected +Var=foxBMS_SysMonError bit 11,1 -m /ln:"system monitoring error" // If this bit is set, it indicates that a task has violated its timing requirements. +Var=foxBMS_alertFlag bit 28,1 -m // foxBMS Alter flag: 0x00: No error, 0x01: Alert flag set [foxBMS_StringState] -ID=221h // Message contains string related error and warning flags (in:can_cbs_tx_state.c:CAN_TxStringState) -DLC=8 -Mux=mux_stateString0 4,4 0 -m -Var=String0_stringConnected bit 3,1 -m // 0x00: String not connected, 0x01: String connected to HV bus -Var=String0_balancing_active bit 2,1 -m // 0x00: No balancing active, 0x01: Balancing in this string active -Var=String0_Err_overtemp_charge bit 15,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius. -Var=String0_Err_undertemp_charge bit 14,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below 0 degree celsius. -Var=String0_Err_overtemp_discharge bit 13,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 60 degree celsius. -Var=String0_Err_undertemp_discharge bit 12,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below -20 degree celsius. -Var=String0_Err_Overcurrent_charge bit 11,1 -m // 0x00: No error, 0x01: Error: Flag will be set if string charge current is above 30400mA. -Var=String0_Err_Overcurre_discharge bit 10,1 -m // 0x00: No error, 0x01: Error: Flag will be set if discharge current is above maximum string current. -Var=String0_Err_Overvoltage bit 9,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell voltage is above 4200mV. -Var=String0_Err_Undervoltage bit 8,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell voltage is below 3000mV. This equals roughly 4% remaining SOC. Minimum data sheet values if 2500mV. -Var=String0_Err_deep_discharge bit 0,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_CS_currentMeas bit 44,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_positiveContactor bit 39,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_openWire bit 54,1 -m // 0x00: No error, 0x01: Error -Var=String0_openWireNumber unsigned 56,8 -m // Number of first open wire that has been detected in this string -Var=String0_Err_plaus_cell_volt bit 51,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_plaus_cell_temp bit 52,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_plaus_string_volt bit 50,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_slave_hardware bit 37,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyChainBase_Comm bit 36,1 -m // 0x00: No error, 0x01: Error (i.e. SPI) -Var=String0_Err_dsyChainPrim_CRC bit 34,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyChainRedun_Comm bit 35,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyChainRedun_CRC bit 33,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyPrim_voltMeasOor bit 32,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyRedun_voltMeasOor bit 47,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyPrim_tempMeasOor bit 46,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_dsyRedun_tempMeasOor bit 45,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_CS_coulombCountMeas bit 43,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_CS_energyCountMeas bit 42,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_plaus_volt_spread bit 48,1 -m // 0x00: No error, 0x01: Error -Var=String0_Err_plaus_temp_spread bit 49,1 -m // 0x00: No error, 0x01: Error -Var=String0_fuseBlown bit 6,1 /ln:"0x00: fuse okay, 0x01: fuse blown" -Var=String0_Warning_overvoltage_MOL bit 22,1 -Var=String0_Warning_undervoltage_MOL bit 23,1 -Var=String0_Wrng_chargeOverTemp_MOL bit 16,1 -Var=String0_Wrng_dischrgOverTemp_MOL bit 18,1 -Var=String0_Wrng_chargeUnderTemp_MOL bit 17,1 -Var=String0_Wrng_dischrgUnderTmp_MOL bit 19,1 -Var=String0_Wrng_chargeOverCur_MOL bit 20,1 -Var=String0_Wrng_dischargOverCur_MOL bit 21,1 -Var=String0_Wrng_chargeOverTemp_RSL bit 24,1 -Var=String0_Wrng_chargeUnderTemp_RSL bit 25,1 -Var=String0_Wrng_dischrgOverTemp_RSL bit 26,1 -Var=String0_Wrng_dischrgUnderTmp_RSL bit 27,1 -Var=String0_Wrng_chargeOverCur_RSL bit 28,1 -Var=String0_Wrng_dischargOverCur_RSL bit 29,1 -Var=String0_Wrng_overvoltage_RSL bit 30,1 -Var=String0_Wrng_undervoltage_RSL bit 31,1 -Var=String0_Err_negativeContactor bit 33,1 -Var=String0_Err_CS_voltage1Meas bit 46,1 -Var=String0_Err_CS_voltage2Meas bit 47,1 -Var=String0_Err_CS_voltage3Meas bit 48,1 - -[foxBMS_StringState] -DLC=8 -Mux=mux_stateString1 4,4 1 -m -Var=String1_stringConnected bit 3,1 -m // 0x00: String not connected, 0x01: String connected to HV bus -Var=String1_balancing_active bit 2,1 -m // 0x00: No balancing active, 0x01: Balancing in this string active -Var=String1_Err_overtemp_charge bit 15,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius. -Var=String1_Err_undertemp_charge bit 14,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below 0 degree celsius. -Var=String1_Err_overtemp_discharge bit 13,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 60 degree celsius. -Var=String1_Err_undertemp_discharge bit 12,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below -20 degree celsius. -Var=String1_Err_Overcurrent_charge bit 11,1 -m // 0x00: No error, 0x01: Error: Flag will be set if string charge current is above 30400mA. -Var=String1_Err_Overcurre_discharge bit 10,1 -m // 0x00: No error, 0x01: Error: Flag will be set if discharge current is above maximum string current. -Var=String1_Err_Overvoltage bit 9,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell voltage is above 4200mV. -Var=String1_Err_Undervoltage bit 8,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell voltage is below 3000mV. This equals roughly 4% remaining SOC. Minimum data sheet values if 2500mV. -Var=String1_Err_deep_discharge bit 0,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_CS_currentMeas bit 44,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_positiveContactor bit 39,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_openWire bit 54,1 -m // 0x00: No error, 0x01: Error -Var=String1_openWireNumber unsigned 56,8 -m // Number of first open wire that has been detected in this string -Var=String1_Err_plaus_cell_volt bit 51,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_plaus_cell_temp bit 52,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_plaus_string_volt bit 50,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_slave_hardware bit 37,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyChainPrim_Comm bit 36,1 -m // 0x00: No error, 0x01: Error (i.e. SPI) -Var=String1_Err_dsyChainPrim_CRC bit 34,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyChainRedun_Comm bit 35,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyChainRedun_CRC bit 33,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyPrim_voltMeasOor bit 32,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyRedun_voltMeasOor bit 47,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyPrim_tempMeasOor bit 46,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_dsyRedun_tempMeasOor bit 45,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_CS_coulombCountMeas bit 43,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_CS_energyCountMeas bit 42,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_plaus_volt_spread bit 48,1 -m // 0x00: No error, 0x01: Error -Var=String1_Err_plaus_temp_spread bit 49,1 -m // 0x00: No error, 0x01: Error -Var=String1_fuseBlown bit 6,1 /ln:"0x00: fuse okay, 0x01: fuse blown" -Var=String1_Warning_overvoltage_MOL bit 22,1 -Var=String1_Warning_undervoltage_MOL bit 23,1 -Var=String1_Wrng_chargeOverTemp_MOL bit 16,1 -Var=String1_Wrng_dischrgOverTemp_MOL bit 18,1 -Var=String1_Wrng_chargeUnderTemp_MOL bit 17,1 -Var=String1_Wrng_dischrgUnderTmp_MOL bit 19,1 -Var=String1_Wrng_chargeOverCur_MOL bit 20,1 -Var=String1_Wrng_dischargOverCur_MOL bit 21,1 -Var=String1_Wrng_chargeOverTemp_RSL bit 24,1 -Var=String1_Wrng_chargeUnderTemp_RSL bit 25,1 -Var=String1_Wrng_dischrgOverTemp_RSL bit 26,1 -Var=String1_Wrng_dischrgUnderTmp_RSL bit 27,1 -Var=String1_Wrng_chargeOverCur_RSL bit 28,1 -Var=String1_Wrng_dischargOverCur_RSL bit 29,1 -Var=String1_Wrng_overvoltage_RSL bit 30,1 -Var=String1_Wrng_undervoltage_RSL bit 31,1 -Var=String1_Err_negativeContactor bit 33,1 -Var=String1_Err_CS_voltage1Meas bit 46,1 -Var=String1_Err_CS_voltage2Meas bit 47,1 -Var=String1_Err_CS_voltage3Meas bit 48,1 - -[foxBMS_StringState] -DLC=8 -Mux=mux_stateString2 4,4 2 -m -Var=String2_stringConnected bit 3,1 -m // 0x00: String not connected, 0x01: String connected to HV bus -Var=String2_balancing_active bit 2,1 -m // 0x00: No balancing active, 0x01: Balancing in this string active -Var=String2_Err_overtemp_charge bit 15,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius. -Var=String2_Err_undertemp_charge bit 14,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below 0 degree celsius. -Var=String2_Err_overtemp_discharge bit 13,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 60 degree celsius. -Var=String2_Err_undertemp_discharge bit 12,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below -20 degree celsius. -Var=String2_Err_Overcurrent_charge bit 11,1 -m // 0x00: No error, 0x01: Error: Flag will be set if string charge current is above 30400mA. -Var=String2_Err_Overcurre_discharge bit 10,1 -m // 0x00: No error, 0x01: Error: Flag will be set if discharge current is above maximum string current. -Var=String2_Err_Overvoltage bit 9,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell voltage is above 4200mV. -Var=String2_Err_Undervoltage bit 8,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell voltage is below 3000mV. This equals roughly 4% remaining SOC. Minimum data sheet values if 2500mV. -Var=String2_Err_deep_discharge bit 0,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_CS_currentMeas bit 44,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_positiveContactor bit 39,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_openWire bit 54,1 -m // 0x00: No error, 0x01: Error -Var=String2_openWireNumber unsigned 56,8 -m // Number of first open wire that has been detected in this string -Var=String2_Err_plaus_cell_volt bit 51,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_plaus_cell_temp bit 52,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_plaus_string_volt bit 50,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_slave_hardware bit 37,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyChainPrim_Comm bit 36,1 -m // 0x00: No error, 0x01: Error (i.e. SPI) -Var=String2_Err_dsyChainPrim_CRC bit 34,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyChainRedun_Comm bit 35,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyChainRedun_CRC bit 33,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyPrim_voltMeasOor bit 32,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyRedun_voltMeasOor bit 47,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyPrim_tempMeasOor bit 46,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_dsyRedun_tempMeasOor bit 45,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_CS_coulombCountMeas bit 43,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_CS_energyCountMeas bit 42,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_plaus_volt_spread bit 48,1 -m // 0x00: No error, 0x01: Error -Var=String2_Err_plaus_temp_spread bit 49,1 -m // 0x00: No error, 0x01: Error -Var=String2_fuseBlown bit 6,1 /ln:"0x00: fuse okay, 0x01: fuse blown" -Var=String2_Warning_overvoltage_MOL bit 22,1 -Var=String2_Warning_undervoltage_MOL bit 23,1 -Var=String2_Wrng_chargeOverTemp_MOL bit 16,1 -Var=String2_Wrng_dischrgOverTemp_MOL bit 18,1 -Var=String2_Wrng_chargeUnderTemp_MOL bit 17,1 -Var=String2_Wrng_dischrgUnderTmp_MOL bit 19,1 -Var=String2_Wrng_chargeOverCur_MOL bit 20,1 -Var=String2_Wrng_dischargOverCur_MOL bit 21,1 -Var=String2_Wrng_chargeOverTemp_RSL bit 24,1 -Var=String2_Wrng_chargeUnderTemp_RSL bit 25,1 -Var=String2_Wrng_dischrgOverTemp_RSL bit 26,1 -Var=String2_Wrng_dischrgUnderTmp_RSL bit 27,1 -Var=String2_Wrng_chargeOverCur_RSL bit 28,1 -Var=String2_Wrng_dischargOverCur_RSL bit 29,1 -Var=String2_Wrng_overvoltage_RSL bit 30,1 -Var=String2_Wrng_undervoltage_RSL bit 31,1 -Var=String2_Err_negativeContactor bit 33,1 -Var=String2_Err_CS_voltage1Meas bit 46,1 -Var=String2_Err_CS_voltage2Meas bit 47,1 -Var=String2_Err_CS_voltage3Meas bit 48,1 - -[foxBMS_StringMinMaxValues] -ID=281h // Message contains minimum and maximum cell temperature and cell voltage values of respective string (in:can_cbs_tx_minmax.c:CAN_TxStringMinimumMaximumValues) -DLC=8 -Mux=mux_minMaxValuesString0 4,4 0 -m -Var=String0_minimumCellVoltage unsigned 21,13 -m /u:mV // Minimum cell voltage in this string -Var=String0_maximumCellVoltage unsigned 8,13 -m /u:mV // Maximum cell voltage in this string -Var=String0_maximumCellTemperature signed 34,9 -m /u:degC /f:0.5 // Maximum cell temperature in this string -Var=String0_minimumCellTemperature signed 43,9 -m /u:degC /f:0.5 // Minium cell temperature in this string +ID=221h // Message contains string related error and warning flags (in:can_cbs_tx_state.c:CANTX_StringState, fv:tx) +Len=8 +CycleTime=100 -p +Mux=mux_stateString0 4,4 0 -m +Var=String0_stringConnected bit 3,1 -m // 0x00: String not connected, 0x01: String connected to HV bus +Var=String0_balancing_active bit 2,1 -m // 0x00: No balancing active, 0x01: Balancing in this string active +Var=String0_Err_overtemp_charge bit 15,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 45 degree celsius. +Var=String0_Err_undertemp_charge bit 14,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below 0 degree celsius. +Var=String0_Err_overtemp_discharge bit 13,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell temperature is above 60 degree celsius. +Var=String0_Err_undertemp_discharge bit 12,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell temperature is below -20 degree celsius. +Var=String0_Err_Overcurrent_charge bit 11,1 -m // 0x00: No error, 0x01: Error: Flag will be set if string charge current is above 30400mA. +Var=String0_Err_Overcurre_discharge bit 10,1 -m // 0x00: No error, 0x01: Error: Flag will be set if discharge current is above maximum string current. +Var=String0_Err_Overvoltage bit 9,1 -m // 0x00: No error, 0x01: Error: Flag will be set if maximum cell voltage is above 4200mV. +Var=String0_Err_Undervoltage bit 8,1 -m // 0x00: No error, 0x01: Error: Flag will be set if minimum cell voltage is below 3000mV. This equals roughly 4% remaining SOC. Minimum data sheet values if 2500mV. +Var=String0_Err_deep_discharge bit 0,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_CS_currentMeas bit 44,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_positiveContactor bit 39,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_openWire bit 54,1 -m // 0x00: No error, 0x01: Error +Var=String0_openWireNumber unsigned 56,8 -m // Number of first open wire that has been detected in this string +Var=String0_Err_plaus_cell_volt bit 51,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_plaus_cell_temp bit 52,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_plaus_string_volt bit 50,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_slave_hardware bit 37,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyChainBase_Comm bit 36,1 -m // 0x00: No error, 0x01: Error (i.e. SPI) +Var=String0_Err_dsyChainPrim_CRC bit 34,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyChainRedun_Comm bit 35,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyChainRedun_CRC bit 33,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyPrim_voltMeasOor bit 32,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyRedun_voltMeasOor bit 47,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyPrim_tempMeasOor bit 46,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_dsyRedun_tempMeasOor bit 45,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_CS_coulombCountMeas bit 43,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_CS_energyCountMeas bit 42,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_plaus_volt_spread bit 48,1 -m // 0x00: No error, 0x01: Error +Var=String0_Err_plaus_temp_spread bit 49,1 -m // 0x00: No error, 0x01: Error +Var=String0_fuseBlown bit 1,1 -m /e:foxBMS_FuseState /ln:"0x00: fuse okay, 0x01: fuse blown" +Var=String0_Warning_overvoltage_MOL bit 17,1 -m +Var=String0_Warning_undervoltage_MOL bit 16,1 -m +Var=String0_Wrng_chargeOverTemp_MOL bit 23,1 -m +Var=String0_Wrng_dischrgOverTemp_MOL bit 21,1 -m +Var=String0_Wrng_chargeUnderTemp_MOL bit 22,1 -m +Var=String0_Wrng_dischrgUnderTmp_MOL bit 20,1 -m +Var=String0_Wrng_chargeOverCur_MOL bit 19,1 -m +Var=String0_Wrng_dischargOverCur_MOL bit 18,1 -m +Var=String0_Wrng_chargeOverTemp_RSL bit 31,1 -m +Var=String0_Wrng_chargeUnderTemp_RSL bit 30,1 -m +Var=String0_Wrng_dischrgOverTemp_RSL bit 29,1 -m +Var=String0_Wrng_dischrgUnderTmp_RSL bit 28,1 -m +Var=String0_Wrng_chargeOverCur_RSL bit 27,1 -m +Var=String0_Wrng_dischargOverCur_RSL bit 26,1 -m +Var=String0_Wrng_overvoltage_RSL bit 25,1 -m +Var=String0_Wrng_undervoltage_RSL bit 24,1 -m +Var=String0_Err_negativeContactor bit 38,1 -m +Var=String0_Err_CS_voltage1Meas bit 41,1 -m +Var=String0_Err_CS_voltage2Meas bit 40,1 -m +Var=String0_Err_CS_voltage3Meas bit 55,1 -m [foxBMS_StringMinMaxValues] -DLC=8 -Mux=mux_minMaxValuesString1 4,4 1 -m -Var=String1_minimumCellVoltage unsigned 21,13 -m /u:mV // Minimum cell voltage in this string -Var=String1_maximumCellVoltage unsigned 8,13 -m /u:mV // Maximum cell voltage in this string -Var=String1_maximumCellTemperature signed 34,9 -m /u:degC /f:0.5 // Maximum cell temperature in this string -Var=String1_minimumCellTemperature signed 43,9 -m /u:degC /f:0.5 // Minium cell temperature in this string - -[foxBMS_StringMinMaxValues] -DLC=8 -Mux=mux_minMaxValuesString2 4,4 2 -m -Var=String2_minimumCellVoltage unsigned 21,13 -m /u:mV // Minimum cell voltage in this string -Var=String2_maximumCellVoltage unsigned 8,13 -m /u:mV // Maximum cell voltage in this string -Var=String2_maximumCellTemperature signed 34,9 -m /u:degC /f:0.5 // Maximum cell temperature in this string -Var=String2_minimumCellTemperature signed 43,9 -m /u:degC /f:0.5 // Minium cell temperature in this string +ID=281h // Message contains minimum and maximum cell temperature and cell voltage values of respective string (in:can_cbs_tx_minimum-maximum-values.c:CANTX_StringMinimumMaximumValues, fv:tx) +Len=8 +CycleTime=100 -p +Mux=mux_minMaxValuesString0 4,4 0 -m +Var=String0_minimumCellVoltage unsigned 21,13 -m /u:mV // Minimum cell voltage in this string +Var=String0_maximumCellVoltage unsigned 8,13 -m /u:mV // Maximum cell voltage in this string +Var=String0_maximumCellTemperature signed 34,9 -m /u:degC /f:0.5 // Maximum cell temperature in this string +Var=String0_minimumCellTemperature signed 43,9 -m /u:degC /f:0.5 // Minium cell temperature in this string [foxBMS_StringStateEstimation] -ID=282h // Message contains SOC, SOE and SOH state estimations (in:can_cbs_tx_state_estimation.c:CAN_TxStringStateEstimation) -DLC=8 -Mux=mux_String0_SOC_SOE 0,4 0 -m -Var=String0_minimumSOC unsigned 4,9 -m /u:% /f:0.25 /d:0 -Var=String0_averageSOC unsigned 13,9 -m /u:% /f:0.25 /max:127.5 /d:0 -Var=String0_maximumSOC unsigned 22,9 -m /u:% /f:0.25 /max:63.75 /d:0 -Var=String0_SOE unsigned 31,9 -m /u:% /f:0.25 /max:127.5 /d:0 // SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min -Var=String0_Energy_kWh unsigned 49,15 -m /u:kWh /f:0.01 // Remaining energy left in this string +ID=282h // Message contains SOC, SOE and SOH state estimations (in:can_cbs_tx_string-state-estimation.c:CANTX_StringStateEstimation, fv:tx) +Len=8 +CycleTime=1000 -p +Mux=mux_String0_SOC_SOE 0,4 0 -m +Var=String0_minimumSOC unsigned 4,9 -m /u:% /f:0.25 +Var=String0_averageSOC unsigned 13,9 -m /u:% /f:0.25 /max:127.5 +Var=String0_maximumSOC unsigned 22,9 -m /u:% /f:0.25 /max:63.75 +Var=String0_SOE unsigned 31,9 -m /u:% /f:0.25 /max:127.5 // SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min +Var=String0_Energy_kWh unsigned 49,15 -m /u:kWh /f:0.01 // Remaining energy left in this string Var=String0_SOH unsigned 40,9 -m /u:% /f:0.25 /max:127.5 -[foxBMS_StringStateEstimation] -DLC=8 -Mux=mux_String1_SOC_SOE 0,4 1 -m -Var=String1_minimumSOC unsigned 4,9 -m /u:% /f:0.25 /d:0 -Var=String1_averageSOC unsigned 13,9 -m /u:% /f:0.25 /max:127.5 /d:0 -Var=String1_maximumSOC unsigned 22,9 -m /u:% /f:0.25 /max:63.75 /d:0 -Var=String1_SOE unsigned 31,9 -m /u:% /f:0.25 /max:127.5 /d:0 // SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min -Var=String1_Energy_kWh unsigned 49,15 -m /u:kWh /f:0.01 // Remaining energy left in this string -Var=String1_SOH unsigned 40,9 -m /u:% /f:0.25 /max:127.5 - -[foxBMS_StringStateEstimation] -DLC=8 -Mux=mux_String2_SOC_SOE 0,4 2 -m -Var=String2_minimumSOC unsigned 4,9 -m /u:% /f:0.25 /d:0 -Var=String2_averageSOC unsigned 13,9 -m /u:% /f:0.25 /max:127.5 /d:0 -Var=String2_maximumSOC unsigned 22,9 -m /u:% /f:0.25 /max:63.75 /d:0 -Var=String2_SOE unsigned 31,9 -m /u:% /f:0.25 /max:127.5 /d:0 // SOE is depending on current direction, if battery system is charging: SOE_max is transmitted, else SOE_min -Var=String2_Energy_kWh unsigned 49,15 -m /u:kWh /f:0.01 // Remaining energy left in this string -Var=String2_SOH unsigned 40,9 -m /u:% /f:0.25 /max:127.5 - [foxBMS_Debug] -ID=200h // Reserved - for debug/development purpose only (in:can_cbs_rx_misc.c:CAN_RxDebug) -DLC=8 +ID=200h // Reserved - for debug/development purpose only (in:can_cbs_rx_misc.c:CANRX_Debug, fv:rx) +Len=8 -[IVT0_Msg_Result_I] -ID=521h // Current sensor string 0: current (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0Current] +ID=521h // Current sensor string 0: current (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_I +Len=6 Var=IVT0_Result_I_systemError bit 8,1 -m Var=IVT0_Result_I_OCS bit 11,1 -m Var=IVT0_Result_I_overallMeasError bit 9,1 -m @@ -1499,9 +1424,9 @@ Var=IVT0_ID_Result_I unsigned 0,8 -m Var=IVT0_MsgCount_Result_I unsigned 12,4 -m Var=IVT0_Result_I_mA signed 16,32 -m /u:mA -[IVT0_Msg_Result_U1] -ID=522h // Current sensor string 0: voltage 1 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0Voltage1] +ID=522h // Current sensor string 0: voltage 1 (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_U1 +Len=6 Var=IVT0_Result_U1_systemError bit 8,1 -m Var=IVT0_Result_U1_overallMeasError bit 9,1 -m Var=IVT0_Result_U1_channelMeasError bit 10,1 -m @@ -1510,9 +1435,9 @@ Var=IVT0_ID_Result_U1 unsigned 0,8 -m /min:1 /max:1 /d:1 Var=IVT0_MsgCount_Result_U1 unsigned 12,4 -m Var=IVT0_Result_U1_mV signed 16,32 -m /u:mV -[IVT0_Msg_Result_U2] -ID=523h // Current sensor string 0: voltage 2 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0Voltage2] +ID=523h // Current sensor string 0: voltage 2 (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_U2 +Len=6 Var=IVT0_Result_U2_systemError bit 8,1 -m Var=IVT0_Result_U2_OCS bit 11,1 -m Var=IVT0_Result_U2_overallMeasError bit 9,1 -m @@ -1521,9 +1446,9 @@ Var=IVT0_ID_Result_U2 unsigned 0,8 -m /min:2 /max:2 /d:2 Var=IVT0_MsgCount_Result_U2 unsigned 12,4 -m Var=IVT0_Result_U2_mV signed 16,32 -m /u:mV -[IVT0_Msg_Result_U3] -ID=524h // Current sensor string 0: voltage 3 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0Voltage3] +ID=524h // Current sensor string 0: voltage 3 (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_U3 +Len=6 Var=IVT0_Result_U3_systemError bit 8,1 -m Var=IVT0_Result_U3_OCS bit 11,1 -m Var=IVT0_Result_U3_overallMeasError bit 9,1 -m @@ -1532,20 +1457,20 @@ Var=IVT0_ID_Result_U3 unsigned 0,8 -m /min:3 /max:3 /d:3 Var=IVT0_MsgCount_Result_U3 unsigned 12,4 -m Var=IVT0_Result_U3_mV signed 16,32 -m /u:mV -[IVT0_Msg_Result_T] -ID=525h // Current sensor string 0: temperature (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0Temperature] +ID=525h // Current sensor string 0: temperature (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_T +Len=6 Var=IVT0_Result_T_systemError bit 8,1 -m Var=IVT0_Result_T_OCS bit 11,1 -m Var=IVT0_Result_T_overallMeasError bit 9,1 -m Var=IVT0_Result_T_channelMeasError bit 10,1 -m Var=IVT0_ID_Result_T unsigned 0,8 -m /min:4 /max:4 /d:4 Var=IVT0_MsgCount_Result_T unsigned 12,4 -m -Var=IVT0_Result_T_ddegC signed 16,32 -m /u:ddegC /f:0.1 /d:0 +Var=IVT0_Result_T_ddegC signed 16,32 -m /u:ddegC /f:0.1 -[IVT0_Msg_Result_W] -ID=526h // Current sensor string 0: power (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0Power] +ID=526h // Current sensor string 0: power (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_W +Len=6 Var=IVT0_Result_W_systemError bit 8,1 -m Var=IVT0_Result_W_OCS bit 11,1 -m Var=IVT0_Result_W_overallMeasError bit 9,1 -m @@ -1554,9 +1479,9 @@ Var=IVT0_Result_W signed 16,32 -m /u:W Var=IVT0_MsgCount_Result_W unsigned 12,4 -m Var=IVT0_ID_Result_W unsigned 0,8 -m /min:5 /max:5 /d:5 -[IVT0_Msg_Result_As] -ID=527h // Current sensor string 0: coulomb counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0CurrentCounter] +ID=527h // Current sensor string 0: coulomb counting (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_As +Len=6 Var=IVT0_Result_As_systemError bit 8,1 -m Var=IVT0_Result_As_OCS bit 11,1 -m Var=IVT0_Result_As_overallMeasError bit 9,1 -m @@ -1565,9 +1490,9 @@ Var=IVT0_Result_As signed 16,32 -m /u:As Var=IVT0_MsgCount_Result_As unsigned 12,4 -m Var=IVT0_ID_Result_As unsigned 0,8 -m /min:6 /max:6 /d:6 -[IVT0_Msg_Result_Wh] -ID=528h // Current sensor string 0: energy counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 +[foxBMS_String0EnergyCounter] +ID=528h // Current sensor string 0: energy counting (in:can_cbs_rx_current-sensor.c:CANRX_CurrentSensor, fv:rx); Isabellenhuette data sheet name: IVT0_Msg_Result_Wh +Len=6 Var=IVT0_Result_Wh_systemError bit 8,1 -m Var=IVT0_Result_Wh_OCS bit 11,1 -m Var=IVT0_Result_Wh_overallMeasError bit 9,1 -m @@ -1576,212 +1501,37 @@ Var=IVT0_Result_Wh signed 16,32 -m /u:Wh Var=IVT0_MsgCount_Result_Wh unsigned 12,4 -m Var=IVT0_ID_Result_Wh unsigned 0,8 -m /min:7 /max:7 /d:7 -[IVT1_Msg_Result_I] -ID=621h // Current sensor string 1: current (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_I_systemError bit 8,1 -m -Var=IVT1_Result_I_OCS bit 11,1 -m -Var=IVT1_Result_I_overallMeasError bit 9,1 -m -Var=IVT1_Result_I_channelMeasError bit 10,1 -m -Var=IVT1_ID_Result_I unsigned 0,8 -m -Var=IVT1_MsgCount_Result_I unsigned 12,4 -m -Var=IVT1_Result_I_mA signed 16,32 -m /u:mA - -[IVT1_Msg_Result_U1] -ID=622h // Current sensor string 1: voltage 1 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_U1_systemError bit 8,1 -m -Var=IVT1_Result_U1_overallMeasError bit 9,1 -m -Var=IVT1_Result_U1_channelMeasError bit 10,1 -m -Var=IVT1_Result_U1_OCS bit 11,1 -m -Var=IVT1_ID_Result_U1 unsigned 0,8 -m /min:1 /max:1 /d:1 -Var=IVT1_MsgCount_Result_U1 unsigned 12,4 -m -Var=IVT1_Result_U1_mV signed 16,32 -m /u:mV - -[IVT1_Msg_Result_U2] -ID=623h // Current sensor string 1: voltage 2 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_U2_systemError bit 8,1 -m -Var=IVT1_Result_U2_OCS bit 11,1 -m -Var=IVT1_Result_U2_overallMeasError bit 9,1 -m -Var=IVT1_Result_U2_channelMeasError bit 10,1 -m -Var=IVT1_ID_Result_U2 unsigned 0,8 -m /min:2 /max:2 /d:2 -Var=IVT1_MsgCount_Result_U2 unsigned 12,4 -m -Var=IVT1_Result_U2_mV signed 16,32 -m /u:mV - -[IVT1_Msg_Result_U3] -ID=624h // Current sensor string 1: voltage 3 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_U3_systemError bit 8,1 -m -Var=IVT1_Result_U3_OCS bit 11,1 -m -Var=IVT1_Result_U3_overallMeasError bit 9,1 -m -Var=IVT1_Result_U3_channelMeasError bit 10,1 -m -Var=IVT1_ID_Result_U3 unsigned 0,8 -m /min:3 /max:3 /d:3 -Var=IVT1_MsgCount_Result_U3 unsigned 12,4 -m -Var=IVT1_Result_U3_mV signed 16,32 -m /u:mV - -[IVT1_Msg_Result_T] -ID=625h // Current sensor string 1: temperature (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_T_systemError bit 8,1 -m -Var=IVT1_Result_T_OCS bit 11,1 -m -Var=IVT1_Result_T_overallMeasError bit 9,1 -m -Var=IVT1_Result_T_channelMeasError bit 10,1 -m -Var=IVT1_ID_Result_T unsigned 0,8 -m /min:4 /max:4 /d:4 -Var=IVT1_MsgCount_Result_T unsigned 12,4 -m -Var=IVT1_Result_T_ddegC signed 16,32 -m /u:ddegC /f:0.1 /d:0 - -[IVT1_Msg_Result_W] -ID=626h // Current sensor string 1: power (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_W_systemError bit 8,1 -m -Var=IVT1_Result_W_OCS bit 11,1 -m -Var=IVT1_Result_W_overallMeasError bit 9,1 -m -Var=IVT1_Result_W_channelMeasError bit 10,1 -m -Var=IVT1_Result_W signed 16,32 -m /u:W -Var=IVT1_MsgCount_Result_W unsigned 12,4 -m -Var=IVT1_ID_Result_W unsigned 0,8 -m /min:5 /max:5 /d:5 - -[IVT1_Msg_Result_As] -ID=627h // Current sensor string 1: coulomb counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_As_systemError bit 8,1 -m -Var=IVT1_Result_As_OCS bit 11,1 -m -Var=IVT1_Result_As_overallMeasError bit 9,1 -m -Var=IVT1_Result_As_channelMeasError bit 10,1 -m -Var=IVT1_Result_As signed 16,32 -m /u:As -Var=IVT1_MsgCount_Result_As unsigned 12,4 -m -Var=IVT1_ID_Result_As unsigned 0,8 -m /min:6 /max:6 /d:6 - -[IVT1_Msg_Result_Wh] -ID=628h // Current sensor string 1: energy counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT1_Result_Wh_systemError bit 8,1 -m -Var=IVT1_Result_Wh_OCS bit 11,1 -m -Var=IVT1_Result_Wh_overallMeasError bit 9,1 -m -Var=IVT1_Result_Wh_channelMeasError bit 10,1 -m -Var=IVT1_Result_Wh signed 16,32 -m /u:Wh -Var=IVT1_MsgCount_Result_Wh unsigned 12,4 -m -Var=IVT1_ID_Result_Wh unsigned 0,8 -m /min:7 /max:7 /d:7 - -[IVT2_Msg_Result_I] -ID=721h // Current sensor string 2: current (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_I_systemError bit 8,1 -m -Var=IVT2_Result_I_OCS bit 11,1 -m -Var=IVT2_Result_I_overallMeasError bit 9,1 -m -Var=IVT2_Result_I_channelMeasError bit 10,1 -m -Var=IVT2_ID_Result_I unsigned 0,8 -m -Var=IVT2_MsgCount_Result_I unsigned 12,4 -m -Var=IVT2_Result_I_mA signed 16,32 -m /u:mA - -[IVT2_Msg_Result_U1] -ID=722h // Current sensor string 2: voltage 1 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_U1_systemError bit 8,1 -m -Var=IVT2_Result_U1_overallMeasError bit 9,1 -m -Var=IVT2_Result_U1_channelMeasError bit 10,1 -m -Var=IVT2_Result_U1_OCS bit 11,1 -m -Var=IVT2_ID_Result_U1 unsigned 0,8 -m /min:1 /max:1 /d:1 -Var=IVT2_MsgCount_Result_U1 unsigned 12,4 -m -Var=IVT2_Result_U1_mV signed 16,32 -m /u:mV - -[IVT2_Msg_Result_U2] -ID=723h // Current sensor string 2: voltage 2 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_U2_systemError bit 8,1 -m -Var=IVT2_Result_U2_OCS bit 11,1 -m -Var=IVT2_Result_U2_overallMeasError bit 9,1 -m -Var=IVT2_Result_U2_channelMeasError bit 10,1 -m -Var=IVT2_ID_Result_U2 unsigned 0,8 -m /min:2 /max:2 /d:2 -Var=IVT2_MsgCount_Result_U2 unsigned 12,4 -m -Var=IVT2_Result_U2_mV signed 16,32 -m /u:mV - -[IVT2_Msg_Result_U3] -ID=724h // Current sensor string 2: voltage 3 (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_U3_systemError bit 8,1 -m -Var=IVT2_Result_U3_OCS bit 11,1 -m -Var=IVT2_Result_U3_overallMeasError bit 9,1 -m -Var=IVT2_Result_U3_channelMeasError bit 10,1 -m -Var=IVT2_ID_Result_U3 unsigned 0,8 -m /min:3 /max:3 /d:3 -Var=IVT2_MsgCount_Result_U3 unsigned 12,4 -m -Var=IVT2_Result_U3_mV signed 16,32 -m /u:mV - -[IVT2_Msg_Result_T] -ID=725h // Current sensor string 2: temperature (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_T_systemError bit 8,1 -m -Var=IVT2_Result_T_OCS bit 11,1 -m -Var=IVT2_Result_T_overallMeasError bit 9,1 -m -Var=IVT2_Result_T_channelMeasError bit 10,1 -m -Var=IVT2_ID_Result_T unsigned 0,8 -m /min:4 /max:4 /d:4 -Var=IVT2_MsgCount_Result_T unsigned 12,4 -m -Var=IVT2_Result_T_ddegC signed 16,32 -m /u:ddegC /f:0.1 /d:0 - -[IVT2_Msg_Result_W] -ID=726h // Current sensor string 2: power (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_W_systemError bit 8,1 -m -Var=IVT2_Result_W_OCS bit 11,1 -m -Var=IVT2_Result_W_overallMeasError bit 9,1 -m -Var=IVT2_Result_W_channelMeasError bit 10,1 -m -Var=IVT2_Result_W signed 16,32 -m /u:W -Var=IVT2_MsgCount_Result_W unsigned 12,4 -m -Var=IVT2_ID_Result_W unsigned 0,8 -m /min:5 /max:5 /d:5 - -[IVT2_Msg_Result_As] -ID=727h // Current sensor string 2: coulomb counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_As_systemError bit 8,1 -m -Var=IVT2_Result_As_OCS bit 11,1 -m -Var=IVT2_Result_As_overallMeasError bit 9,1 -m -Var=IVT2_Result_As_channelMeasError bit 10,1 -m -Var=IVT2_Result_As signed 16,32 -m /u:As -Var=IVT2_MsgCount_Result_As unsigned 12,4 -m -Var=IVT2_ID_Result_As unsigned 0,8 -m /min:6 /max:6 /d:6 - -[IVT2_Msg_Result_Wh] -ID=728h // Current sensor string 2: energy counting (in:can_cbs_rx_current_sensor.c:CAN_RxCurrentSensor) -DLC=6 -Var=IVT2_Result_Wh_systemError bit 8,1 -m -Var=IVT2_Result_Wh_OCS bit 11,1 -m -Var=IVT2_Result_Wh_overallMeasError bit 9,1 -m -Var=IVT2_Result_Wh_channelMeasError bit 10,1 -m -Var=IVT2_Result_Wh signed 16,32 -m /u:Wh -Var=IVT2_MsgCount_Result_Wh unsigned 12,4 -m -Var=IVT2_ID_Result_Wh unsigned 0,8 -m /min:7 /max:7 /d:7 - -[foxBMS_Startup] -ID=199h // (in:can.c:CAN_TransmitBootMessage) -DLC=8 +[foxBMS_Boot] +ID=199h // (in:can_cfg_tx_boot-message.c:CANTX_TransmitBootMessage, fv:tx) +Len=8 Var=foxBMS_majorVersionNumber unsigned 0,8 -m Var=foxBMS_minorVersionNumber unsigned 8,8 -m Var=foxBMS_patchVersionNumber unsigned 16,8 -m -Var=foxBMS_uniqueId unsigned 32,32 -m // Content of Device Identification Register (DEVID) -Var=foxBMS_underVersionControl bit 24,1 -Var=foxBMS_dirtyFlag bit 25,1 +Var=foxBMS_uniqueId unsigned 32,32 -m // Content of Device Identification Register (DEVID) +Var=foxBMS_underVersionControl bit 31,1 -m +Var=foxBMS_dirtyFlag bit 30,1 -m Var=foxBMS_releaseDistance unsigned 24,5 -m -Var=foxBMS_releaseDistanceOverflow bit 26,1 - -[foxBMS_DetailState] -ID=226h // Transmits details on flags transmitted by foxBMS_State (in:can_cbs_tx_state.c:CAN_TxDetailState) -DLC=8 -Var=foxBMS_TimingViolationEngine bit 0,1 /ln:"timing violation engine task" // Indicates whether the timing of the engine task has been violated. -Var=foxBMS_TimingViolation1ms bit 1,1 /ln:"timing violation 1ms task" // Indicates whether the timing of the 1ms task has been violated. -Var=foxBMS_TimingViolation10ms bit 2,1 /ln:"timing violation 10ms task" // Indicates whether the timing of the 10ms task has been violated. -Var=foxBMS_TimingViolation100ms bit 3,1 /ln:"timing violation 100ms task" // Indicates whether the timing of the 100ms task has been violated. -Var=foxBMS_TimingViolation100msAlgo bit 4,1 /ln:"timing violation 100ms algorithm task" // Indicates whether the timing of the 100ms algorithm task has been violated. -Var=foxBMS_TimingViolation10msRec bit 10,1 /ln:"timing violation 10ms task recorded" // Indicates whether a violation of the timing of the 10ms task has been recorded. -Var=foxBMS_TimingViolation100msRec bit 11,1 /ln:"timing violation 100ms task recorded" // Indicates whether a violation of the timing of the 100ms task has been recorded. -Var=foxBMS_TimingViolation100msAlgoR bit 12,1 /ln:"timing violation 100ms algorithm task recorded" // Indicates whether a violation of the timing of the 100ms algorithm task has been recorded. -Var=foxBMS_TimingViolationEngineRec bit 8,1 /ln:"timing violation engine task recorded" // Indicates whether a violation of the timing of the engine task has been recorded. -Var=foxBMS_TimingViolation1msRec bit 9,1 /ln:"timing violation 1ms task recorded" // Indicates whether a violation of the timing of the 1ms task has been recorded. +Var=foxBMS_releaseDistanceOverflow bit 29,1 -m + +[foxBMS_BmsStateDetails] +ID=226h // Transmits details on flags transmitted by foxBMS_State (in:can_cbs_tx_state.c:CANTX_BmsStateDetails, fv:tx) +Len=8 +CycleTime=1000 -p +Var=foxBMS_TimingViolationEngine bit 7,1 -m /ln:"timing violation engine task" // Indicates whether the timing of the engine task has been violated. +Var=foxBMS_TimingViolation1ms bit 6,1 -m /ln:"timing violation 1ms task" // Indicates whether the timing of the 1ms task has been violated. +Var=foxBMS_TimingViolation10ms bit 5,1 -m /ln:"timing violation 10ms task" // Indicates whether the timing of the 10ms task has been violated. +Var=foxBMS_TimingViolation100ms bit 4,1 -m /ln:"timing violation 100ms task" // Indicates whether the timing of the 100ms task has been violated. +Var=foxBMS_TimingViolation100msAlgo bit 3,1 -m /ln:"timing violation 100ms algorithm task" // Indicates whether the timing of the 100ms algorithm task has been violated. +Var=foxBMS_TimingViolation10msRec bit 13,1 -m /ln:"timing violation 10ms task recorded" // Indicates whether a violation of the timing of the 10ms task has been recorded. +Var=foxBMS_TimingViolation100msRec bit 12,1 -m /ln:"timing violation 100ms task recorded" // Indicates whether a violation of the timing of the 100ms task has been recorded. +Var=foxBMS_TimingViolation100msAlgoR bit 11,1 -m /ln:"timing violation 100ms algorithm task recorded" // Indicates whether a violation of the timing of the 100ms algorithm task has been recorded. +Var=foxBMS_TimingViolationEngineRec bit 15,1 -m /ln:"timing violation engine task recorded" // Indicates whether a violation of the timing of the engine task has been recorded. +Var=foxBMS_TimingViolation1msRec bit 14,1 -m /ln:"timing violation 1ms task recorded" // Indicates whether a violation of the timing of the 1ms task has been recorded. [foxBMS_DieId] -ID=227h // Transmits the unique die id of the MCU on which foxBMS is currently running (in:can.c:CAN_TransmitDieId) -DLC=8 -Var=MCU_lotNumber unsigned 8,24 -m /max:1 /ln:"lot number of the MCU" // lot number of the MCU (read from DIEIDH register) -Var=MCU_waferNumber unsigned 32,8 -m /max:1 /ln:"wafer number of the MCU" // wafer number of the MCU (read from DIEDL register) -Var=MCU_xWaferCoordinate unsigned 52,12 -m /max:1 /ln:"x wafer coordinate" // x coordinate of the MCU die on the wafer (read from DIEIDL register) -Var=MCU_yWaferCoordinate unsigned 40,12 -m /max:1 /ln:"y wafer coordinate" // y coordinate of the MCU die on the wafer (read from DIEIDL register) +ID=227h // Transmits the unique die id of the MCU on which foxBMS is currently running (in:can_cfg_tx_boot-message.c:CANTX_TransmitDieId, fv:tx) +Len=8 +Var=MCU_lotNumber unsigned 8,24 -m /max:1 /ln:"lot number of the MCU" // lot number of the MCU (read from DIEIDH register) +Var=MCU_waferNumber unsigned 32,8 -m /max:1 /ln:"wafer number of the MCU" // wafer number of the MCU (read from DIEDL register) +Var=MCU_xWaferCoordinate unsigned 52,12 -m /max:1 /ln:"x wafer coordinate" // x coordinate of the MCU die on the wafer (read from DIEIDL register) +Var=MCU_yWaferCoordinate unsigned 40,12 -m /max:1 /ln:"y wafer coordinate" // y coordinate of the MCU die on the wafer (read from DIEIDL register) diff --git a/tools/dbc/symbol_creator.py b/tools/dbc/symbol_creator.py index 67a85139..3f574f5f 100644 --- a/tools/dbc/symbol_creator.py +++ b/tools/dbc/symbol_creator.py @@ -42,6 +42,7 @@ import argparse import logging +import math from pathlib import Path SCRIPT_PATH = Path(__file__).parent.resolve() @@ -97,18 +98,20 @@ def main(): cell_voltages = SCRIPT_PATH / "multiplexed_cell_voltages_for_sym_file.txt" volts = [] name = "cellVoltage" + cycle_time_ms = str(math.ceil(args.number_of_cells / 4) * 100) for i in range(0, args.number_of_cells): volts.append("[foxBMS_CellVoltage]") if not i: volts.append("ID=240h") - volts.append("DLC=8") + volts.append("Len=8") + volts.append(f"CycleTime={cycle_time_ms} -p") volts.append( f"Mux=mux_{name}_{(i * 4):03d}_{((i * 4) + 3):03d} 0,8 {sym_hex(i)} -m" ) - volts.append(f"Var={name}_{(i * 4):03d}_invalidFlag unsigned 11,1 -m") - volts.append(f"Var={name}_{((i * 4) + 1):03d}_invalidFlag unsigned 10,1 -m") - volts.append(f"Var={name}_{((i * 4) + 2):03d}_invalidFlag unsigned 9,1 -m") - volts.append(f"Var={name}_{((i * 4) + 3):03d}_invalidFlag unsigned 8,1 -m") + volts.append(f"Var={name}_{(i * 4):03d}_invalidFlag bit 11,1 -m") + volts.append(f"Var={name}_{((i * 4) + 1):03d}_invalidFlag bit 10,1 -m") + volts.append(f"Var={name}_{((i * 4) + 2):03d}_invalidFlag bit 9,1 -m") + volts.append(f"Var={name}_{((i * 4) + 3):03d}_invalidFlag bit 8,1 -m") volts.append(f"Var={name}_{(i * 4):03d} unsigned 12,13 -m /u:mV") volts.append(f"Var={name}_{((i * 4) + 1):03d} unsigned 25,13 -m /u:mV") volts.append(f"Var={name}_{((i * 4) + 2):03d} unsigned 38,13 -m /u:mV") @@ -119,20 +122,22 @@ def main(): cell_temperatures = SCRIPT_PATH / "multiplexed_cell_temperatures_for_sym_file.txt" temps = [] name = "cellTemperature" + cycle_time_ms = str(math.ceil(args.number_of_cell_temperatures / 6) * 100) for i in range(0, args.number_of_cell_temperatures): temps.append("[foxBMS_CellTemperature]") if not i: temps.append("ID=250h") - temps.append("DLC=8") + temps.append("Len=8") + temps.append(f"CycleTime={cycle_time_ms} -p") temps.append( f"Mux=mux_{name}_{(i * 6):03d}_{((i * 6) + 5):03d} 0,8 {sym_hex(i)} -m" ) - temps.append(f"Var={name}_{(i * 6):03d}_invalidFlag unsigned 15,1 -m") - temps.append(f"Var={name}_{((i * 6) + 1):03d}_invalidFlag unsigned 14,1 -m") - temps.append(f"Var={name}_{((i * 6) + 2):03d}_invalidFlag unsigned 13,1 -m") - temps.append(f"Var={name}_{((i * 6) + 3):03d}_invalidFlag unsigned 12,1 -m") - temps.append(f"Var={name}_{((i * 6) + 4):03d}_invalidFlag unsigned 11,1 -m") - temps.append(f"Var={name}_{((i * 6) + 5):03d}_invalidFlag unsigned 10,1 -m") + temps.append(f"Var={name}_{(i * 6):03d}_invalidFlag bit 15,1 -m") + temps.append(f"Var={name}_{((i * 6) + 1):03d}_invalidFlag bit 14,1 -m") + temps.append(f"Var={name}_{((i * 6) + 2):03d}_invalidFlag bit 13,1 -m") + temps.append(f"Var={name}_{((i * 6) + 3):03d}_invalidFlag bit 12,1 -m") + temps.append(f"Var={name}_{((i * 6) + 4):03d}_invalidFlag bit 11,1 -m") + temps.append(f"Var={name}_{((i * 6) + 5):03d}_invalidFlag bit 10,1 -m") temps.append(f"Var={name}_{(i * 6):03d} signed 16,8 -m /u:degC") temps.append(f"Var={name}_{((i * 6) + 1):03d} signed 24,8 -m /u:degC") temps.append(f"Var={name}_{((i * 6) + 2):03d} signed 32,8 -m /u:degC") diff --git a/tools/gui/fgui/__init__.py b/tools/gui/fgui/__init__.py index 25ee1b26..7c8a9971 100644 --- a/tools/gui/fgui/__init__.py +++ b/tools/gui/fgui/__init__.py @@ -41,7 +41,7 @@ """sets the version package etc.""" import os -__version__ = "1.4.0" +__version__ = "1.4.1" __appname__ = "foxBMS 2" __author__ = "The foxBMS Team" __copyright__ = "(c) 2010 - 2022 foxBMS" diff --git a/tools/ide/vscode/c_cpp_properties.json.jinja2 b/tools/ide/vscode/c_cpp_properties.json.jinja2 index 80a71fc4..a94f6e4a 100644 --- a/tools/ide/vscode/c_cpp_properties.json.jinja2 +++ b/tools/ide/vscode/c_cpp_properties.json.jinja2 @@ -23,6 +23,8 @@ "${workspaceFolder}/src/app/driver/adc", "${workspaceFolder}/src/app/driver/can", "${workspaceFolder}/src/app/driver/can/cbs", + "${workspaceFolder}/src/app/driver/can/cbs/rx", + "${workspaceFolder}/src/app/driver/can/cbs/tx", "${workspaceFolder}/src/app/driver/checksum", "${workspaceFolder}/src/app/driver/config", "${workspaceFolder}/src/app/driver/contactor", @@ -58,6 +60,7 @@ "${workspaceFolder}/src/app/driver/ts/epcos/b57251v5103j060", "${workspaceFolder}/src/app/driver/ts/epcos/b57861s0103f045", "${workspaceFolder}/src/app/driver/ts/fake/none", + "${workspaceFolder}/src/app/driver/ts/murata/ncu15xh103f6sxx", "${workspaceFolder}/src/app/driver/ts/vishay/ntcalug01a103g", "${workspaceFolder}/src/app/driver/ts/vishay/ntcle317e4103sba", "${workspaceFolder}/src/app/driver/ts/{{TEMPERATURE_SENSOR_MANUFACTURER}}/{{TEMPERATURE_SENSOR_MODEL}}/{{TEMPERATURE_SENSOR_METHOD}}", diff --git a/tools/ide/vscode/cspell.json.jinja2 b/tools/ide/vscode/cspell.json.jinja2 index 07090d8b..fb5f9c1d 100644 --- a/tools/ide/vscode/cspell.json.jinja2 +++ b/tools/ide/vscode/cspell.json.jinja2 @@ -4,6 +4,24 @@ "version": "0.2", // language - current active spelling language "language": "en", + "enabledLanguageIds": [ + "bat", + "bibtex", + "c", + "cpp", + "css", + "diff", + "html", + "json", + "jsonc", + "markdown", + "plaintext", + "powershell", + "python", + "shellscript", + "xml", + "yaml" + ], // words - list of words to be always considered correct "words": [ "alphanumericals", @@ -89,9 +107,17 @@ "fgui", // Windows related "USERPROFILE", + "ERRORLEVEL", "LOCALAPPDATA", "APPDATA", + // cmd, batch + "dpfn", + "enabledelayedexpansion", + "enableextensions", "findstr", + "popd", + "pushd", + "setlocal", // file extensions "vsdx", // file names @@ -103,6 +129,8 @@ "AFE", // Analog Front-End "AFES", // Analog Front-Ends "BALS", + "CANRX", // CAN receive + "CANTX", // CAN transmit "HTSEN", "ILCK", "SYSM", @@ -149,6 +177,9 @@ // general software terms "MOSFET", "memcpy", + "realloc", + "calloc", + "mcalloc", "NTFS", "JTAG", "unstaged", @@ -440,6 +471,7 @@ "pcan", "lauterbach", "epcos", + "murata", "vishay", "mram", // Magnetoresistive Random Access Memory "ntcalug", // temperature sensor form vishay @@ -456,6 +488,7 @@ "localbuild", "noauth", "workitem", + "TESTCASE", // asm keywords "endasmfunc", // third party software, tools, configuration files etc. @@ -609,6 +642,7 @@ "hexlify", "startswith", // python packages + "cantools", "jsonschema", "cffconvert", "clib", @@ -673,7 +707,7 @@ "softwareTerms", "misc" ], - "flagWords":[ + "flagWords": [ "endianess", "datasheet" ], @@ -739,6 +773,7 @@ "tests/axivion/rule_config_c.json", "tests/axivion/ci_config.json", "tests/axivion/addon-test/**/test_*.*", + "tests/axivion/qualification-test/qualification-kit/**", "tests/re-names/*.json", "tools/dbc/*.dbc", "tools/dbc/*.sym", diff --git a/tools/ide/vscode/settings.json.jinja2 b/tools/ide/vscode/settings.json.jinja2 index b6fed79b..77c7f204 100644 --- a/tools/ide/vscode/settings.json.jinja2 +++ b/tools/ide/vscode/settings.json.jinja2 @@ -23,7 +23,7 @@ "**/build/**/*.ppm": true, "**/build/**/*.ppr": true, "**/build/**/*.pprs": true, - "**/conf/hcg/include/**":true, + "**/conf/hcg/include/**": true, ".github/**": true, ".gitlab/**": true, ".vscode/**": true, @@ -32,8 +32,10 @@ "build/axivion/**": true, "build/conf_check_*/**": true, "build/predefined_defines/**": true, - "**/.lock-waf_*_build":true, - "**/.wafpickle-*":true + "**/.lock-waf_*_build": true, + "**/.wafpickle-*": true, + "**/*.gcov": true, + "**/*.zip": true }, "files.watcherExclude": { "**/.git/objects/**": true, @@ -44,7 +46,8 @@ "**/build/**/*.pp": true, "**/build/**/*.ppr": true, "**/build/**/*.pprs": true, - "**/conf/hcg/include/**": true + "**/conf/hcg/include/**": true, + "tests/axivion/qualification-kit/**": true }, "search.exclude": { "**/node_modules": true, @@ -55,7 +58,8 @@ "**build/**/*.pp": true, "**build/**/*.ppr": true, "**build/**/*.pprs": true, - "**/conf/hcg/include/**": true + "**/conf/hcg/include/**": true, + "tests/axivion/qualification-kit/**": true }, "css.validate": false, "json.schemas": [ diff --git a/tools/utils/cmd/find_base_conda.bat b/tools/utils/cmd/find_base_conda.bat index 9c2033af..599d7d38 100644 --- a/tools/utils/cmd/find_base_conda.bat +++ b/tools/utils/cmd/find_base_conda.bat @@ -41,7 +41,7 @@ @PUSHD %~dp0 @REM get conda environment name -@CALL :NORMALIZEPATH "%~dp0..\..\..\conf\env\conda_env_win32.yaml" +@CALL :NORMALIZE_PATH "%~dp0..\..\..\conf\env\conda_env_win32.yaml" @SET CONDA_ENV_FILE=%NORMALIZED_PATH% @FOR /f "usebackq tokens=*" %%A IN ("%CONDA_ENV_FILE%") DO @( @FOR /F "tokens=1" %%B IN ("%%A") DO @( @@ -114,6 +114,6 @@ @POPD -:NORMALIZEPATH +:NORMALIZE_PATH @SET NORMALIZED_PATH=%~dpfn1 @EXIT /B diff --git a/tools/utils/conda-update-env.bat b/tools/utils/conda-update-env.bat index 9897c204..458225ed 100644 --- a/tools/utils/conda-update-env.bat +++ b/tools/utils/conda-update-env.bat @@ -56,6 +56,6 @@ conda env create -f %CONDA_DEVELOPMENT_ENVIRONMENT_CONFIGURATION_FILE% @ECHO done... -:NORMALIZEPATH +:NORMALIZE_PATH @SET NORMALIZED_PATH=%~dpfn1 @EXIT /B diff --git a/tools/utils/update_version.py b/tools/utils/update_version.py index de7105a9..f591b4d2 100644 --- a/tools/utils/update_version.py +++ b/tools/utils/update_version.py @@ -41,6 +41,7 @@ """Template for Python scripts""" import sys +import csv import argparse import os import re @@ -51,6 +52,8 @@ from git import Repo +MAGIC_DATE = "xxxx-xx-xx" + def get_git_root(path: str = os.path.realpath(__file__)) -> Path: """helper function to find the repository root @@ -72,47 +75,19 @@ def date_get_today() -> str: return today.strftime("%Y-%m-%d") -def main(): # pylint: disable=too-many-statements - """This script does this and that""" - parser = argparse.ArgumentParser() - parser.add_argument( - "-v", - "--verbosity", - dest="verbosity", - action="count", - default=0, - help="set verbosity level", - ) - parser.add_argument( - "--from", - dest="from_version", - action="store", - default="x.y.z", - help="from version", - ) - parser.add_argument( - "--to", - dest="to_version", - action="store", - default=0, - help="to version", - ) - args = parser.parse_args() - _from = args.from_version - _to = args.to_version - if not _to: - sys.exit("Don't know to version to bump.") - root = Path(get_git_root()) - docs = root / "docs" - iso_date_today = date_get_today() - if args.verbosity == 1: - logging.basicConfig(level=logging.INFO) - elif args.verbosity > 1: - logging.basicConfig(level=logging.DEBUG) - else: - logging.basicConfig(level=logging.ERROR) +def get_previous_release(repo: Path) -> str: + """Return the previous version number""" + path = str(repo / "docs" / "general" / "releases.csv") + with open(path, "r", encoding="utf-8") as f: + reader = csv.DictReader(f, delimiter=";") + for row in reader: + if row["foxBMS 2"] != "vx.y.z": + return row["foxBMS 2"][1:] + return "" - # *.c, *.h files + +def update_c_h_files(root, iso_date_today, _from, _to): + """update .c, and .h files""" all_c_h_files = ( list((root / "conf").rglob("**/*.[c|h]")) + list((root / "docs").rglob("**/*.[c|h]")) @@ -126,10 +101,13 @@ def main(): # pylint: disable=too-many-statements logging.debug(f"from: {old_version}") logging.debug(f"to: {new_version}") for i in all_c_h_files: - txt = i.read_text(encoding="utf-8") + try: + txt = i.read_text(encoding="utf-8") + except: # pylint: disable=bare-except + continue if " * @author foxBMS Team" in txt: # re-read file to ensure ascii encoding on our files - txt = i.read_text(encoding="utf-8") + txt = i.read_text(encoding="ascii") logging.debug(f"Found foxBMS 2 file: {i}") if old_version in txt: logging.debug("...Replacing version") @@ -138,45 +116,139 @@ def main(): # pylint: disable=too-many-statements txt = updated.sub(updated_new, txt) i.write_text(txt, encoding="ascii") + +def update_wscript(root, _from, _to): + """update wscript""" wscript = root / "wscript" txt = wscript.read_text(encoding="utf-8") txt = txt.replace(f'VERSION = "{_from}"', f'VERSION = "{_to}"') wscript.write_text(txt, encoding="utf-8") + +def update_citation(root, iso_date_today, _from, _to): + """Update citation file""" citation = root / "CITATION.cff" txt = citation.read_text(encoding="utf-8") txt = txt.replace(f'version: "{_from}"', f'version: "{_to}"') - txt = re.sub( - r"date-released: \d{4}-\d{2}-\d{2}", f"date-released: {iso_date_today}", txt - ) + if _to == "x.y.z": # back to development, use magic date string + txt = re.sub(r"date-released: .*", f"date-released: {MAGIC_DATE}", txt) + else: + txt = txt.replace( + f"date-released: {MAGIC_DATE}", f"date-released: {iso_date_today}" + ) citation.write_text(txt, encoding="utf-8") - changelog = docs / "general" / "changelog.rst" + +def update_changelog(root, iso_date_today, _from, _to): + """Update changelog""" + changelog = root / "docs" / "general" / "changelog.rst" logging.debug(f"Patching {changelog}") - changelog_regex = re.compile( - rf"\[{_from}\][ ]-[ ]([0-9]{{4}})[-](([0-9]{{2}})|(xx))-(([0-9]{{2}})|(xx))" - ) - logging.debug(f"Using {changelog_regex}") txt = changelog.read_text(encoding="utf-8") - txt = changelog_regex.sub( - f"[{_to}] - {iso_date_today}", - txt, - ) + if _to == "x.y.z": + txt = txt.splitlines() + txt = ( + txt[:42] + + f""" +******************** +[{_to}] - {MAGIC_DATE} +******************** + +Added +===== + +Changed +======= + +Deprecated +========== + +Removed +======= + +Fixed +===== + +""".splitlines() + + txt[43:] + ) + txt = "\n".join(txt) + "\n" + else: + txt = txt.replace(f"[{_from}] - {MAGIC_DATE}", f"[{_to}] - {iso_date_today}") changelog.write_text(txt, encoding="utf-8") - releases = docs / "general" / "releases.csv" + +def update_commit_fragments(root, previous_release, _from, _to): + """Update the next-release commit fragment and create the one for the release""" + if _to == "x.y.z": + change_type = "" + else: + try: + _to_l = [int(i) for i in _to.split(".")] + previous_release_l = [int(i) for i in previous_release.split(".")] + change_type = "Bugfix" + if _to_l[1] > previous_release_l[1]: + change_type = "Minor" + if _to_l[0] > previous_release_l[0]: + change_type = "Major" + except ValueError: + sys.exit("unexpected version identifier") + commit_msg_file = root / "docs" / "general" / "commit-msgs" / "next-release.txt" + logging.debug(f"Patching {commit_msg_file}") + txt = commit_msg_file.read_text(encoding="utf-8") + txt = txt.replace("", change_type) + txt = txt.replace(f"foxBMS 2 (v{_from})", f"foxBMS 2 (v{_to})") + txt = txt.replace( + f"v{_from}/general/changelog.html", + f"v{_to}/general/changelog.html", + ) + if _to != "x.y.z": + (commit_msg_file.parent / f"release-v{_to}.txt").write_text( + txt, encoding="utf-8" + ) + txt = """ release of foxBMS 2 (vx.y.z) + +* + +For a detailed list of changes, please refer to the documentation at +https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/vx.y.z/general/changelog.html. +""" + commit_msg_file.write_text(txt, encoding="utf-8") + + +def update_release_csv(root, iso_date_today, _from, _to): + """Update release.csv""" + releases = root / "docs" / "general" / "releases.csv" txt = releases.read_text(encoding="utf-8") - txt = txt.replace(f"v{_from};", f"v{_to};", 1) - txt = re.sub(r"\d{4}-\d{2}-\d{2}", iso_date_today, txt, 1) - txt = txt.replace(f"/v{_from}/", f"/v{_to}/", 1) + if _to == "x.y.z": + txt = txt.splitlines() + txt = ( + [txt[0]] + + [ + f"v{_to}; {MAGIC_DATE}; https://iisb-foxbms.iisb.fraunhofer.de/foxbms/gen2/docs/html/v{_to}/" # pylint: disable=line-too-long + ] + + txt[1:] + ) + txt = "\n".join(txt) + "\n" + else: + txt = txt.replace(f"v{_from};", f"v{_to};", 1) + txt = txt.replace(f"{MAGIC_DATE};", f"{iso_date_today};", 1) + txt = txt.replace(f"/v{_from}/", f"/v{_to}/", 1) releases.write_text(txt, encoding="utf-8") - software_installation = docs / "getting-started" / "software-installation.rst" + +def update_installation_instructions(root, _from, _to): + """Update software-installation instructions""" + software_installation = ( + root / "docs" / "getting-started" / "software-installation.rst" + ) txt = software_installation.read_text(encoding="utf-8") txt = txt.replace(_from, _to, 4) software_installation.write_text(txt, encoding="utf-8") - macros = docs / "macros.txt" + +def update_doc_macros(root, _from, _to): + """Update the sphinx macro file""" + macros = root / "docs" / "macros.txt" txt = macros.read_text(encoding="utf-8") txt = txt.replace( f".. |version_foxbms| replace:: ``{_from}``", @@ -185,15 +257,71 @@ def main(): # pylint: disable=too-many-statements ) macros.write_text(txt, encoding="utf-8") + +def update_fgui(root, _from, _to): + """Update fgui module""" fgui = root / "tools" / "gui" / "fgui" / "__init__.py" txt = fgui.read_text(encoding="utf-8") - txt = txt.replace( - f'__version__ = "{_from}"', - f'__version__ = "{_to}"', - 1, - ) + txt = txt.replace(f'__version__ = "{_from}"', f'__version__ = "{_to}"', 1) fgui.write_text(txt, encoding="utf-8") +def main(): # pylint: disable=too-many-statements + """Update the version information in all relevant files.""" + parser = argparse.ArgumentParser() + parser.add_argument( + "-v", + "--verbosity", + dest="verbosity", + action="count", + default=0, + help="set verbosity level", + ) + parser.add_argument( + "--from", + dest="from_version", + action="store", + default="x.y.z", + help="from version", + ) + parser.add_argument( + "--to", + dest="to_version", + action="store", + default=0, + help="to version", + ) + args = parser.parse_args() + _from = args.from_version + _to = args.to_version + if not _to: + sys.exit("Don't know to version to bump.") + if _from == _to: + sys.exit("--from and --to cannot be the same value") + + root = Path(get_git_root()) + previous_release = get_previous_release(root) + if not previous_release: + sys.exit("Could not determine previous version.") + + iso_date_today = date_get_today() + if args.verbosity == 1: + logging.basicConfig(level=logging.INFO) + elif args.verbosity > 1: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.ERROR) + + update_c_h_files(root, iso_date_today, _from, _to) + update_wscript(root, _from, _to) + update_citation(root, iso_date_today, _from, _to) + update_changelog(root, iso_date_today, _from, _to) + update_commit_fragments(root, previous_release, _from, _to) + update_release_csv(root, iso_date_today, _from, _to) + update_installation_instructions(root, _from, _to) + update_doc_macros(root, _from, _to) + update_fgui(root, _from, _to) + + if __name__ == "__main__": main() diff --git a/tools/utils/verify_checksums.py b/tools/utils/verify_checksums.py new file mode 100644 index 00000000..20da4fd0 --- /dev/null +++ b/tools/utils/verify_checksums.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# We kindly request you to use one or more of the following phrases to refer to +# foxBMS in your hardware, software, documentation or advertising materials: +# +# - "This product uses parts of foxBMS®" +# - "This product includes parts of foxBMS®" +# - "This product is derived from foxBMS®" + +"""Calculates the checksum of file or directory and checks it against a known +hash.""" + +import argparse +import hashlib +import logging +import sys +from pathlib import Path + +MAX_READ = 4096 + + +def get_checksum(files: list[Path]): + """returns the combined checksum for a list of files and their names.""" + checksum = hashlib.sha256() + for _file in files: + buf = _file.name.encode("utf-8") + checksum.update(buf) + with open(_file, "rb") as f: + while buf: + buf = f.read(MAX_READ) + checksum.update(buf) + logging.debug(f"{_file} --> {checksum.hexdigest()}") + + return checksum.hexdigest() + + +def main(): + """verifies a checksum""" + parser = argparse.ArgumentParser() + parser.add_argument( + "-v", + "--verbosity", + dest="verbosity", + action="count", + default=0, + help="set verbosity level", + ) + parser.add_argument( + dest="fd_input", + help="FILE or DIRECTORY to be checked", + ) + parser.add_argument( + dest="known_hash", + help="Known hash against which should be tested.", + ) + args = parser.parse_args() + + if args.verbosity == 1: + logging.basicConfig(level=logging.INFO) + elif args.verbosity > 1: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.ERROR) + + files = Path(args.fd_input) + + logging.info(f"Known hash is: {args.known_hash}") + + if files.is_file(): + files = [files] + else: + files = [i for i in files.rglob("*") if i.is_file()] + + calculated_hash = get_checksum(files) + logging.info(f"Calculated hash is: {calculated_hash}") + + if not args.known_hash == calculated_hash: + logging.error("Hashes do not match.") + sys.exit(1) + else: + logging.debug("Hash matches.") + + +if __name__ == "__main__": + main() diff --git a/tools/waf-tools/f_guidelines.py b/tools/waf-tools/f_guidelines.py index ba896e3a..1cd324a5 100644 --- a/tools/waf-tools/f_guidelines.py +++ b/tools/waf-tools/f_guidelines.py @@ -740,7 +740,7 @@ def test(filename, txt, regex, version): def keyword(self): """Displayed keyword for check""" - return f"Checking filelevel doxygen ({self.rule_name})" + return f"Checking file level doxygen ({self.rule_name})" class c_check_define_guard(Task.Task): diff --git a/wscript b/wscript index ae2e63b3..1148c42d 100644 --- a/wscript +++ b/wscript @@ -77,7 +77,7 @@ top = "." # pylint:disable=invalid-name APPNAME = "foxBMS" """name of the application. This is used in various waf functions""" -VERSION = "1.4.0" +VERSION = "1.4.1" """version of the application. This is used in various waf functions. This version must match the version number defined in ``macros.txt``. Otherwise a configuration error is thrown.""" @@ -648,6 +648,7 @@ def build(bld): # pylint: disable=too-many-branches,too-many-statements os.path.join( "docs", "developer-manual", "style-guide", "state-machine-example" ), + os.path.join("docs", "software", "modules", "driver", "can"), os.path.join("docs", "software", "modules", "engine", "database"), os.path.join("docs", "software", "modules", "task", "ftask"), ], @@ -1053,3 +1054,25 @@ def check_test_files(ctx): err_msg += f"Missing test file for: {i} (should be in: {test_file})\n" if diff: ctx.fatal(f"{err_msg}\nTest files are missing.") + + +def get_axivion_files(ctx): + """get all relevant test files. The output is meant to be used in + tests/axivion/qualification-test/run_axivion_qualification_kit_tests.bat""" + as_seen_from = ctx.path.find_node("tests/axivion/qualification-test") + all_test_files = ctx.path.ant_glob( + [ + "tests/axivion/qualification-test/qualification-kit/**/*.c", + "tests/axivion/qualification-test/qualification-kit/**/*.tst", + ], + ) + tests = [] + for i in all_test_files: + real_path = pathlib.Path(i.parent.path_from(as_seen_from)).as_posix().split("/") + g_path = "".join(["*/" for _ in real_path]) + if g_path not in tests: + tests.append(g_path) + resulting_glob = [] + for i in tests: + resulting_glob.extend([f"{i}*.c", f"{i}*.tst"]) + print(" ".join(sorted(resulting_glob)))