Hey Guys - more SPI issues!
I have a new board with minimal connections - basically just SPI to a LCD and four pushbuttons. I created a new STM32 project in STM32cube.
It is using a STM32F451VET6 with clock set to MSI RC 4000kHz
I configured SPI in the IOC to :
Full-duplex Master
Hardware NSS Output Signal
PB0 as SPI1_NSS, PE13 as SPI1_CLK, PE14 as SPI1_MISO, PE15 as SPI_MOSI
with the below parameters :

I added only a few lines to the auto-generated code for two variables and the SPI transmits ( below ).
Stepping the program it will send the first byte fine. The next byte sends but the HAL_SPI_Transmit() call hangs forever on this line :
/* Check the end of the transaction */
if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK)
{
hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
}
Here is the code from Main.c :
int main(void)
{
/* USER CODE BEGIN 1 */
unsigned char On_Command = 0xAF;
unsigned char Off_Command = 0xAE;
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_SPI1_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
HAL_SPI_Transmit(&hspi1, (uint8_t *)&Off_Command, 1, 100); // write Set Off command to display
HAL_SPI_Transmit(&hspi1, (uint8_t *)&On_Command, 1, 100); // write Set On command to display
HAL_SPI_Transmit(&hspi1, (uint8_t *)&Off_Command, 1, 100); // write Set Off command to display
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}