Skip to content

Commit 355bd2c

Browse files
committed
stm32/spi: Disable WFI for H7.
- See DM00257543 2.2.5
1 parent 4d82d77 commit 355bd2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ports/stm32/spi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,14 @@ static HAL_StatusTypeDef spi_wait_dma_finished(const spi_t *spi, uint32_t t_star
598598
enable_irq(irq_state);
599599
return HAL_OK;
600600
}
601+
// See DM00257543 2.2.5
602+
// The DTCM-RAM is not accessible in read during Sleep mode (when the CPU clock is
603+
// gated). When a read access to the DTCM-RAM is performed by an AHB bus master
604+
// (that are the DMAs) while the CPU is in sleep mode (CPU clock is gated), the
605+
// data is not transmitted to the AHB bus and the AHB master reads 0x0000_0000.
606+
#if !defined(STM32F7)
601607
__WFI();
608+
#endif
602609
enable_irq(irq_state);
603610
if (HAL_GetTick() - t_start >= timeout) {
604611
return HAL_TIMEOUT;

0 commit comments

Comments
 (0)