I studied datasheets and driver code but have not found anything that would interfere with its work. When I disabled this error message my code starts to work fine. Tell me please what is the reason to not to support UART4 on STM32F103 ?
It is because DMA2 channels 4 and 5 have a shared IRQ on XL devices that would create conflicts among drivers using those channels (UART and SDIO, we rated SDIO rated more important).
Hi, but if I understood right - this is done already in file stm32_dma.c. This is shared file for both drivers, isn't it? The drivers not use direct ISR - it uses callbacks.
file: "stm32_dma.c" ... /** * @brief DMA2 streams 4 and 5 shared interrupt handler. * @note This IRQ is shared between DMA2 channels 4 and 5 so it is a * bit less efficient because an extra check. * * @isr */ CH_IRQ_HANDLER(DMA2_Ch4_5_IRQHandler) { uint32_t flags;
CH_IRQ_PROLOGUE();
/* Check on channel 4.*/ flags = (DMA2->ISR >> 12) & STM32_DMA_ISR_MASK; if (flags & STM32_DMA_ISR_MASK) { DMA2->IFCR = flags << 12; if (dma_isr_redir[10].dma_func) dma_isr_redir[10].dma_func(dma_isr_redir[10].dma_param, flags); }
/* Check on channel 5.*/ flags = (DMA2->ISR >> 16) & STM32_DMA_ISR_MASK; if (flags & STM32_DMA_ISR_MASK) { DMA2->IFCR = flags << 16; if (dma_isr_redir[11].dma_func) dma_isr_redir[11].dma_func(dma_isr_redir[11].dma_param, flags); }
You may give it a try, that check was added when the DMA handling was not yet centralized. I don't remember if there is some other reason hidden there.