In STM32, EXTI is a unit handling "external interrupts". However, this name is misleading: besides pin-triggered interrupts, it handles also a portion of interrupts coming from internal peripherals - those, which are capable of waking up the processor from some of the low-power sleep modes.
However, this article discusses only the pin-related interrupts. These are numbered EXTI0..EXTI15 and correspond to interrupts from pins Px0..Px15. As has been discussed previously, only one interrupt per pin number is possible, and the port from which comes the signal for given EXTIn, is selected in a multiplexor for each pin number. Control bits for these multiplexors (4 per multiplexor, although in smaller models with less GPIO ports the MSB is unused) are grouped together into 32-bit registers.
However, ST inexplicably chose to use 1-based numbering for these registers. As the registers form an array and are also declared as such in the CMSIS-mandated device headers, this creates unnecessary confusion, e.g. the bitfield to select port for EXTI8 is in register SYSCFG_EXTICR3, which is to be accessed as:
SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI8_PC; // set EXTI8 to PC8
ST retained this confusing and entirely unnecessary scheme also when moving them from SYSCFG to EXTI (where they should've belonged ever since) in the newer families ('G0/'C0, 'L5, 'U5, 'U0, 'H5). But simultaneously they also made a smart move, when they expanded the field for each multiplexor to occupy 8 bits (even if the uppermost bits are unused). As in these families EXTI registers are bytewise-accessible, this results in a convenient access scheme, where port for each EXTIn can be selected simply by directly writing a single byte. Although ST did not change the CMSIS-mandated device header to reflect this, users can augment the header for such convenient use, e.g. by:
#define EXTI_SEL(n) (((volatile uint8_t *)(EXTI->EXTICR))[n]) EXTI_SEL(8) = 2; // set EXTI8 to PC8