Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/sam0_common/periph_adc: add work around for errata 2.1.6 [backport 2024.10] #21001

Open
wants to merge 1 commit into from

Conversation

benpicco
Copy link
Contributor

Backport of #20994

Contribution description

This adds a delay between enabling the ADC and starting to sample on the SAMD5x MCUs when the internal bandgap reference is used.

image

Testing procedure

Before, adc_sample() on one of the SAMD5x MCUs I have at hands got stuck when the internal bandgap reference was used by never leaving this loop:

0x00001660 in _sample (line=line@entry=0)
    at /home/[email protected]/Repos/software/ML-PA-RIOT/cpu/sam0_common/periph/adc.c:489
489     while (!(dev->INTFLAG.reg & ADC_INTFLAG_RESRDY)) {}

Now, it works also on the "special" MCU that got stuck before:

> saul read 0
2024-11-14 22:14:45,179 # saul read 0
2024-11-14 22:14:45,180 # Reading from #0 (vol|SENSE_ANALOG)
2024-11-14 22:14:45,180 # Data:	          2122 
> saul read 1
2024-11-14 22:14:47,434 # saul read 1
2024-11-14 22:14:47,451 # Reading from #1 (cur|SENSE_ANALOG)
2024-11-14 22:14:47,452 # Data:	            18 

Issues/PRs references

None

This adds a delay between enabling the ADC and starting to sample
on the SAMD5x MCUs when the internal bandgap reference is used.

Co-authored-by: Dylan Laduranty <[email protected]>
(cherry picked from commit a89c924)
@benpicco benpicco added Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Nov 18, 2024
@benpicco benpicco requested a review from maribu November 18, 2024 12:42
Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@dylad dylad enabled auto-merge November 18, 2024 12:46
@riot-ci
Copy link

riot-ci commented Nov 18, 2024

Murdock results

✔️ PASSED

3b9a36e cpu/sam0_common/periph_adc: add work around for errata 2.1.6

Success Failures Total Runtime
10215 0 10215 19m:09s

Artifacts

@dylad dylad added this pull request to the merge queue Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants