SPI slave issue
Hello
I am using 2 boards with SPI communication between them: STM32F412G-DISCO as the master, NUCLEO-G071RB as the slave. The MOSI direction works well, but the MISO direction doesn't works. Monitoring the MISO line via. oscilloscope shows that there is no communication in this line, also it is expected to be.
The boards configuration:


The master code:
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi1, (uint8_t *)&spi_tx, 2,100);
HAL_SPI_Receive(&hspi1, (uint8_t *)&spi_rx, 2,100);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, GPIO_PIN_SET);
The slave code:
HAL_SPI_Receive_IT(&hspi1,(uint8_t *)&spi_rx,2);
HAL_SPI_Transmit_IT(&hspi1, (uint8_t *)&spi_tx,2);
void HAL_SPI_RxCpltCallback (SPI_HandleTypeDef * hspi) {
counter++;
if (counter==10) {
counter=0;
}
sprintf(spi_tx,"c%d",counter);
for(int i=0;i<4;i++) {
spi_buf[counter*2+i]=spi_rx[i];
}
HAL_SPI_Receive_IT(&hspi1,(uint8_t *)&spi_rx,2);
}
void HAL_SPI_TxCpltCallback (SPI_HandleTypeDef * hspi) {
HAL_SPI_Transmit_IT(&hspi1, (uint8_t *)&spi_tx,2);
}
Does anyone have a suggestion what is the problem?
