Can't get STM32 DAC to output anything
The answer is pretty simple. Your exact MCU model lacks the DAC subsystem. This is an error that is easy to make, because it is not always obvious. The manufacturers likes to brag about the features.

A DAC is less common than an ADC on microcontrollers. If you don't have an explicit DAC, you can often use a PWM channel as a DAC. Some microcontrollers have a high-speed PWM just for this purpose.