General-purpose and alternate-function I/Os (GPIOs and AFIOs) RM0008
110/690
7.3 Alternate function I/O and debug configuration (AFIO)
To optimize the number of peripherals available for the 64-pin or the 100-pin or the 144-pin
package, it is possible to remap some alternate functions to some other pins. This is
achieved by software, by programming the AF remap and debug I/O configuration register
(AFIO_MAPR) on page 117. In this case, the alternate functions are no longer mapped to
their original assignations.
7.3.1 Using OSC32_IN/OSC32_OUT pins as GPIO ports PC14/PC15
The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general-purpose I/O
PC14 and PC15, respectively, when the LSE oscillator is off. The LSE has priority over the
GP IOs function.
Note: 1 The PC14/PC15 GPIO functionality is lost when the 1.8 V domain is powered off (by
entering standby mode) or when the backup domain is supplied by V
BAT
(V
DD
no more
supplied). In this case the IOs are set in analog input mode.
2 Refer to the note on IO usage restrictions in Section 4.1.2 on page 49.
7.3.2 Using OSC_IN/OSC_OUT pins as GPIO ports PD0/PD1
The HSE oscillator pins OSC_IN/OSC_OUT can be used as general-purpose I/O PD0/PD1
by programming the PD01_REMAP bit in the AF remap and debug I/O configuration register
(AFIO_MAPR).
This remap is available only on 36-, 48- and 64-pin packages (PD0 and PD1 are available
on 100-pin and 144-pin packages, no need for remapping).
Note: The external interrupt/event function is not remapped. PD0 and PD1 cannot be used for
external interrupt/event generation on 36-, 48- and 64-pin packages.
7.3.3 BXCAN alternate function remapping
The BXCAN signal can be mapped on Port A, Port B or Port D as shown in Table 17 . For
port D, remapping is not possible in devices delivered in 36-, 48- and 64-pin packages.
7.3.4 JTAG/SWD alternate function remapping
The debug interface signals are mapped on the GPIO ports as shown in Tabl e 1 8 .
Table 17. BXCAN alternate function remapping
Alternate function
CAN_REMAP[1:0] =
“00”
CAN_REMAP[1:0] =
“10”
(1)
1. Remap not available on 36-pin package
CAN_REMAP[1:0] =
“11”
(2)
2. This remapping is available only on 100-pin and 144-pin packages, when PD0 and PD1 are not remapped
on OSC-IN and OSC-OUT.
CANRX PA11 PB8 PD0
CANTX PA12 PB9 PD1