1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-29 23:07:42 +00:00

🐛 Fix STM32 SDIO/FSMC DMA overlap (#27385)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
konradmb 2024-09-05 19:06:59 +02:00 committed by GitHub
parent a0815deb9a
commit 17a5a1f97d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

@ -238,7 +238,7 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {
hdma_sdio.Init.MemInc = DMA_MINC_ENABLE; hdma_sdio.Init.MemInc = DMA_MINC_ENABLE;
hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_sdio.Init.Priority = DMA_PRIORITY_LOW; hdma_sdio.Init.Priority = DMA_PRIORITY_MEDIUM;
__HAL_LINKDMA(&hsd, hdmarx, hdma_sdio); __HAL_LINKDMA(&hsd, hdmarx, hdma_sdio);
__HAL_LINKDMA(&hsd, hdmatx, hdma_sdio); __HAL_LINKDMA(&hsd, hdmatx, hdma_sdio);

View File

@ -111,11 +111,11 @@ void TFT_FSMC::init() {
HAL_SRAM_Init(&SRAMx, &timing, &extTiming); HAL_SRAM_Init(&SRAMx, &timing, &extTiming);
__HAL_RCC_DMA2_CLK_ENABLE();
#ifdef STM32F1xx #ifdef STM32F1xx
DMAtx.Instance = DMA2_Channel1; __HAL_RCC_DMA1_CLK_ENABLE();
DMAtx.Instance = DMA1_Channel1;
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
__HAL_RCC_DMA2_CLK_ENABLE();
DMAtx.Instance = DMA2_Stream0; DMAtx.Instance = DMA2_Stream0;
DMAtx.Init.Channel = DMA_CHANNEL_0; DMAtx.Init.Channel = DMA_CHANNEL_0;
DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
@ -182,6 +182,7 @@ void TFT_FSMC::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t cou
DMAtx.Init.PeriphInc = memoryIncrease; DMAtx.Init.PeriphInc = memoryIncrease;
HAL_DMA_Init(&DMAtx); HAL_DMA_Init(&DMAtx);
HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count); HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count);
TERN_(TFT_SHARED_IO, while (isBusy()));
} }
void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {

View File

@ -337,7 +337,7 @@ void TFT_SPI::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t coun
SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request
#endif #endif
TERN_(TFT_SHARED_IO, while (isBusy()) { /* nada */ }); TERN_(TFT_SHARED_IO, while (isBusy()));
} }
void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {