Skip to content
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

cpu/msp430/periph_uart: Fix uart_write() for USCI peripheral #20572

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

maribu
Copy link
Member

@maribu maribu commented Apr 14, 2024

Contribution description

In TX-only mode the UART was previously release before all bits of the last byte were shifted out. This adds a busy loop waiting while the peripheral is still busy, fixing the issue.

Testing procedure

make BOARD=olimex-msp430-h2618 flash term -C tests/sys/busy_wait now gives:

[...]
2024-04-14 16:05:16,734 # main(): This is RIOT! (Version: 2024.04-devel-652-g3cdc43)
2024-04-14 16:05:16,734 # waiting for 10 µs…
2024-04-14 16:05:16,735 # took 427 µs (diff: 417 µs)
2024-04-14 16:05:16,735 # waiting for 100 µs…
2024-04-14 16:05:16,735 # took 848 µs (diff: 748 µs)
2024-04-14 16:05:16,735 # waiting for 1000 µs…
2024-04-14 16:05:16,735 # took 4508 µs (diff: 3508 µs)
2024-04-14 16:05:16,735 # waiting for 10000 µs…
2024-04-14 16:05:16,736 # took 40651 µs (diff: 30651 µs)
2024-04-14 16:13:23,451 # Exiting Pyterm

With master, there is no output shown because pyterm is waiting for the \n to complete the line. But since \n is incidentally the last char in all strings send (and, therefore, corrupted), it will never show any output.

Issues/PRs references

Regression introduced by #20357

@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: MSP Platform: This PR/issue effects MSP-based platforms CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch labels Apr 14, 2024
@github-actions github-actions bot added the Area: cpu Area: CPU/MCU ports label Apr 14, 2024
@riot-ci
Copy link

riot-ci commented Apr 14, 2024

Murdock results

✔️ PASSED

f4baa0f cpu/msp430/periph_uart: Fix uart_write() for USCI peripheral

Success Failures Total Runtime
10045 0 10045 11m:42s

Artifacts

In TX-only mode the UART was previously release before all bits of the
last byte were shifted out. This adds a busy loop waiting while the
peripheral is still busy, fixing the issue.

Co-authored-by: benpicco <[email protected]>
@maribu maribu force-pushed the cpu/msp430/uart_usci branch from e37a0a2 to f4baa0f Compare April 15, 2024 12:43
@maribu maribu enabled auto-merge April 15, 2024 12:43
@maribu maribu added this pull request to the merge queue Apr 15, 2024
Merged via the queue into RIOT-OS:master with commit 30c9204 Apr 15, 2024
25 checks passed
@maribu maribu deleted the cpu/msp430/uart_usci branch April 16, 2024 06:20
@maribu
Copy link
Member Author

maribu commented Apr 16, 2024

Backport provided in #20584

@maribu
Copy link
Member Author

maribu commented Apr 16, 2024

Thx :)

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: MSP Platform: This PR/issue effects MSP-based platforms Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch 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