2026-04-25 7:22 PM
There are 4 external events that can be chosen to trigger and reset individual counters of each HRTIM timer unit in STM32H743 MCU. CubeMX shows those events once the Event Configuration is chosen "Enabled" . Yet only Source 1 is active (allowed to be chosen) but the Source 3 that I need to connect internally to the TIM2 TRGO output is inactive (cannot be chosen) . Why? My attempts to use AI got strange results - after searching the STM documents AI concluded that CubeMX is limited , it allows only external on-pin connections and any internal connections must be manually coded in addition to the generated code.
If it is so then why does CubeMX show those other options yet does not allow to choose them? Or is there way to activate those options ?
Please anybody give me suggestion.
Note: the STM32CubeMX is the latest downloaded and installed yesterday. The MCU library pack is also current.
Solved! Go to Solution.
2026-04-30 12:56 PM
Thank you , you helped me to understand that this basic configuration itself the reason to invalidate the options for External Events sources for any unit timer. Then re-configuring the timer multiple times I accidentally stumbled on the cause of the issue...
Here it is :
IN the MCU reference manual ch.37.3.2 there is table 303 which explains the purpose of each pin and internal signals for the HRTIM. It explains 10 lines of External events, each having 4 sources. Those 10 line hrtim_evt1 through hrtim_evt10 defined as "Digital Inputs" explained as follows
"External events. Each of the 10 events can be selected among 4 sources, either on-chip (from other built-in peripherals: comparator, ADC analog watchdog, TIMx timers, trigger outputs) or off-chip (HRTIM_EEVx input pins)"
As you can see these lines represent both External off-chip Input Pins as well as internal on-chip connections .
Following this information I was choosing the External Event Line 1 prior to setting up a particular source for any unit Timer. But now the option of a required source for this External event got dimmed and would not change no matter what I did.
Then I accidentally noticed that if I don't choose any External Event Line prior to setting the options for Timer A - then all options are valid ! This led to the discovery of this CubeMX created confusion : contrary to the Table 303 of the manual, the External Events Lines are made to choose ONLY the off-chip events connected to the GPIO pins ! If those lines are chosen, then all the on-chip External Events are invalidated and get dimmed . If the on-chip External Events needed, those lines should not be checked.
I notified the tech support asking them to change the text from "External Events Lines" to something like "External Events off-chip" Or "EEV off-chip Input Pins" or something alike...
Hope this will help others ...
2026-04-27 3:40 AM
Hello,
I did the exercise and I can see TIM2 TRGO is not grayed out for HRTIM external event 2 source:
and can be selectable:
What MCU part number you've set in CubeMx?
I've attached my ioc file.
2026-04-27 7:51 AM
Thank you for giving me hope but I am yet to repeat this in my configuration. My MCU package is STM32H743VITx (100 pins package) . TIM2 TRGO enabled and configured but still greyed out as a choice for HRTIM... I'll try to compare the .ioc files, will try to pinpoint the difference...
Is your CubeMX the latest v.6.17.0 ?
2026-04-27 7:59 AM - edited 2026-04-27 7:59 AM
@eBirdman wrote:
Is your CubeMX the latest v.6.17.0 ?
Yes, sorry I forget to tell that I'm using the latest version 6.17.0.
I tried also the part number you are using and having the same result. As you can see I'm able to select TM2 TRGO as external event 2 for HRTIM:
2026-04-28 1:01 PM
I see the apparent mismatch between our setup : all your slave timer units are disabled.
Could you please enable timers A, B and D, also Enable external Event Lines 1, 2 and 3 (these are to be configured)
and setup as example Timer B : Enable all 4 Compare Units , disable the Capture units and set the 1st Reset Trigger Source to the "Timer counter is reset upon external event 2"
These are all relevant configurations for choosing/using the external events...
here are the main relevant parameters for this example Timer B setup . As per this configuration Timer B must be triggered By External Event 2 (which is TIM2 TRGO) ....
Please let me know if you have the TIM2 TRGO enabled as External Event for triggering Timer B thus been setup.
Thank you
2026-04-28 8:43 PM
when the mouse hovers over the inactive choice for External Event (such as choice of TIM2_TRGO) , the tip prompt pops up showing the following: "EEV pin is selected (or used by Capture or One Pulse mode) , the source has to be set to GPIO".
But EEV pins are already set to "Alternate Function" that is their GPIO modes . This tip prompt adds the confusion.
2026-04-29 10:02 AM
your .ioc file does not have any of HRTIM timer units enabled.
Here I attached a simple basic .ioc file Test_HRTIM.ioc for testing . It has HRTIM enabled with only one timer A enabled, been reset by External Event 1, , single External Event 1 enabled and TIM1 configured to generate TIM1 TRGO output.
Can you load this in CubeMX and see if you get a External Event 1 Source TIM1 TRGO for Timer A ?
I only get "External Event Source 1 - External Pin" , Source 3 - TIM1 TRGO inactive. Again my MCU STM32H743VIT6 .
Please let me know, Thanks
2026-04-30 2:01 AM
TIM1 TRGO option is grayed out. Only External pin is available:
2026-04-30 12:56 PM
Thank you , you helped me to understand that this basic configuration itself the reason to invalidate the options for External Events sources for any unit timer. Then re-configuring the timer multiple times I accidentally stumbled on the cause of the issue...
Here it is :
IN the MCU reference manual ch.37.3.2 there is table 303 which explains the purpose of each pin and internal signals for the HRTIM. It explains 10 lines of External events, each having 4 sources. Those 10 line hrtim_evt1 through hrtim_evt10 defined as "Digital Inputs" explained as follows
"External events. Each of the 10 events can be selected among 4 sources, either on-chip (from other built-in peripherals: comparator, ADC analog watchdog, TIMx timers, trigger outputs) or off-chip (HRTIM_EEVx input pins)"
As you can see these lines represent both External off-chip Input Pins as well as internal on-chip connections .
Following this information I was choosing the External Event Line 1 prior to setting up a particular source for any unit Timer. But now the option of a required source for this External event got dimmed and would not change no matter what I did.
Then I accidentally noticed that if I don't choose any External Event Line prior to setting the options for Timer A - then all options are valid ! This led to the discovery of this CubeMX created confusion : contrary to the Table 303 of the manual, the External Events Lines are made to choose ONLY the off-chip events connected to the GPIO pins ! If those lines are chosen, then all the on-chip External Events are invalidated and get dimmed . If the on-chip External Events needed, those lines should not be checked.
I notified the tech support asking them to change the text from "External Events Lines" to something like "External Events off-chip" Or "EEV off-chip Input Pins" or something alike...
Hope this will help others ...