LibreSolar / charge-controller-firmware

Firmware for Libre Solar MPPT/PWM charge controllers
https://libre.solar/charge-controller-firmware/
Apache License 2.0
144 stars 71 forks source link

STM32 bootloader triggering for STM32G4 and flash information via ThingSet #121

Closed martinjaeger closed 3 years ago

martinjaeger commented 3 years ago

Adding functions required for firmware upgrade from ESP32 via serial.

This requires a change in the esp32-edge firmware as the flash information was moved to a dedicated dfu node in ThingSet.

One reason for moving it to a new node is that I'd like to use the info node for information that might be published to a remote server in order to track firmware version, etc. However, the flash size and flash page size is only interesting for a device that upgrades the firmware locally. Also it should not be possible to trigger the bootloader remotely as the device would get stuck afterwards. So if we move this to a dedicated node, all functions or values behind info and exec can be exposed to normal users.

Replaces PR #119

martinjaeger commented 3 years ago

@daniel-connectedenergy FYI: I cherry-picked parts of a commit that you made for EMBLEM (for setting the option bytes and triggering the bootloader).