I've recently run into a bug while trying to use both of the analog comparators on STM32F37.
The problem seems to be that on STM32F37 and STM32F38 COMP1 and COMP2 share the same 32-bit register COMP_CSR, so configuring the second comparator affects the configuration of the first one.
Here's an example:
Breakpoint 1: COMP1 configured.
Breakpoint 3: Enabling COMP2 discards the COMP1 configuration.
I was able to fix this by adding some preprocessor directives to the os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c, will create a pull request later.
I've recently run into a bug while trying to use both of the analog comparators on STM32F37. The problem seems to be that on STM32F37 and STM32F38 COMP1 and COMP2 share the same 32-bit register COMP_CSR, so configuring the second comparator affects the configuration of the first one.
Here's an example:
Breakpoint 1: COMP1 configured.
Breakpoint 3: Enabling COMP2 discards the COMP1 configuration.
I was able to fix this by adding some preprocessor directives to the
os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c
, will create a pull request later.ChibiOS version: stable_20.3.x Compiler: arm-none-eabi-gcc (10.3-2021.10) Platform and board: STM32F373CC (custom board)