Skip to main content
Associate
March 25, 2025
Question

Why is code generated for analog watchdogs 2 & 3 if ADC sequencer is set to not fully configurable?

  • March 25, 2025
  • 2 replies
  • 632 views

Newcomer to CubeIDE. When I set the ADC parameters for fixed sequencing, i.e. not fully configurable, some initialization code is generated for watchdogs 2 & 3 (see below). I don't want to use analog watchdogs or have to edit the main.c file manually. Is this a bug, or is there some way to alter this behaviour? Only watchdog 1 seems to have an enable check box.

I'm using STM32CubeIDE Version: 1.18.0, Build: 24413_20250227_1633 (UTC) on Linux.

/** Configure the WatchDogs 2
*/
AnalogWDGConfig.WatchdogNumber = ADC_ANALOGWATCHDOG_2;
AnalogWDGConfig.WatchdogMode = ADC_ANALOGWATCHDOG_SINGLE_REG;
if (HAL_ADC_AnalogWDGConfig(&hadc1, &AnalogWDGConfig) != HAL_OK)
{
Error_Handler();
}

/** Configure the WatchDogs 3
*/
AnalogWDGConfig.WatchdogNumber = ADC_ANALOGWATCHDOG_3;
if (HAL_ADC_AnalogWDGConfig(&hadc1, &AnalogWDGConfig) != HAL_OK)
{
Error_Handler();
}

2 replies

mjenzAuthor
Associate
March 25, 2025

Sorry, the title end should have been "not fully configurable".

ST Employee
March 25, 2025

Hello,

what microcontroller are you using?

mjenzAuthor
Associate
March 25, 2025

Hi, I'm using the STM32U073CCT6.