-
Couldn't load subscription status.
- Fork 8.1k
drivers: i2s: add sai support for stm32h7xx #92887
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
1 change: 1 addition & 0 deletions
1
samples/drivers/i2s/output/boards/nucleo_h745zi_q_stm32h745xx_m7.conf
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| CONFIG_HEAP_MEM_POOL_SIZE=4192 |
41 changes: 41 additions & 0 deletions
41
samples/drivers/i2s/output/boards/nucleo_h745zi_q_stm32h745xx_m7.overlay
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright (c) 2025 ZAL Zentrum für Angewandte Luftfahrtforschung GmbH | ||
| * Copyright (c) 2025 Mario Paja | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| / { | ||
| aliases { | ||
| i2s-tx = &sai1_b; | ||
| }; | ||
| }; | ||
|
|
||
| &pll2 { | ||
| /* 44.1KHz (0.03% Error) */ | ||
| div-m = <8>; | ||
| mul-n = <192>; | ||
| div-q = <2>; | ||
| div-r = <2>; | ||
| div-p = <17>; | ||
| clocks = <&clk_hse>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &sai1_b { | ||
| pinctrl-0 = <&sai1_mclk_b_pf7 &sai1_sd_b_pe3 | ||
| &sai1_fs_b_pf9 &sai1_sck_b_pf8>; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit pick: Indentation |
||
| pinctrl-names = "default"; | ||
| status = "okay"; | ||
| mclk-enable; | ||
| mclk-divider = "div-256"; | ||
| dma-names = "tx"; | ||
| }; | ||
|
|
||
| &dmamux1{ | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &dma1{ | ||
| status = "okay"; | ||
| }; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't clear initially how we determine channel direction (as we don't use channel-config flags for that). But after digging a little deeper, I see that it just depends on
dma-namesvalue. I guess that is OK.In rest - looks good.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evgeniy-paltsev It was difficult to decide what was the best way to implement the DMA TX/RX configuration, since all configs are fixed except the direction.
Making it dependant on
dma-namesseemed like the best choise at the moment to keep the driver as simple as possible, but I am always open to discuss this topic and make changes :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked other (stm32) dma-capable drivers and they use same approach, so I think it should be also OK for I2S implementation.
At least it is aligned with other drivers :)