关于STM8的AFR0和AFR1使用

芯片手册中写AFR0和AFR1不能同时使用

关于STM8的AFR0和AFR1使用

AFR1 Alternate function remapping option 1 (2)
0: AFR1 remapping option inactive: default alternate function(1);
1: Port A3 alternate function = SPI_NSS; port D2 alternate function =TIM2_CH3.

AFR0 Alternate function remapping option 0(2)
0: AFR0 remapping option inactive: Default alternate functions(1);
1: Port C5 alternate function = TIM2_CH1; port C6 alternate function =TIM1_CH1; port C7 alternate function = TIM1_CH2.

1. Refer to the pinout description.
2. Do not use more than one remapping option in the same port. It is forbidden to enable both AFR1 and AFR0.

实际上测试同时使用没有什么问题,只要注意端口就行。

另外在IAR中的ST-LINK-->option bytes也需要做对应的配置,如图是配置了AFR0

关于STM8的AFR0和AFR1使用

官方STVP也一样烧录时配置

关于STM8的AFR0和AFR1使用