[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 Events1..5. Expected default trigger source isADC Trigger on Timer A compare 3. - Even ADC Triggers (
6, 8, 10): Affected only by External Events6..10. Expected default trigger source isADC Trigger on Timer A period.
Steps to Reproduce:
- Start with ADC Triggers 5..10 in a Disabled state (
Disable ADC Trigger). - 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 3for odd,Timer A periodfor even). - Sequentially enable the corresponding External Events (
EEV 5..1for odd triggers, orEEV 10..6for 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 generatedMX_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.
- Enable one of ADC Triggers 5..10 (it starts with its normal default source:
- 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..5orEEV 6..10). - Now enable the corresponding ADC Trigger (
5..10). - Result: Instead of initializing with its normal default (
Timer A compare 3orTimer A period), it immediately initializes withADC Trigger on external event X.
- While ADC Triggers 5..10 are still Disabled, enable one of the affecting External Events (
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!
