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

Interference between Zephyr ADC driver and COMP interrupt #93

Closed martinjaeger closed 4 years ago

martinjaeger commented 4 years ago

Causes hard fault in this line: https://github.com/zephyrproject-rtos/zephyr/blob/4700c93f3cd898645182855663d0bb5e76a5ad9b/drivers/adc/adc_stm32.c#L334

See 91d4ec44243e08c39c9bc559be5502534652f398 for a workaround.

This has to be fixed properly in order to make load short circuit protection work with Zephyr.

Options:

  1. Don't use Zephyr ADC driver for L0 anymore and completely disable it.
  2. Find some way to distinguish between different interrupt sources in the ISR. Might need changes in Zephyr driver.
  3. Other?
martinjaeger commented 4 years ago

Hard fault fixed in above commit.