stm32/qspi: Wait for a free FIFO location before writing to DR.

Must always check the FIFO before writing to DR.  Without this, this
function hangs on the H747.
This commit is contained in:
iabdalkader 2022-04-13 12:40:11 +02:00 committed by Damien George
parent b28839420d
commit 5974ac256b
1 changed files with 4 additions and 0 deletions

View File

@ -228,6 +228,10 @@ STATIC void qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, uint32_t
| cmd << QUADSPI_CCR_INSTRUCTION_Pos // write opcode | cmd << QUADSPI_CCR_INSTRUCTION_Pos // write opcode
; ;
// Wait for at least 1 free byte location in the FIFO.
while (!(QUADSPI->SR & QUADSPI_SR_FTF)) {
}
// This assumes len==2 // This assumes len==2
*(uint16_t *)&QUADSPI->DR = data; *(uint16_t *)&QUADSPI->DR = data;
} }