Nucleo-h563zi board spi2 not working
I am currently using the NUCLEO-H563ZI board to test SPI functionality.
I configured SPI1 as a master and was able to successfully transmit and receive data using HAL_SPI_TransmitReceive(). However, when I switched to SPI2, I found that the clock signal does not toggle at all, no matter what I try.
Is there anything specific that needs to be configured additionally for SPI2?

Below is my code; the rest was automatically generated by MX.
uint8_t spi_TransmitReceive(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin,
const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
{
HAL_StatusTypeDef status;
HAL_GPIO_WritePin(GPIOx, GPIO_Pin, GPIO_PIN_RESET);
status = HAL_SPI_TransmitReceive(&hspi2, pTxData, pRxData, Size, Timeout);
HAL_GPIO_WritePin(GPIOx, GPIO_Pin, GPIO_PIN_SET);
return status;
}
void example_spi_transmitreceive()
{
printf("\r\nExample SPI Transmit and Receive.\r\n");
uint8_t txbuf[1024];
uint8_t rxbuf[1024] = {0};
for(int i = 0; i < 1024; i++) {
txbuf[i] = i & 0xff;
}
spi_TransmitReceive(GPIOB, GPIO_PIN_6, &txbuf, &rxbuf, 1024, 10);
printf("\r\nRx Received data:\r\n");
for(int i = 0; i < 1024; i++) {
printf("0x%02x, ", rxbuf[i]);
if ((i+1) % 16 == 0) {
printf("\r\n");
}
}
}
