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

I2C error #59

Closed Ananyaaynana closed 6 months ago

Ananyaaynana commented 6 months ago

Hardware used: Using a custom board with the same I2C configuration as the 0.4v bms_c1 board. GPIO8 is SDA and GPIO9 is SCL. Screenshot from 2024-02-29 14-14-53

Description of the issue: We are using the bms_c1 firmware(code for 0.3v BMS board) at this commit https://github.com/LibreSolar/bms-firmware/tree/cb89c75b74e85a036b7c6243424e31c68b3b3018. An app.overlay file that updates the I2C pins to match the I2C configuration of the 0.4v bms_c1 board. A few modifications have been done to the BMS firmware such as recovery for overcurrent in charge and discharge, short circuit and current calibration. We want to test these modifications in the lab before pushing the code to the bms_firmware repository.

When the firmware is flashed on the custom board getting this error: Screenshot from 2024-02-29 14-08-50

Probing test points 12 and 13 revealed no observable signal waveforms on SDA and SCL lines.

app.overlay: Screenshot from 2024-02-29 14-57-59

Impact: Not able to execute the firmware with and without recovery modifications.

Zephyr version: v3.4 commit: b7e659cdd3088609c1e0b9d7f925a811c006f6bd

martinjaeger commented 6 months ago

Did you also try if it works with most recent firmware commit in main? It contains several improvements. Maybe it solves your issue.

Ananyaaynana commented 6 months ago

Yes, I tried it with this commit https://github.com/LibreSolar/bms-firmware/tree/58d2384f013ec466e16b1b6201fbb8aac653a2c9 and it does solve the issue. However, I have made a lot of changes in the current firmware and want to use this firmware for testing. If there is no alternative then I will have to redo the modifications in the latest firmware.

martinjaeger commented 6 months ago

Ok. The overlay looks correct. Did you make sure it's picked up by the build system? (see output at the beginning of west build command)

Ananyaaynana commented 6 months ago

Screenshot from 2024-02-29 19-53-19 Yes, it has picked the app.overlay file during the build.

Ananyaaynana commented 6 months ago

We tried to debug the issue but it was unsuccessful. So we are integrating the recovery modifications in the latest commit but we hit a few roadblocks. I will open another thread to explain the issue.