- Immediate load cut-off in case of current > 2x rated current (still to be fine-tuned) - Using built-in comparator of STM32 MCU - Currently only supported by PWM charge controller PCB, as it doesn't have an internal fuse
Libre Solar Charge Controller Firmware
Firmware based on ARM mbed framework for the Libre Solar MPPT/PWM solar charge controllers
Supported devices
The software is configurable to support different charge controller PCBs with either STM32F072 (including CAN support) or low-power STM32L072/3 MCUs.
- Libre Solar MPPT 20A with CAN (v0.10)
- Libre Solar MPPT 12A (v0.5)
- Libre Solar MPPT 10A with USB (v0.2 and v0.4)
- Libre Solar PWM 20A (preliminary support)
Toolchain and flashing instructions
See the Libre Solar website for a detailed instruction how to develop software and flash new firmware.
Remark: Flashing the STM32L072 MCU (as used in the 10A MPPT and PWM charge controller) using OpenOCD with the standard settings from PlatformIO fails in many cases. Possible workarounds:
-
Change OpenOCD settings to
set WORKAREASIZE 0x1000in the file~/.platformio/packages/tool-openocd/scripts/board/st_nucleo_l073rz.cfg. -
Use ST-Link tools. For Windows there is a GUI tool. Under Linux use following command:
st-flash write .pioenvs/cloudsolar_0_4/firmware.bin 0x08000000
-
Use other debuggers and tools, e.g. Segger J-Link.
Initial software setup (IMPORTANT!)
- Select the correct board in
platformio.iniby removing the comment before the board name under [platformio] - Copy
config.h_templatetoconfig.hand adjust basic settings (config.his ignored by git, so your changes are kept after software updates usinggit pull)
API documentation
The documentation auto-generated by Doxygen can be found here.
Unit tests
In order to run the unit tests, you need a PlatformIO Plus account. Run tests with the following command:
platformio test -e unit_test_native