Skip to content

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

Merged
maribu merged 1 commit intoRIOT-OS:2024.10-branchfrom
benpicco:backport/2024.10/cpu/sam0_common/periph_adc/errata-2.1.6
Nov 19, 2024
Merged

cpu/sam0_common/periph_adc: add work around for errata 2.1.6 [backport 2024.10]#21001
maribu merged 1 commit intoRIOT-OS:2024.10-branchfrom
benpicco:backport/2024.10/cpu/sam0_common/periph_adc/errata-2.1.6

Conversation

@benpicco
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 19, 2024
@maribu maribu added this pull request to the merge queue Nov 19, 2024
Merged via the queue into RIOT-OS:2024.10-branch with commit 660a3e6 Nov 19, 2024
@maribu
Copy link
Copy Markdown
Member

maribu commented Nov 19, 2024

Yay!

@benpicco benpicco deleted the backport/2024.10/cpu/sam0_common/periph_adc/errata-2.1.6 branch November 19, 2024 10:58
@benpicco benpicco added this to the Release 2024.10 milestone Nov 27, 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