2020-11-10 06:55 PM
Hi,
According to datasheet, The main function of PA15 is JTDI, so I disabled JTAG and config that pin in AF_PP mode.
Then if I don't initialize SPI1, I can control PA15 as GPIO. But if I initialize SPI1, this pin will hold high. Since SPI1 has occupied PA4 as its NSS, I guess there is a way to force that peripheral to release PA15, however I didn't find some description in datasheet.
If someone could help give some suggestions?
2020-11-11 02:44 AM
Hello @Sni.1 ,
Welcome to the STM32 Community 😊
SPI1_NSS remapeed on PA15 pin. Try to set AFIO_MAPR.SPI1_REMAP = 1, and enable SPI1 clock in RCC: pins PA15, PB3, PB4 and PB5 belong to SPI1 as mentionned in the following SPI1 remapping table:
Please refer to the STM32F103 reference manual for more details on SPI1 remapping.
Imen
2020-11-11 07:05 PM
Hi, I want to use PA15 as GPIO, not the NSS wire of SPI1. Now the phenomenon is:
1. if I set SP1_REMAP=1, of course SPI1 use PA15 so I can't control it.
2. if I set SP1_REMAP=0, SPI1 use PA4 as its NSS. Then
2.1 Disable clock of SPI1, I can control PA15.
2.2 Enable clock of SPI1, I can't control PA15, it holds high.
So 2.2 means SPI1 always occupies PA15. Is there any solution?