Skip to content

Commit 4556eeb

Browse files
LMESTMadbridge
authored andcommitted
STM32 SPI do not use a timeout for spi transfers
Default timeout of 10ms was reported as an issue in #4300 There seems to be conditions or use cases where the system is loaded with higher priority tasks so that SPI transfer would be delayed more than 10ms. Recommendation from MBED team is to not implement any timeout at all as there is no defined API in MBED to inform application of error cases.
1 parent 9125c0e commit 4556eeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_STM/stm_spi_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ int spi_master_write(spi_t *obj, int value)
357357
size = (handle->Init.DataSize == SPI_DATASIZE_16BIT) ? 2 : 1;
358358

359359
/* Use 10ms timeout */
360-
ret = HAL_SPI_TransmitReceive(handle,(uint8_t*)&value,(uint8_t*)&Rx,size,10);
360+
ret = HAL_SPI_TransmitReceive(handle,(uint8_t*)&value,(uint8_t*)&Rx,size,HAL_MAX_DELAY);
361361

362362
if(ret == HAL_OK) {
363363
return Rx;

0 commit comments

Comments
 (0)