STM32 gotchas
317. GPIO set to HSLV mode may damage chip, if IO supply is above 2.7V

Some modern devices require to operate at low power consumption, even if they are of high performance, especially if battery powered. This requires to use low supply voltages, typically 1.8V. While STM32 are perfectly capable of operating at these voltages, their IO can't reach maximum operating frequencies at low voltages.

To circumvent this, in some newer higher-end STM32 families ('H7, 'H5, 'U5, some 'U3), some GPIO can be switched to a special High-Speed-Low-Voltage (HSLV) mode. In this mode, full GPIO speed can be achieved also at low supply voltages to the given IO (through either VDD or, if available, dedicated VDDIO pin). For example, in 'H56x, with GPIOx_OSPEEDR being set to 0b11 for maximum speed, at 1.8V power supply, maximum GPIO speed is 80MHz in non-HSLV mode, but 200MHz in HSLV mode.

In most families, where HSLV is available, it is enabled individually for each pin by setting respective bits in GPIOx_HSLVR register. The 'H7 family is the exception, as it enables HSLV for all relevant pins (within one or several groups) at once, by setting SYSCFG_CCCSR.HSLVx bit. There are also related option bits, which prevent inadvertent setting of pins as HSLV.

The reason for caution is, that if HSLV is switched on, and the given IO supply voltage is above 2.7V, the chip may get damaged. RMs warn about this in the High-speed low-voltage mode (HSLV) subchapter of GPIO chapter (or in description of SYSCFG_CCCSR.HSLVx bits in case of 'H7).

There may be other limitations associated with HSLV, too. For example, in 'U5, certain pin pairs must have the same HSLV setting; in 'U3, HSLV is forbidden for pins set as I2C Fm+. At any case, before using HSLV, read carefully the related chapters in RM and DS.