mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #368 from miiicmueller/master
SPI timeout in slave mode, due to internal chip error
This commit is contained in:
commit
2e67a80bf3
@ -3486,6 +3486,18 @@ static HAL_StatusTypeDef SPI_EndRxTxTransaction(SPI_HandleTypeDef *hspi, uint32_
|
|||||||
SET_BIT(hspi->ErrorCode, HAL_SPI_ERROR_FLAG);
|
SET_BIT(hspi->ErrorCode, HAL_SPI_ERROR_FLAG);
|
||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* BUSY bit may stay high at the end of a data transfer
|
||||||
|
in Slave mode. See STM32F7 erratasheet (DM00145382, 2.11.2)
|
||||||
|
Workaround "Alternative" is proposed :
|
||||||
|
-> We assume that at this moment, the last byte is not sent now,
|
||||||
|
and that the disable operation is quicker than the end of
|
||||||
|
last byte transmission. */
|
||||||
|
if (hspi->Init.Mode == SPI_MODE_SLAVE)
|
||||||
|
{
|
||||||
|
__HAL_SPI_DISABLE(hspi);
|
||||||
|
}
|
||||||
|
|
||||||
/* Control the BSY flag */
|
/* Control the BSY flag */
|
||||||
if (SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout, Tickstart) != HAL_OK)
|
if (SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout, Tickstart) != HAL_OK)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user