Code: Select all
#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
SPIConfig spi_cfg = {
false, // no circular buffer
#if defined(HAL_LLD_SELECT_SPI_V2)
false, // no slave mode
NULL, // no callback
#endif
NULL, // no callback
spi_resolve_slave_port(t->slave_idx),
spi_resolve_slave_pin(t->slave_idx),
SPI_CFG1_DSIZE_VALUE(7) | SPI_CFG1_MBR_VALUE(3),
SPI_CFG2_CPHA | SPI_CFG2_CPOL,
}
spiStart(..., &spi_cfg);
spiSelect(...);
spiExchange(...); // Done with non-cached memory in first 64k of ram0 (0x24000000)
spiUnselect(...);
I'm not sure where this might be coming from. The transfer of 2 bytes is correct, but somehow there is long wait after that and an extra clock pulse. Does someone have an idea or a way to debug this more easily?