STM32 gotchas
97.5V-tolerant pins don't always tolerate 5V

In STM32, IO pins are usually in two groups: those, which are 5V-tolerant (marked in the pin table in datasheet as FT), and those which are not (TT). There are also a few special pins such as NRST; and the two major groups have also sub-variants, marked by additional small letters, e.g. FTa for 5V-tolerant pin with additional analog functionality.

TT pins simply have protection diodes to both VDD and GND (=VSS). FT pins don't have the protection diode to VDD, and that allows external voltages higher than VDD (i.e. +5V} to be connected to FT pins.

However, there are several limitations to this:

There may be additional limits to certain pins, and also values mentioned above may not be valid for all STM32 models, so always consult the datasheet to your particular STM32 model.