ADC+DMA First Conversion Timeout

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC+DMA First Conversion Timeout

441 Views
JhonYF
Contributor III

MCU:s32k312

Problem Description:​
When using ADC with DMA in group conversion mode, I'm observing a consistent issue where the ​​first conversion start (Adc_StartGroupConversion)​​ always results in a ​​timeout condition​​. Specifically:

  • The ​​group notification callback is never triggered​
  • When polling the ​​group status in a task​​, it remains stuck at ​​"busy"​​ indefinitely

If I execute a ​​timeout handler​​ (triggered by the initial failure), which calls Adc_StopGroupConversion followed by a ​​second Adc_StartGroupConversion​​, subsequent conversions work ​​flawlessly​​ without any further issues.

Adc_StartGroupConversion(gularrMcuWrapAdcGroups[ulAdcIter]); Adc_StopGroupConversion(gularrMcuWrapAdcGroups[ulAdcIter]);

Question:​

  • Has anyone encountered similar behavior where the ​​first ADC group conversion fails​​ (timeout/busy status) but works fine afterward?
  • Is this a known ​​initialization sequence requirement​​ for ADC+DMA groups (e.g., needing a dummy conversion to "prime" the hardware)?
  • Could this be related to ​​clock gating, power-on state, or DMA initialization timing​​?

Looking for insights on root cause or recommended initialization practices to avoid this workaround.

0 Kudos
Reply
0 Replies
%3CLINGO-SUB%20id%3D%22lingo-sub-2145726%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EADC%2BDMA%20First%20Conversion%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2145726%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EMCU%3As32k312%3C%2FP%3E%3CP%3E%3CSTRONG%3EProblem%20Description%3A%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%3CBR%20%2F%3EWhen%20using%20ADC%20with%20DMA%20in%20group%20conversion%20mode%2C%20I'm%20observing%20a%20consistent%20issue%20where%20the%20%E2%80%8B%3CSTRONG%3E%E2%80%8Bfirst%20conversion%20start%20(Adc_StartGroupConversion)%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%20always%20results%20in%20a%20%E2%80%8B%3CSTRONG%3E%E2%80%8Btimeout%20condition%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B.%20Specifically%3A%3C%2FP%3E%3CUL%3E%3CLI%3EThe%20%E2%80%8B%3CSTRONG%3E%E2%80%8Bgroup%20notification%20callback%20is%20never%20triggered%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%3C%2FLI%3E%3CLI%3EWhen%20polling%20the%20%E2%80%8B%3CSTRONG%3E%E2%80%8Bgroup%20status%20in%20a%20task%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%2C%20it%20remains%20stuck%20at%20%E2%80%8B%3CSTRONG%3E%E2%80%8B%22busy%22%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%20indefinitely%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%3EIf%20I%20execute%20a%20%E2%80%8B%3C%2FSPAN%3E%3CSTRONG%3E%E2%80%8Btimeout%20handler%E2%80%8B%3C%2FSTRONG%3E%3CSPAN%3E%E2%80%8B%20(triggered%20by%20the%20initial%20failure)%2C%20which%20calls%26nbsp%3B%3C%2FSPAN%3EAdc_StopGroupConversion%3CSPAN%3E%26nbsp%3Bfollowed%20by%20a%20%E2%80%8B%3C%2FSPAN%3E%3CSTRONG%3E%E2%80%8Bsecond%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAdc_StartGroupConversion%E2%80%8B%3C%2FSTRONG%3E%3CSPAN%3E%E2%80%8B%2C%20subsequent%20conversions%20work%20%E2%80%8B%3C%2FSPAN%3E%3CSTRONG%3E%E2%80%8Bflawlessly%E2%80%8B%3C%2FSTRONG%3E%3CSPAN%3E%E2%80%8B%20without%20any%20further%20issues.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAdc_StartGroupConversion(gularrMcuWrapAdcGroups%5BulAdcIter%5D)%3B%20Adc_StopGroupConversion(gularrMcuWrapAdcGroups%5BulAdcIter%5D)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EQuestion%3A%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%3C%2FP%3E%3CUL%3E%3CLI%3EHas%20anyone%20encountered%20similar%20behavior%20where%20the%20%E2%80%8B%3CSTRONG%3E%E2%80%8Bfirst%20ADC%20group%20conversion%20fails%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%20(timeout%2Fbusy%20status)%20but%20works%20fine%20afterward%3F%3C%2FLI%3E%3CLI%3EIs%20this%20a%20known%20%E2%80%8B%3CSTRONG%3E%E2%80%8Binitialization%20sequence%20requirement%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%20for%20ADC%2BDMA%20groups%20(e.g.%2C%20needing%20a%20dummy%20conversion%20to%20%22prime%22%20the%20hardware)%3F%3C%2FLI%3E%3CLI%3ECould%20this%20be%20related%20to%20%E2%80%8B%3CSTRONG%3E%E2%80%8Bclock%20gating%2C%20power-on%20state%2C%20or%20DMA%20initialization%20timing%E2%80%8B%3C%2FSTRONG%3E%E2%80%8B%3F%3C%2FLI%3E%3C%2FUL%3E%3CP%3ELooking%20for%20insights%20on%20root%20cause%20or%20recommended%20initialization%20practices%20to%20avoid%20this%20workaround.%3C%2FP%3E%3C%2FLINGO-BODY%3E