cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 wake from STOP2 after periodic adc dma buffer full

sleon.1
Associate II

Working with a Nucleo U575ZI-Q dev kit and STM32CubeIDE. I would like to sample ADC4 using LPTIM1 @4khz, transferring data to a buffer of 256 samples, and then wake up after 256 samples to process the data, then start all over again... I can get the sampling happening correctly (i think, no debug obviously) at the correct frequency in perpetuity, and I can wake from a button EXTI, but I can't seem to figure out how to get the DMA/ADC to stop after it fills the buffer and wake up rather than going back to the beginning and continuing sampling. Is this possible or do I need to create another timer to interrupt from at 4khz/256=~15hz?

Also, is it proper to stop and unlink the scenario when i wake and then start/link again when returning to sleep? Or should I skip those steps and leave it all standing while i'm in run mode?

Regarding debug, there are lots of warnings about it not working when using stop2... Can i leave the debug implemented and only break during run modes or will debug functionality not work at all because i'm entering/exiting stop2?

Thanks,

scott

2 REPLIES 2
Mohamed Aymen HZAMI
ST Employee

Hello @Community member​ and welcome to the community,

You can refer to the firmware example under this path:

STM32Cube\Repository\STM32Cube_FW_U5_V1.2.0\Projects\NUCLEO-U575ZI-Q\Examples\ADC

This repository contains different configuration of ADC.

Or you can download it from this link.

Aymen

this doesn't really answer any of my questions. i'm aware of the example projects.