tests: drivers: uart: baudrate_test: Improve accuracy measurement - #28455
Merged
Conversation
nordic-krch
force-pushed
the
uart_baudrate_test
branch
2 times, most recently
from
April 29, 2026 12:18
7c5b06d to
854ce59
Compare
nordic-piks
approved these changes
Apr 29, 2026
Contributor
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:sdk-nrf: PR head: a24ca615f01723a65d8fc6f75b79b511a8693fa9 more detailssdk-nrf:
Github labels
List of changed files detected by CI (2)Outputs:ToolchainVersion: 53ac68dd62 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
|
You can find the documentation preview for this PR here. |
nordic-segl
approved these changes
Apr 29, 2026
Remove unused parameter for the test function. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Test was reporting high deviation 17-25% which seemed high. Such measurement inaccuracy was due to 3 reasons: - using gpio Zephyr API for reading pin state which is twice longer than using GPIO HAL - assumption that stop bits are also 0 and should be included in the measurement. UART stop bits are 1 so they should not be included - starting UART transfer and then starting the measurement. For high baudrates beginning of the byte was not included in the measurement as first gpio read was already 0. All issues have been fixed: - Reduced number of bits in the frame (biggest gain). - Using GPIO HAL for reading the input - sampling frequency is doubled. - Transferring 2 bytes and measuring the second byte which improved accuracy for higher baudrates. Additionally, reduced number of repeats from 10 to 3 to shorten the test. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
nordic-krch
force-pushed
the
uart_baudrate_test
branch
from
April 29, 2026 13:17
854ce59 to
a24ca61
Compare
tejlmand
approved these changes
May 4, 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.
Test was reporting high deviation 17-25% which seemed high. Such measurement inaccuracy was due to 3 reasons:
All issues have been fixed:
Additionally, reduced number of repeats from 10 to 3 to shorten the test.