Skip to content

[Bug]: CubeMx allows an invalid combination of parameters for ADC with DMA #338

@giuliomoro

Description

@giuliomoro

Bug Summary

CubeMx allows an invalid combination of parameters for ADC with DMA

Detailed Description

When DMA is enabled on an ADC, DMA requests will only be issued if ADC_InitTypeDef::ConversionDataManagement is set to ADC_CONVERSIONDATA_DMA_ONESHOT or ADC_CONVERSIONDATA_DMA_CIRCULAR. That is to say, ADC_CONVERSIONDATA_DR and ADC_CONVERSIONDATA_DFSDM are invalid when DMA is enabled.

The issue is that if Conversion Data Management Mode is not set to ADC_CONVERSIONDATA_DMA_CIRCULAR or ADC CONVERSIONDATA DR ADC_CONVERSIONDATA_DMA_ONESHOT, then CubeMx will generate some unusable code.

CubeMx could detect and flag this issue for the user. Or it could disable non-DMA values when DMA is enabled. Or it could make it more obvious to the user some other way that there is some DMA-relevant (and, indeed, crucial) setting in that otherwise irrelevant-looking "Conversion Data Management Mode".

Expected Behavior

No response

Actual Behavior

No response

Environment

CubeMx 6.16.1, STM32H743VITx, ADC1

Severity

None

Metadata

Metadata

Assignees

Labels

adcAnalog-to-Digital Convertercube mxIssue related to the Cube MX tool rather than the firmware published within this repositoryenhancementNew feature or requestinternal bug trackerIssue confirmed and logged into the internal bug tracking system

Type

Projects

Status

Analyzed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions