Associate III
June 17, 2026
Question
assert when DAC output pin is initialized (using HAL 2.1.0)
- June 17, 2026
- 1 reply
- 35 views
Hello,
I started using HAL 2.1.0 which was available as a Pack download in MX2. I recompiled my application and I observed an assert during the DAC initialization in mx_dac1_init when HAL_GPIO_Init is called.
hal_gpio_config_t gpio_config;
/**
[GPIO Pin] ------> [Signal Name] ------> [Labels]
PA4 ------> DAC1_OUT1 ------> PA4
**/
gpio_config.mode = HAL_GPIO_MODE_ANALOG;
HAL_GPIO_Init(PA4_PORT, PA4_PIN, &gpio_config);
Inside the HAL_GPIO_Init the assert occurs due to an incorrect pull mode.
if ((mode != LL_GPIO_MODE_ANALOG) || ((mode == LL_GPIO_MODE_ANALOG) && (p_config->pull != HAL_GPIO_PULL_UP)))
{
// I commented out this line
//ASSERT_DBG_PARAM(IS_GPIO_PULL(p_config->pull));
LL_GPIO_SetPinPull(p_gpio, io_msk, (uint32_t)p_config->pull);
}
I checked the MX2 configuration of the DAC output pin and the pull field is empty and cannot be changed (see screenshot). I attached the ioc2 file for reference.
The code was working without issues in HAL 2.0.0.
Regards,
-Gil
