-
Notifications
You must be signed in to change notification settings - Fork 7k
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
drivers: adc: stm32: dma support #52965
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0d6b094
to
9448087
Compare
9448087
to
43b1913
Compare
This was referenced Dec 14, 2022
54a2f83
to
a429f48
Compare
This test contained NXP specific functions, for example the counter trigger, which is not required for all ADC DMA implementations. Also moved NXP specific kconfigs to appropriate board files Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
a9f1a04
to
17e5a85
Compare
I added an addtional commit to remove |
These test uses DMA which sometimes require buffers to be placed in custom specific section. This is not compatible with ztest userspace, which requires variables to be placed in a specific partition. Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
Adds nucleo_h732zi ADC DMA unit tests with multiple channels. The STM32 ADC DMA driver requires the buffers to be placed in a non-cacheable memory region as defined by the DMA. Therefore this adds configurability to the test to change the region the buffer is placed in. Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
Previously the contents of buffers after an ADC DMA read was simply printed, but not verified with an zassert that the value was updated. This commit updates it to be similar to the adc_api test that fills the buffer initially with a known value, which is then used to ensure the ADC DMA functioned successfully. Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
17e5a85
to
45934a1
Compare
erwango
approved these changes
Mar 13, 2023
gautierg-st
approved these changes
Mar 14, 2023
DNM until @FRASTM could have a chance to review (probably today) |
FRASTM
approved these changes
Mar 20, 2023
heinwessels
added a commit
to fancom/zephyr
that referenced
this pull request
Mar 21, 2023
STM32 ADC DMA support added in zephyrproject-rtos#52965 incorrectly assumed that all ADC devices have a OVR flag. This commit changes the driver to only account for it if it's found in the LL drivers. Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
carlescufi
pushed a commit
that referenced
this pull request
Mar 22, 2023
STM32 ADC DMA support added in #52965 incorrectly assumed that all ADC devices have a OVR flag. This commit changes the driver to only account for it if it's found in the LL drivers. Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
heinwessels
added a commit
to fancom/zephyr
that referenced
this pull request
Mar 23, 2023
In zephyrproject-rtos#53184 a linker section for SRAM4 was added because it's required for use with the STM32H7 BDMA. Now in zephyrproject-rtos#52965 support was added for the ADC DMA which expects a similar linker section which is non-cachable, but is limited to use SRAM4 to place it's buffers. This commit gives the user more flexibility to use any SRAM region to place buffers to use with ADC DMA. The region SRAM0 isn't supported because it doesn't have the "zephyr,memory-region" compatibility required to turn it into a non-cacheable region, meaning it doesn't fit the mentioned use case. Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
This was referenced May 11, 2023
This was referenced Aug 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: ADC
Analog-to-Digital Converter (ADC)
area: DMA
Direct Memory Access
platform: STM32
ST Micro STM32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The STM32 ADC already supports sampling multiple channels in one sequence. This nwo PR allows those channels to be read in one go using the DMA.
Support for multiple channel sampling for the STM32 was originally part of this PR, but split off in #53534.
Currently dependent on #54156 for a final check
Notes:
bdma
which will add support for running ADC3 through DMA as well.ADC_ACTION_REPEAT
. Adding continous sampling will require changes toadc_context
, which has an open discussion here: New ADC Interface for Continuous Sampling #48478