AnsweredAssumed Answered

SPI1 and SP3 communications on STM32F103RF

Question asked by p.denis.001 on Nov 18, 2015
Latest reply on Nov 18, 2015 by Clive One
Is it possible to connect SPI1 to SPI3 internally (by remapping SPI1 to PA15, PB3, PB4, PB5 or somehow else)? Didn't find any information about: "remapping SPI1 disconnects SPI3 from PA15, PB3, PB4, PB5". Also didn't find any schemes of how peripherals sharing the same GPIO pins are connected internaly.

I'm not using standard peripheral library provided by st, my code is doing the following:
1. Enabling peripherals in RCC domain:
GPIOA, GPIOB, AFIO, SPI1, SPI3, DMA1, DMA2 - enabled
2. Remapping peripherals in AFIO domain:
Debug mode: JTAG-DP Disabled and SW-DP Enabled,
SPI1 remapped
3. Configuring GPIOA, GPIOB:
PA15, PB3, PB4, PB5 - alternate functions Push-Pull, 50 Mhz
4. Configuring SPI1:
slave, SSM = 0, SSOE = 1, other equal to SPI3(doesn't matter)
5. Configuring SPI3:
master, SSM = 0, SSOE = 1, other equal to SPI1(doesn't matter)
SPI1 and SPI3 working with DMA1 and DMA2 respectively.
6. Configuring and enabling DMA1_CH3(SPI1_TX), DMA1_CH2(SPI1_RX), DMA2_CH2(SPI3_TX), DMA2_CH1(SPI3_RX)
7. First starting SPI1: DMA1_CH3 is writing 1 byte to DR, thereby clearing TXE flag
8. Then starting SPI3: DMA2_CH2/DMA2_CH1 writing/reading all packet to DR (all rx bytes = 0)
9. Next SPI1 and associated DMA channels remain unchanged.  

Don't see SCK, NSS, MOSI, MISO signals with the scope while SPI3 works (p.8)

PS: when controlling PA15, PB3, PB4, PB5 as GPIO's they are switching fine!



 

Outcomes