STM32U5 wake from STOP2 after periodic adc dma buffer full
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