STM32 gotchas
246. DMA does not work with some peripherals (e.g. DAC/FDCAN in some newer STM32), if peripheral-side transfer size is not set to word

The STM32 are "compiled" from individual modules (IPs), implementing the functionality of processor, busmatrix/arbitrators, other bus masters like DMA, and peripherals like GPIO, ADC, UART, etc. These are interconnected by standardized buses (and some other signals), and this fabric to work properly, all have to obey certain rules, given by the design of these buses. In STM32, as they are based on ARM processors, the buses are also standardized by ARM.

These buses - the "baseline" AHB and the slower/simpler peripheral-specific APB - are capable of transferring bytes, half-words and words; however, not every peripheral is capable of handling each of these transfers. Some of them restrict transfers e.g. to word-only. These restrictions are usually documented at the beginning of registers' description subchapter in the given periperal's chapter in RM.

Attempt to an improper access (e.g. byte-wide access onto a peripheral allowing only word-wide access) is signaled by the peripheral through AHB as a bus error. This in turn results in respective Fault if the processor was the initiator of access, or bus-master-specific indication (e.g. Transfer Error interrupt/flag in case of DMA).

In the older STM32 families, only some peripherals are connected to the bus-matrix through AHB bus. High-bandwidth peripherals like FLASH/RAM have a dedicated AHB bus each, plus certain system modules like RCC and CRC (and except 'F1 also GPIOs) are connected through one or a couple of common AHB bus(es). The vast majority of peripherals are connected to relatively slow APB bus(es), each of them in turn is connected to a AHB bus (and thus the bus-matrix) via an AHB-to-APB bridge.

The AHB-to-APB bridge is to certain extent forgiving to improper-width accesses, as it converts narrower accesses to full bus width by duplicating the 8- or 16-bit data to full 32-bits. In other words, an improper width access to APB peripheral may result in incorrect data, but does not cause bus error. In many cases this mechanism results in outwardly flawless operation, e.g. in case of peripherals, where a given register is only 8- or 16-bits wide and is accessed as such, but the peripheral itself would restrict transfers to word only (in these cases the data duplicated by AHB-to-APB bridge to the upper portion of bus is simply ignored by the target register).

However, in newer mid- and higher-end STM32 families (such as 'G4, 'U5, 'H5 etc.), some of the relatively "mundane" peripherals started to appear connected through AHB rather than APB. Examples include DAC and FDCAN, which both restrict accesses to word-only, although their data may be halfwords or in some cases even bytes. (Although ADC is on AHB in most of newer STM32, it appears that it does not restrict the access width; unfortunately ST does not document this.)

As a consequence, the data width for these modules must be strictly obeyed, and using improper data width - e.g. setting DMA to halfword - leads to bus errors and malfunction.

This issue in FDCAN noted by David A. This issue on DAC discussed for 'G4 here and for 'U5 here.