LibreSolar / bms-firmware

Firmware for LibreSolar BMS boards based on bq769x0, bq769x2 or ISL94202
https://libre.solar/bms-firmware/
Apache License 2.0
146 stars 67 forks source link

Add support for MCUboot and enable it for BMS C1 #72

Closed martinjaeger closed 2 months ago

martinjaeger commented 3 months ago

As the title suggests, this PR adds support for DFU with MCUboot.

So far only enabled for the BMS C1.

See the docs updates on instructions how to test it.

Depends on https://github.com/ThingSet/thingset-zephyr-sdk/pull/48

martinjaeger commented 2 months ago

Sure. No hurry from my side.

Let me know if everything worked well and if the documentation was sufficient.

pasrom commented 2 months ago

I did test it and encountered two problems:

  1. west espressif monitor does not work anymore from the app folder (inside app/build/app it works).
  2. The update script does not receive the 0x84 after the reboot function is called, because the processor is already rebooting, so https://github.com/ThingSet/thingset-zephyr-sdk/pull/50 should resolve it.
martinjaeger commented 2 months ago
  1. west espressif monitor does not work anymore from the app folder (inside app/build/app it works).

Ah, interesting. I just noticed it doesn't work anymore (but didn't associate it with sysbuild) and updated the documentation accordingly. I'm using picocom all the time anyway and didn't want to dig deeper why espressif monitor stopped working.

martinjaeger commented 2 months ago

@pasrom I have updated the commit sha in west.yml to pull in your fixes for 2.