Loading...
 
Skip to main content

System Workbench for STM32


How To Use DAC on STM32F4 Discovery?

Thank Alec.

Now I see that CubeMX had generated a separate file stm32f4xx_hal_msp.c in the src folder that has the HAL_DAC_MspInit() function. This function has the pin initialization and clock enable functions for the DAC.

But there is no mention of this HAL_DAC_MspInit() in the main function or even the whole main.c file generated by the CubeMX. How are these functiones supposed to be used if they are not called in the main() ? Do I have to modify the code generated by the CubeMX before to make it work?