Skip to main content
Associate II
Question

[Bug Report] STM32G474 HRTIM1: Enabling External Events overwrites Trigger Source for ADC Triggers 5..10

Hello STM32CubeMX Team,

While configuring HRTIM1 on an STM32G474, I isolated a parameter dependency issue affecting ADC Triggers 5 through 10 when External Events 1 through 10 are enabled.

Below are the exact patterns and steps to reproduce the issue, which should help pinpoint the default-value / dependency condition in the STM32G4 HRTIM IP configuration:

Environment:

  • MCU: STM32G474 (e.g., STM32G474RET6)
  • Peripheral: HRTIM1
  • STM32CubeMX Version: (v6.17.0)

Observed Mapping & Pattern:

  • Odd ADC Triggers (5, 7, 9): Affected only by External Events 1..5. Expected default trigger source is ADC Trigger on Timer A compare 3.
  • Even ADC Triggers (6, 8, 10): Affected only by External Events 6..10. Expected default trigger source is ADC Trigger on Timer A period.

Steps to Reproduce:

  1. Start with ADC Triggers 5..10 in a Disabled state (Disable ADC Trigger).
  2. Case A (Enabling EEV while ADC Trigger is already enabled):
    • Enable one of ADC Triggers 5..10 (it starts with its normal default source: Timer A compare 3 for odd, Timer A period for even).
    • Sequentially enable the corresponding External Events (EEV 5..1 for odd triggers, or EEV 10..6 for even triggers).
    • Result: The Trigger source of the enabled ADC Trigger is automatically overwritten with ADC Trigger on external event X (and this is reflected in the generated MX_HRTIM1_Init() code).
    • When sequentially disabling those External Events, the Trigger source steps back through the remaining active External Events and only reverts to its normal default (Timer A compare 3 / Timer A period) once all affecting External Events are disabled.
  3. Case B (Enabling EEV before enabling ADC Trigger):
    • While ADC Triggers 5..10 are still Disabled, enable one of the affecting External Events (EEV 1..5 or EEV 6..10).
    • Now enable the corresponding ADC Trigger (5..10).
    • Result: Instead of initializing with its normal default (Timer A compare 3 or Timer A period), it immediately initializes with ADC Trigger on external event X.

Workaround:
Manually selecting the desired trigger source (e.g., ADC Trigger on Timer A compare 3 or Timer A period) in the ADC Trigger -> Trigger dropdown after enabling the required External Events locks the user selection and prevents any further automatic overwriting.

Expected Behavior:
Enabling External Events 1..10 should make the corresponding ADC Trigger on external event X options available in the dropdown list without overriding the default or user-selected trigger source of ADC Triggers 5..10.

I hope this breakdown makes it easy to locate and fix the dependency rule in a future release. Thank you!

2 replies

ST Technical Moderator

Hello ​@k_nedelchev 

Could you share your IOC in order to investigate the issue?

BR, Souhaib

To give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Associate II

Hello @Souhaib MAZHOUD,

Thank you for the quick response.

Attached is the clean, unmodified reference `.ioc` file (`vienna_stm32g474.ioc`) downloaded directly from ST's eDesignSuite (packed in a `.zip` archive).

Please note that the file was originally generated with **STM32CubeMX v6.14.0**, so opening it in **v6.17.0** prompts the **Continue / Migrate** dialog.

The issue reproduces identically regardless of whether **Continue** or **Migrate** is selected — once you go to **HRTIM1** and enable any of **ADC Triggers 5..10** along with **External Events 1..10** (following the steps above), the trigger source gets overwritten immediately.

Best regards, k_nedelchev