cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767 No SCK on SPI2 clock pin, but using SPI3 resolves the issue.

Hwstar
Associate II

I have a Nucleo STM32F767ZI with SPI2 and SPI3 configured for 8 bit mode.  When I send data to SPI2, I see the correct data on SPI2 MOSI, but just a static high level on the SPI2 SCK using a scope.  Using SPI3 I see both the SCK and MOSI working with no issues. It seems to me that some other configuration might be necessary to get SPI2 to work properly.

 

 

 

SPI2 pins:

PB10: SCK

PC2 MISO

PC3 MOSI.

 

I tried remapping SCK to another pin, but that didn't resolve the issue.

 

The MX configuration both SPI2 and SPI3 is:

 

Parameter Settings

 

Mode:

Full Duplex Master

Hardware NSS Signal Disable

Parameter Settings:

Frame format Motorola

Data Size 8 bits

First Bit MSB

Prescaler baud Rate Divisor 16 (3.375 Mb/sec)

CPOL Low

Clock phase 1 Edge

CRC Calsulation disabled

NSSP Mode disabled

NSS Signal type Software

Here is my test code snippet:

 

```

uint8_t rx_buffer[2];

uint8_t tx_buffer[] = {0x55,0xAA};

 

while(1) {

volatile int res = HAL_SPI_TransmitReceive(&hspi3, tx_buffer, rx_buffer, 2, 100);

osDelay(10);

}

 

Any suggestions would be helpful.

 

Steve

```

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the suggestions.

I found the cause. PB10 was wired to CN11 pin 25 and not CN12 pin 25 on the STM32F767ZI Nucleo board and I overlooked this during troublshooting. Fortunately the nucleo board is mounted on vectorboard so it was just a simple wire location change.

 

View solution in original post

2 REPLIES 2

Any board level pin conflicts ?

AF setting correct? Check the pin initialization code and clocks.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for the suggestions.

I found the cause. PB10 was wired to CN11 pin 25 and not CN12 pin 25 on the STM32F767ZI Nucleo board and I overlooked this during troublshooting. Fortunately the nucleo board is mounted on vectorboard so it was just a simple wire location change.