Possible HAL spi bug?, also question on fast spi dma transfer initiation.
In :
/stm32h745nucleoTest_CM7/Drivers/STM32H7xx_HAL_Driver/stm32h7xx_hal_dma.c
we find:
if(IS_DMA_STREAM_INSTANCE(hdma->Instance) != 0U) /* DMA1 or DMA2 instance */
{
/* Clear all interrupt flags at correct offset within the register */
regs_dma->IFCR = 0x3FUL << (hdma->StreamIndex & 0x1FU);
surely 0x3FUL will over write the bottom bit of the next channel entry?
My next question:
I use:
HAL_SPI_Transmit_DMA(&hspi1, (uint8_t*)StartAddress, n);
to write a burst of 24 bit spi words.
However the HAL code is exhaustive and quite slow.
What do I need to do to quickly trigger another burst using the same spi and dma channels, but with a different source memory pointer, what is the minimum amount of register writes that are needed?. The following code is missing something vital, but I cant figure it out:
SPI2->CR1 &= ~1;
SPI2->CFG1 &= ~1<<15;//txdmaen
DMA1_Stream4->CR &= ~1;
DMA1_Stream4->CR |= 1<<5;
DMA1_Stream4->NDTR = n;
DMA1_Stream4->M0AR = StartAddress;
DMA1->HIFCR = 0x1f;
DMA1_Stream4->CR |= 1<<4;
DMA1_Stream4->CR |=1;
SPI2->CR2 |= n;
SPI2->CFG1 |= 1<<15;//txdmaen
SPI2->CFG2 |= 1<22;// master mode bit set
SPI2->CR1 |= 1 ;
SPI2->CR1 |= 1<<9;
