STM32F429 Nucleo-144 board - Can't get SPI2 to work! SCK OK, but no signal on MOSI (PB15) or MISO (PB14).
I have configured SPI2 in Stm32CubeMx and am coding in Stm32CubeIDE. PD3 as SCK, PB15 as MOSI and PB14 as MISO are configured, and i have also checked corresponding code in stm32F4xx_hal_msp.c as below.
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hspi->Instance==SPI2)
{
/* USER CODE BEGIN SPI2_MspInit 0 */
/* USER CODE END SPI2_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI2_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE(); /**SPI2 GPIO Configuration
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI
PD3 ------> SPI2_SCK
*/
GPIO_InitStruct.Pin = GPIO_PIN_14;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_3;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);Additionally, the debug breakpoints placed in the above code show that this is executed. I am sending test SPI data, but on a DSO I can only see SCK pulses, but the PB14 (MISO) is always low, and PB15 (MOSI) is always high. Nothing is connected to those pins. I made sure there are no other conflicting peripherals like USB OTG, either configured or connected to the Nucleo board. SPi speed is 1.2 MHz.
Any clue about this? Thanks in advance.