2024-04-21 05:41 PM - edited 2024-04-21 05:43 PM
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
```
Solved! Go to Solution.
2024-04-22 07:48 AM
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.
2024-04-21 06:41 PM
Any board level pin conflicts ?
AF setting correct? Check the pin initialization code and clocks.
2024-04-22 07:48 AM
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.