Solved
I ran the following code to reconfigure the SPI running on an STM32F103, but the DMA settings do not seem to be updated. Is there any solution?
// SPI_HandleTypeDef *hspi
// DMA_HandleTypeDef *hdmatx
hspi->Init.DataSize = SPI_DATASIZE_16BIT;
hdmatx->Init.MemInc = DMA_MINC_DISABLE;
hdmatx->Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
hdmatx->Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
while( hspi->State != HAL_SPI_STATE_READY );
HAL_DMA_DeInit(hdmatx);
HAL_DMA_Init(hdmatx);
HAL_SPI_DeInit(hspi);
HAL_SPI_Init(hspi);