Hi Giovanni,
I'm upgrading Chibios to the latest and I found what I think it's a bug. STM32F103 shared the DMA2 channel 4 and channel 5 irqs, but on the DMA code they're different (I think that's fine for F105 and F107). As a result the irqs are never called (this is for ADC3 DMA).
Ian
STM32 DMA channel two irqs 4 and 5 shared
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: STM32 DMA channel two irqs 4 and 5 shared
Hi Ian,
Thanks, it will be fixed in 2.3.3, luckily now the DMA ISRs are centralized in the DMA driver so sharing is not an issue.
Giovanni
Thanks, it will be fixed in 2.3.3, luckily now the DMA ISRs are centralized in the DMA driver so sharing is not an issue.
Giovanni
Re: STM32 DMA channel two irqs 4 and 5 shared
I also discovered another small detail. In dmaAllocate for DMA2_ID it was checking against dmamsk1 instead of dmamsk2, so if I had dma1 going it was not enabling the RCC for DMA2.
Ian
Ian
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: STM32 DMA channel two irqs 4 and 5 shared
Just a note, if you need ADC3 you may register it on channel 4, it should work.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: STM32 DMA channel two irqs 4 and 5 shared
ianmga wrote:I also discovered another small detail. In dmaAllocate for DMA2_ID it was checking against dmamsk1 instead of dmamsk2, so if I had dma1 going it was not enabling the RCC for DMA2.
Ian
I fixed this in the repository, the shared channel will have to wait tomorrow.
Giovanni
Re: STM32 DMA channel two irqs 4 and 5 shared
Giovanni wrote:Just a note, if you need ADC3 you may register it on channel 4, it should work.
Giovanni
I got it working on channel 5, but I still had to rename the IRQ handler... I think... It didn't occur to me to try it on channel 4.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: STM32 DMA channel two irqs 4 and 5 shared
Hi Ian,
I am going to fix this in 2.3.2 (this weekend I hope) by not supporting the IRQ for channel 4 which is only used by the SDIO. The SDIO peripheral is done in such a way to not require an IRQ from the DMA channel so it is perfectly acceptable.
The IRQ can be used by ADC3 alone.
Giovanni
I am going to fix this in 2.3.2 (this weekend I hope) by not supporting the IRQ for channel 4 which is only used by the SDIO. The SDIO peripheral is done in such a way to not require an IRQ from the DMA channel so it is perfectly acceptable.
The IRQ can be used by ADC3 alone.
Giovanni