Repository navigation
AVR DA/DB: fix for build failure and other smaller fixes - #20677
Merged
Merged
Conversation
Swatantra-66
requested review from
jerpelea,
liuguo09,
simbit18 and
xiaoxiang781216
as code owners
October 15, 2026 05:35
xiaoxiang781216
approved these changes
Oct 15, 2026
acassis
approved these changes
Oct 15, 2026
jerpelea
requested changes
Oct 15, 2026
jerpelea
left a comment
Contributor
There was a problem hiding this comment.
please remove
Signed-off-by: Swatantra Yadav [email protected]
added 4 commits
October 15, 2026 17:02
Patch 4ca2256 did not add required select statement to AVR DA/DB subarchitecture. This patch fixes that. Signed-off-by: Kerogit <[email protected]>
… speed Patch series that includes commits 6e0d325 and b32712d fixed multiple problems with preemptive scheduling combined with tickless configuration. AVR DA/DB family uses tickless system by default and was affected by these bugs too. The patches, however, add more work to preemption code and that work is done with interrupts disabled. This has noticeable impact on USART communication using higher speeds, causing receive buffer overruns and dropped bytes. This patch adds a note about (not) achievable USART baud rate to the documentation. Signed-off-by: Kerogit <[email protected]>
According to their documentation, older AVR chips do not handle stack pointer write in any special way. The newer chips (DA/DB family) on the other hand disable interrupts in hardware when stack pointer low byte is written, making sure that the program has time to also write stack pointer high byte. NuttX already assigns the stack pointer with interrupts disabled but there is no reason to not do the write as intended. The change is only in effect for the newer family and does not affect the older chips. (Compiled binary is identical.) Signed-off-by: Kerogit <[email protected]>
This patch silences a warning caused by unconditionally declared variable which is only used with specific configuration. Also, if the initialization fails, panic instead of returning. (This should not happen since the code runs in initialization phase but silently returning is not the correct action.) Signed-off-by: Kerogit <[email protected]>
Swatantra-66
force-pushed
the
pr/avrdx-fixes-13.1
branch
from
October 15, 2026 11:34
6be690a to
9ee2f29
Compare
Contributor
Author
|
@jerpelea Done. Removed the second |
jerpelea
approved these changes
Oct 15, 2026
This was referenced Oct 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Submitted on behalf of Kerogit [email protected] per the patch series and discussion on [email protected].
Summary
This patch series fixes build failure for AVR DA/DB family and adds some other smaller fixes.
The build failure was caused by patch series that added LIBC_ATOMIC_IRQ Kconfig option during 13.1 development. Commit 4ca2256 selects this option by default for AVR chips but not for the DA/DB family, causing a build failure (atomic functions are missing.) The first patch of this series simply adds missing "select LIBC_ATOMIC_IRQ" for this family as well.
Other than that, version 13.1 added a performance regression which manifested as dropped bytes in USART peripheral during receive (with heavy round-robin preemptive scheduling load.) The regression was bisected to commit b32712d that fixes some bugs (which were affecting AVR DA/DB default build as well) but apparently adds more time-consuming work to context switch with interrupts disabled. The patch for this simply documents this possibility in the USART driver description.
The remaining patches fix unused variable warning, make (very unlikely) board initialization error more visible and reorder manipulation with stack pointer during context restore to do it in the way (presumably) intended by the chip manufacturer.
Impact
After the patch is applied, it is again possible to build the code.
Other than that, there is no impact on existing code/users.
The stack pointer reordering change is done in file shared with other AVR families - #ifdef blocks are used to cause no change for them.
Testing
I confirm that changes are verified on local setup and work as intended:
Testing logs before change:
Testing logs after change:
To verify that the stack pointer change did not affect other AVR families, mega1284p-xplained:nsh was built before and after the change. The resulting binary was identical (with the exception of version string.)
Header and source files were checked by checkpatch with no issues found, spelling checked with aspell.
PR verification Self-Check