STM32 gotchas
180. In TIM, TRGI signal is generated only if TIMx_SMCR.SMS is nonzero

In timers, signals - from other timers, or from some of the timer's input pins - enter the so called Slave-Mode Controller, which is a sub-module of the timer. There, one of them is selected for further use in a multiplexer controlled by TIMx_SMCR.TS. Output from this multiplexer (i.e. the selected signal) is called TRGI, and primarily serves within the Slave-Mode Controller to control one of its functions selected by TIMx_SMCR.SMS, such as Reset, Trigger, Gate, or as clock in External Clock Mode 1.

However, TRGI is used in timers also for other purposes, for example it can trigger interrupt or be a DMA tranfer request, if enabled so in TIMx_DIER. It may seem, that for these purposes, as they are not related directly to the Slave-Mode Controller's functionality, it is enough to select the proper input in TIMx_SMCR.TS. This is not the case, though: if TIMx_SMCR.SMS is set to 0b000, TRGI is inactive all the time.

This may be an unpleasant surprise for those, who don't want to use the Slave-Mode Controller's facilities yet want to use TRGI in its additional functions.

Experimentation revealed, that with TIMx_SMCR.SMS nonzero TRGI works as expected. What's surprising in this is, that TRGI works also if TIMx_SMCR.SMS is set to one of the Encoder modes, where TRGI has no functional role within the Slave-Mode Controller.