STML432KC: PA4/PA5 seems to be hard-wired to DAC1

Discussion created by martin on Feb 4, 2018
Latest reply on Feb 5, 2018 by waclawek.jan

I'm using the STML432KC and encountered a very odd problem. I have PA4 configured as LPTIM2_OUT and DAC1_OUT1 is internally connected to COMP2 (negative input). DAC1 is configured to not use any external pins.


I noticed that the PWM output from PA4 (LPTIM2_OUT) stops working when the DAC is started. Specifically, when I call "HAL_DAC_Start" it stops working. I tracked it down to "__HAL_DAC_ENABLE(hdac, Channel);" (which just sets the corresponding enable bit in the DAC CR register).


Earlier, I had a similar problem with DAC1_OUT2 and PA5. PA5 is used as SPI1_SCK and I had configured COMP2 to use DAC1_OUT2 as negative input. However, the clock of the SPI would completely mess up the output of the comparator, i.e., it seemed like DAC1_OUT2 was somehow still connected to PA5.


In summary, it seems like PA4 and PA5 somehow remain connected to DAC1, regardless of the GPIO configuration. I first suspected I may have a defective chip, but the problem persists after replacing it.


Has anyone ever seen this problem before?