cancel
Showing results for 
Search instead for 
Did you mean: 

When enabling DMA Continuous Request on ADC3 the LCD no longer works [STM32F746G-Disco]

Michael B
Associate III

I'm trying to get the ADC to work with DMA Continuous Requests, and am not having any luck. I've actually seen it work once, totally randomly, but on subsequent runs all I get is a white screen on startup. I see the ADC is indeed still calling HAL_ADC_ConvCpltCallback and the buffer is updating , but it seems to break LCD functionality.

I've tried setting ADC3 to Stream 1 instead of the default Stream 0, but that didn't help. I'm kind of at a loss as to what the actual issue is. Anyone with more experience know what might be happening?

ADC3 settings:

Clock Prescaler: PCLK2 divided by 4

Resolution: 12 bits

Scan Conversion Mode: Enabled

Continuous Conversion: Enabled

DMA Continuous Request: Enabled

Number of Conversions: 2

  • Channel 4, Channel 5

Stream: DMA2 Stream 1

Mode: Circular

Data Width: WORD

NVIC: ADC1/ADC2/ADC3 Global interrupts enabled

1 ACCEPTED SOLUTION

Accepted Solutions
Michael B
Associate III

I think I've figured it out. According to another post I read and the F7 ADC Presentation PDF (only found via Google), the F7 ADC can be run at max 36Mhz. My main HCLK is 200Mhz and my prescaler for APB2 was /4 so it was trying to clock it at 50Mhz. Setting the APB2 Prescaler to anything above /8 it starts working again.

It would be nice if they would put that kind of stuff in the documentation for the STM32F746G-DISCO, but they don't. It's not even linked as a document.

View solution in original post

7 REPLIES 7

ADC-triggered DMA overloading the RAM/bus from which the LCD runs?

Try to increase ADC sampling time to maximum and/or decrease clock, any change?

JW

Hi JW - I've tried both suggestions (sampling time to either 3 cycles or 480 cycles) and tried all prescaler settings.

An odd tidbit, I can't find a way to set the ADC clock in CubeMX on the F7. I see lots of people doing that on the F4 or other micro's but its not present for the F7 (unless they call it something else). I see it's set by the APB2 peripheral clock. Odd they don't indicate that in the main manual for the F7.

And what happens if you *don't* enable ADC-related interrupts?

I don't use the 'F7, nor Cube, just trying to suggest some generic ideas.

JW

No change, it has no effect on the problem.

Michael B
Associate III

I think I've figured it out. According to another post I read and the F7 ADC Presentation PDF (only found via Google), the F7 ADC can be run at max 36Mhz. My main HCLK is 200Mhz and my prescaler for APB2 was /4 so it was trying to clock it at 50Mhz. Setting the APB2 Prescaler to anything above /8 it starts working again.

It would be nice if they would put that kind of stuff in the documentation for the STM32F746G-DISCO, but they don't. It's not even linked as a document.

> Setting the APB2 Prescaler to anything above /8 it starts working again.

Huh, that's strange.

Thanks for coming back with the solution.

> It would be nice if they would put that kind of stuff in the documentation for the STM32F746G-DISCO, but they don't.

The DISCO web folder contains (or should contain) only info directly related to the DISCO board itself; for the details on the target mcu you are supposed to go into that mcu's folder. Not that a link at the DISCO's folder wold hurt anything; but then there are much worse sins on the STM32-related portion of ST's web.

JW

Yea it just seems like ST as a company is horribly organized. It really shows in their software and documentation practices, which makes using their stuff a real pain.