Developers on various STM32 sometimes use DMA transfers triggered by timer, where data are moved from memory to GPIO (either GPIO_ODR or, if atomic access is desired, GPIO_BSRR), or vice versa, from GPIO_IDR to memory. The purpose is to output random waveform onto one, or many pins at once, or conversely, sample the input state of one or more pins. As timer-triggered DMA can originate also from a timer capture, this also provides a way to do such waveform output or pins sampling upon external signal. There is even an application note - AN4666 - demonstrating this technique.
However, this method fails on the STM32L0xx, STM32G0xx and STM32C0xx families. Why?
These families are built around the ARM Cortex-M0+ processor core. When ARM designed this core, they attempted to improve on the minimalistic Cortex-M0 core (as the designation shows), and one of the improvements was that they included directly to the core a dedicated port called IOPORT, GPIO modules to be connected onto this port.
It's not clear what are the benefits of this design, but one of the consequences is, that GPIO mapped onto IOPORT are available only from the processor core, and there's no way all other potential busmasters in the system - i.e. DMA - can access them.
The chips' block diagram in datasheet does not clearly indicate the problem, and the bi-directional arrows on the buses appear to indicate that there is a path from DMA to IOPORT/GPIOs. However, this is due to a simplification these diagrams make: while all the buses are indeed bi-directional as far as data are concerned, they are definitively uni-directional for addresses and control signals. The following figure attempts to illustrate the address/control flow, together with indicating the master-slave character of the transfers:
The newest addition to STM32 which is based on Cortex-M0+ - the STM32U0xx family - is not affected, as it - probably because of complaints on this very limitation - don't use the the processor's dedicated IOPORT port, but located the GPIOs onto the AHB bus.
