STM32H7 ADCv4 dual mode DMA issue

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
piers
Posts: 37
Joined: Fri Apr 06, 2012 1:02 am
Location: Netherlands
Been thanked: 12 times
Contact:

STM32H7 ADCv4 dual mode DMA issue

Postby piers » Wed Jul 29, 2020 11:27 am

I did discover another problem with ADCv4 in dual mode, which is not really in ChibiOS but appears to be in the hardware.

The readings from the slave ADC are delayed by one sample. This is because the DMA transfer seems to be triggered by the master EOC, just before the slave has put the data into the CDR.

When I select the same sample time for master and slave the DMA reads the previous slave sample. When the slave sample time is shorter than the master sample time it works correctly. When the sample time of the slave is larger than the master sample time the DMA transfer is triggered at the master EOC, so way before the slave is finished.

Figure 202 of RM0433 (page 996) very clearly shows that the DMA request should only be triggered after both master and slave EOC, but appears to be always triggered after the master EOC.

This issue is already on the ST community forum: https://community.st.com/s/question/0D7 ... =1&s1ext=0

There is no answer from ST yet, but it appears the HAL should be changed to used 2 DMA channels instead of one, but I don't know if that can be done without API changes. Hopefully there is still a way to get it working.

User avatar
Giovanni
Site Admin
Posts: 13074
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 758 times
Been thanked: 637 times
Contact:

Re: STM32H7 ADCv4 dual mode DMA issue

Postby Giovanni » Wed Jul 29, 2020 1:31 pm

It is obviously an HW problem.

Is it possible to have the (single) DMA be triggered by the slave ADC? in that moment the master sample should already be available. It would be worth trying.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 13074
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 758 times
Been thanked: 637 times
Contact:

Re: STM32H7 ADCv4 dual mode DMA issue

Postby Giovanni » Wed Jul 29, 2020 1:36 pm

Just a note about dual DMA "solution", it would not fit our HAL, that would mean having 2 circular buffers, one for each ADC, the API does not support that.

Giovanni

User avatar
piers
Posts: 37
Joined: Fri Apr 06, 2012 1:02 am
Location: Netherlands
Been thanked: 12 times
Contact:

Re: STM32H7 ADCv4 dual mode DMA issue

Postby piers » Wed Aug 05, 2020 10:08 am

Giovanni wrote:Is it possible to have the (single) DMA be triggered by the slave ADC?

Good idea. I did a quick test by using

Code: Select all

dmaSetRequestSource(adcp->data.dma, STM32_DMAMUX1_ADC2);
in hal_adc_lld.c, but it didn't immediately work. DMA didn't seem to trigger. I'll have another look when I've got more time.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 7 guests