AnsweredAssumed Answered

Stm32f429 SPI3 no clock on CLK pin

Question asked by uzun.fatih on Feb 4, 2016
Latest reply on Feb 4, 2016 by Clive One
I have just made  my own SPI3 initilization code as its shown below.

void Spi_Init(void)
{
  SPI_InitTypeDef  SPI_InitStructure;

  GPIO_InitTypeDef GPIO_InitStructure;
     
     SPI_StructInit(&SPI_InitStructure);
     
     /*!< Enable the SPI clock */
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI3, ENABLE);
     /*!< Enable GPIO clocks */
     RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);


  /*!< Connect SPI pins to AF5 */ 
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource10, GPIO_AF_SPI3);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource11, GPIO_AF_SPI3);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource12, GPIO_AF_SPI3);
     
     /*!< SPI pins configuration *************************************************/
  GPIO_InitStructure.GPIO_Pin =  GPIO_PinSource10|GPIO_PinSource11|GPIO_PinSource12;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_NOPULL;
  GPIO_Init(GPIOC, &GPIO_InitStructure);
     
  SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
  SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
  SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
  SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
  SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;
  SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
  SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32;
  SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
     
       /*!< Disable SPI  */
  SPI_Cmd(SPI3, DISABLE);
     
     SPI_Init(SPI3, &SPI_InitStructure);


  /*!< Enable SPI  */
  SPI_Cmd(SPI3, ENABLE);
}

at main c i have this code running

while(1)
     
     {
          SPI3->DR = 0x15;
}

But I can not see clk signal on my ossiloscope is my init code is wrong or smtn else

Outcomes