Skip to content

lectro1/bms0v2-firmware

 
 

Repository files navigation

Libre Solar BMS Firmware

build badge

This repository contains the firmware for the different Libre Solar Battery Management Systems. Originally, the firmware was based on ARM Mbed OS. The current version also supports using Zephyr RTOS for some boards.

Warning: This firmware is under active development. Even though we try our best not to break any features that worked before, not every commit is fully tested on every board before including it to the master branch. As soon as the status of the firmware is considered stable enough, we will test the core features on all boards and generate a release.

Supported devices

ARM Mbed OS:

  • Libre Solar 3-5s (12V) BMS with TI bq76920: BMS-5S50-SC
  • Libre Solar 6-15s (24-48V) BMS with TI bq76930/40: BMS-15S80-SC

Zephyr (preliminary):

  • Libre Solar 3-8s (12V/24V) BMS with Intersil ISL94202: BMS-8S50-IC

Building and flashing the firmware

This repository contains git submodules, so you need to clone (download) the repository by calling:

git clone --recursive https://github.com/LibreSolar/bms-firmware

Unfortunately, the green GitHub "Clone or download" button does not include submodules. If you cloned the repository already and want to pull the submodules, run git submodule update --init --recursive.

ARM Mbed OS

It is suggested to use Visual Studio Code and PlatformIO for firmware development, as it simplifies compiling and uploading the code a lot:

  1. Install Visual Studio Code and PlatformIO to build the firmware.

  2. Select the correct board in platformio.ini by removing the comment before the board name under [platformio]

  3. Connect the board via a programmer. See the Libre Solar website for further project-agnostic instructions.

  4. Press the upload button at the bottom left corner in VS Code.

Zephyr RTOS

The BMS-8S50-IC is currently only supported in Zephyr. PlatformIO has built-in support for Zephyr, so you can use it the same way as explained above for Mbed. (see platformio.ini for configured Zephyr environments)

If you want to use the native Zephyr build environment, you need to call west from within the zephyr subfolder, where prj.conf and CMakeLists.txt are located.

API documentation

The documentation auto-generated by Doxygen can be found here.

Unit tests

Writing the tests is still work in progress. New functions should be implemented in test-driven development fashion. Tests for old functions will be added step by step.

Run the tests with the following command:

platformio test -e unit_test_isl94202 -e unit_test_bq769x0

About

Firmware for LibreSolar BMS boards based on bq769x0 or ISL94202

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 55.4%
  • C++ 42.9%
  • CMake 1.1%
  • Other 0.6%